ug4
elliptic_cylinder_projector.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016: G-CSC, Goethe University Frankfurt
3  * Author: Markus Breit
4  *
5  * This file is part of UG4.
6  *
7  * UG4 is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License version 3 (as published by the
9  * Free Software Foundation) with the following additional attribution
10  * requirements (according to LGPL/GPL v3 §7):
11  *
12  * (1) The following notice must be displayed in the Appropriate Legal Notices
13  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14  *
15  * (2) The following notice must be displayed at a prominent place in the
16  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17  *
18  * (3) The following bibliography is recommended for citation and must be
19  * preserved in all covered files:
20  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21  * parallel geometric multigrid solver on hierarchically distributed grids.
22  * Computing and visualization in science 16, 4 (2013), 151-164"
23  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24  * flexible software system for simulating pde based models on high performance
25  * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  * GNU Lesser General Public License for more details.
31  */
32 
33 #ifndef UG__LIB_GRID__REFINEMENT__PROJECTORS__ELLIPTIC_CYLINDER_PROJECTOR_H
34 #define UG__LIB_GRID__REFINEMENT__PROJECTORS__ELLIPTIC_CYLINDER_PROJECTOR_H
35 
37 #include "refinement_projector.h"
38 
39 
40 namespace ug {
42 
51 : public RefinementProjector
52 {
53  public:
55 
57  (
58  const vector3& center,
59  const vector3& cylAxis,
60  const vector3& ellipseAxis1,
61  const vector3& ellipseAxis2
62  );
63 
65  (
66  const vector3& center,
67  const vector3& cylAxis,
68  const vector3& ellipseAxis1,
69  const vector3& ellipseAxis2,
71  );
72 
74  (
75  const vector3& center,
76  const vector3& cylAxis,
77  const vector3& ellipseAxis1,
78  const vector3& ellipseAxis2,
79  number radius,
80  number influenceRadius
81  );
82 
84  (
86  const vector3& center,
87  const vector3& cylAxis,
88  const vector3& ellipseAxis1,
89  const vector3& ellipseAxis2,
90  number radius,
91  number influenceRadius
92  );
93 
95 
96  void set_center(const vector3& center);
97  const vector3& center() const;
98 
99  void set_cylinder_axis(const vector3& axis);
100  const vector3& cylinder_axis() const;
101 
102  void set_ellipse_axis1(const vector3& axis);
103  const vector3& ellipse_axis1() const;
104 
105  void set_ellipse_axis2(const vector3& axis);
106  const vector3& ellipse_axis2() const;
107 
108  void set_radius(number radius);
109  number radius() const;
110 
111  void set_influence_radius(number influenceRadius);
112  number influence_radius() const;
113 
114 
116  virtual number new_vertex(Vertex* vrt, Edge* parent);
117 
119  virtual number new_vertex(Vertex* vrt, Face* parent);
120 
122  virtual number new_vertex(Vertex* vrt, Volume* parent);
123 
124 
125  private:
128 
129  template <class TElem>
130  number perform_projection(Vertex* vrt, TElem* parent);
131 
133 
134  template <class Archive>
135  void serialize(Archive& ar, const unsigned int version)
136  {
137  ar & make_nvp("center", m_center);
138  ar & make_nvp("cylAxis", m_cylinder_axis);
139  ar & make_nvp("ellipseAxis1", m_ellipse_axis1);
140  ar & make_nvp("ellipseAxis2", m_ellipse_axis2);
141  ar & make_nvp("radius", m_radius);
142  ar & make_nvp("influence radius", m_influenceRadius);
144 
145  // this is only needed during load, but does not hurt during save either
149  }
150 
151 
152  private:
159 
163 };
164 
165 } // namespace ug
166 
167 #endif // UG__LIB_GRID__REFINEMENT__PROJECTORS__ELLIPTIC_CYLINDER_PROJECTOR_H
#define UG_EMPTY_BASE_CLASS_SERIALIZATION(clsDerived, clsBase)
Definition: boost_serialization.h:51
Base-class for edges.
Definition: grid_base_objects.h:397
Projects new vertices onto a cylinder with an elliptic base.
Definition: elliptic_cylinder_projector.h:52
void set_center(const vector3 &center)
Definition: elliptic_cylinder_projector.cpp:148
number m_a
Definition: elliptic_cylinder_projector.h:161
virtual number new_vertex(Vertex *vrt, Edge *parent)
called when a new vertex was created from an old edge
Definition: elliptic_cylinder_projector.cpp:219
void serialize(Archive &ar, const unsigned int version)
Definition: elliptic_cylinder_projector.h:135
void set_influence_radius(number influenceRadius)
Definition: elliptic_cylinder_projector.cpp:207
number influence_radius() const
Definition: elliptic_cylinder_projector.cpp:212
const vector3 & center() const
Definition: elliptic_cylinder_projector.cpp:153
vector3 m_ellipseNormal
Definition: elliptic_cylinder_projector.h:160
number m_b
Definition: elliptic_cylinder_projector.h:162
const vector3 & ellipse_axis1() const
Definition: elliptic_cylinder_projector.cpp:177
number scale_point_to_radius(vector3 &vIO, number r)
Definition: elliptic_cylinder_projector.cpp:251
void set_ellipse_axis2(const vector3 &axis)
Definition: elliptic_cylinder_projector.cpp:183
number m_influenceRadius
Definition: elliptic_cylinder_projector.h:158
const vector3 & cylinder_axis() const
Definition: elliptic_cylinder_projector.cpp:164
number radial_ellipse_coord(const vector3 &v)
Definition: elliptic_cylinder_projector.cpp:236
number m_radius
Definition: elliptic_cylinder_projector.h:157
vector3 m_center
Definition: elliptic_cylinder_projector.h:153
number radius() const
Definition: elliptic_cylinder_projector.cpp:201
EllipticCylinderProjector()
Definition: elliptic_cylinder_projector.cpp:42
vector3 m_ellipse_axis2
Definition: elliptic_cylinder_projector.h:156
void set_radius(number radius)
Definition: elliptic_cylinder_projector.cpp:196
vector3 m_cylinder_axis
Definition: elliptic_cylinder_projector.h:154
vector3 m_ellipse_axis1
Definition: elliptic_cylinder_projector.h:155
const vector3 & ellipse_axis2() const
Definition: elliptic_cylinder_projector.cpp:190
void set_ellipse_axis1(const vector3 &axis)
Definition: elliptic_cylinder_projector.cpp:170
friend class boost::serialization::access
Definition: elliptic_cylinder_projector.h:132
number perform_projection(Vertex *vrt, TElem *parent)
Definition: elliptic_cylinder_projector.cpp:277
void set_cylinder_axis(const vector3 &axis)
Definition: elliptic_cylinder_projector.cpp:159
virtual ~EllipticCylinderProjector()
Definition: elliptic_cylinder_projector.cpp:143
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
Adjusts vertex coordinates during refinement.
Definition: refinement_projector.h:55
virtual SPIGeometry3d geometry() const
Definition: refinement_projector.h:81
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
Volumes are 3-dimensional objects.
Definition: grid_base_objects.h:754
double number
Definition: types.h:124
vector_t::value_type VecLength(const vector_t &v)
returns the length of v. Slower than VecLengthSq.
Definition: math_vector_functions_common_impl.hpp:341
void VecCross(vector_t &vOut, const vector_t &v1, const vector_t &v2)
calculates the cross product of two Vectors of dimension 3. It makes no sense to use VecCross for vec...
Definition: math_vector_functions_common_impl.hpp:437
the ug namespace