22 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 39 template <
unsigned int Dim, FEFamily T_radial, InfMapType T_map>
41 const Point & reference_point)
43 libmesh_assert(inf_elem);
44 libmesh_assert_not_equal_to (Dim, 0);
46 std::unique_ptr<Elem> base_elem (Base::build_elem (inf_elem));
48 const Order radial_mapping_order (Radial::mapping_order());
49 const Real v (reference_point(Dim-1));
56 base_point = inf_elem->
point(0);
66 libmesh_error_msg(
"Unknown Dim = " << Dim);
74 const Point outer_point (base_point * 2. - inf_elem->
origin());
89 template <
unsigned int Dim, FEFamily T_radial, InfMapType T_map>
91 const Point & physical_point,
95 libmesh_assert(inf_elem);
96 libmesh_assert_greater_equal (tolerance, 0.);
99 LOG_SCOPE(
"inverse_map()",
"InfFE");
109 std::unique_ptr<Elem> base_elem (Base::build_elem (inf_elem));
130 libmesh_error_msg(
"ERROR: InfFE::inverse_map is not yet implemented in 2d");
135 const Point & p0 = base_elem->point(0);
136 const Point & p1 = base_elem->point(1);
137 const Point & p2 = base_elem->point(2);
140 const Point & fp = physical_point;
145 const Real c_factor = -(p1(0)*fp(1)*p0(2)-p1(0)*fp(2)*p0(1)
146 +fp(0)*p1(2)*p0(1)-p0(0)*fp(1)*p1(2)
147 +p0(0)*fp(2)*p1(1)+p2(0)*fp(2)*p0(1)
148 -p2(0)*fp(1)*p0(2)-fp(0)*p2(2)*p0(1)
149 +fp(0)*p0(2)*p2(1)+p0(0)*fp(1)*p2(2)
150 -p0(0)*fp(2)*p2(1)-fp(0)*p0(2)*p1(1)
151 +p0(2)*p2(0)*p1(1)-p0(1)*p2(0)*p1(2)
152 -fp(0)*p1(2)*p2(1)+p2(1)*p0(0)*p1(2)
153 -p2(0)*fp(2)*p1(1)-p1(0)*fp(1)*p2(2)
154 +p2(2)*p1(0)*p0(1)+p1(0)*fp(2)*p2(1)
155 -p0(2)*p1(0)*p2(1)-p2(2)*p0(0)*p1(1)
156 +fp(0)*p2(2)*p1(1)+p2(0)*fp(1)*p1(2))/
157 (fp(0)*p1(2)*p0(1)-p1(0)*fp(2)*p0(1)
158 +p1(0)*fp(1)*p0(2)-p1(0)*o(1)*p0(2)
159 +o(0)*p2(2)*p0(1)-p0(0)*fp(2)*p2(1)
160 +p1(0)*o(1)*p2(2)+fp(0)*p0(2)*p2(1)
161 -fp(0)*p1(2)*p2(1)-p0(0)*o(1)*p2(2)
162 +p0(0)*fp(1)*p2(2)-o(0)*p0(2)*p2(1)
163 +o(0)*p1(2)*p2(1)-p2(0)*fp(2)*p1(1)
164 +fp(0)*p2(2)*p1(1)-p2(0)*fp(1)*p0(2)
165 -o(2)*p0(0)*p1(1)-fp(0)*p0(2)*p1(1)
166 +p0(0)*o(1)*p1(2)+p0(0)*fp(2)*p1(1)
167 -p0(0)*fp(1)*p1(2)-o(0)*p1(2)*p0(1)
168 -p2(0)*o(1)*p1(2)-o(2)*p2(0)*p0(1)
169 -o(2)*p1(0)*p2(1)+o(2)*p0(0)*p2(1)
170 -fp(0)*p2(2)*p0(1)+o(2)*p2(0)*p1(1)
171 +p2(0)*o(1)*p0(2)+p2(0)*fp(1)*p1(2)
172 +p2(0)*fp(2)*p0(1)-p1(0)*fp(1)*p2(2)
173 +p1(0)*fp(2)*p2(1)-o(0)*p2(2)*p1(1)
174 +o(2)*p1(0)*p0(1)+o(0)*p0(2)*p1(1));
201 libmesh_error_msg(
"Invalid dim = " << Dim);
225 if (fp_o_dist < a_dist)
242 v = 1.-2.*a_dist/fp_o_dist;
244 libmesh_not_implemented();
257 const Point diff = physical_point - check;
259 if (diff.
norm() > tolerance)
260 libmesh_warning(
"WARNING: diff is " << diff.
norm());
268 template <
unsigned int Dim, FEFamily T_radial, InfMapType T_map>
270 const std::vector<Point> & physical_points,
271 std::vector<Point> & reference_points,
272 const Real tolerance,
277 const std::size_t n_points = physical_points.
size();
281 reference_points.resize(n_points);
285 for (
unsigned int p=0; p<n_points; p++)
286 reference_points[p] =
317 #endif //ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
Base class for all the infinite geometric element types.
virtual Point origin() const
void add_scaled(const TypeVector< T2 > &, const T)
The base class for all geometric element types.
INSTANTIATE_INF_FE_MBRF(1, CARTESIAN, Elem *, Base::build_elem(const Elem *))
static Point map(const Elem *elem, const Point &reference_point)
static Point inverse_map(const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static Point map(const Elem *inf_elem, const Point &reference_point)
A geometric point in (x,y,z) space.
const Point & point(const unsigned int i) const
static Point inverse_map(const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)