25 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 35 template <
unsigned int Dim, FEFamily T_radial, InfMapType T_base>
39 const std::vector<Point> *
const pts,
40 const std::vector<Real> *
const weights)
42 if (weights !=
nullptr)
43 libmesh_not_implemented_msg(
"ERROR: User-specified weights for infinite elements are not implemented!");
46 libmesh_not_implemented_msg(
"ERROR: User-specified points for infinite elements are not implemented!");
49 libmesh_assert_not_equal_to (Dim, 1);
51 libmesh_assert(inf_elem);
52 libmesh_assert(qrule);
55 libmesh_assert_not_equal_to (s, 0);
61 elem_type = inf_elem->
type();
64 bool radial_qrule_initialized =
false;
66 if (current_fe_type.radial_order != fe_type.radial_order)
68 current_fe_type.radial_order = fe_type.radial_order;
70 radial_qrule_initialized =
true;
74 if (this->get_type() != inf_elem->
type() ||
75 base_fe->shapes_need_reinit() ||
76 radial_qrule_initialized)
77 this->init_face_shape_functions (qrule->get_points(),
side.get());
81 this->_fe_map->compute_face_map(this->dim, _total_qrule_weights,
side.get());
84 const std::vector<Real> JxW_int(this->_fe_map->get_JxW());
88 std::vector<Point> qp; this->inverse_map (inf_elem, this->_fe_map->get_xyz(),
93 this->reinit (inf_elem, &qp);
96 this->_fe_map->get_JxW() = JxW_int;
103 template <
unsigned int Dim, FEFamily T_radial, InfMapType T_base>
107 const std::vector<Point> *
const pts,
108 const std::vector<Real> *
const )
112 libmesh_not_implemented_msg(
"ERROR: Edge conditions for infinite elements not implemented!");
115 libmesh_not_implemented_msg(
"ERROR: User-specified points for infinite elements not implemented!");
121 template <
unsigned int Dim, FEFamily T_radial, InfMapType T_base>
123 const Elem * inf_side)
125 libmesh_assert(inf_side);
128 libmesh_assert_equal_to (Dim, 3);
131 this->init_radial_shape_functions(inf_side);
134 this->update_base_elem(inf_side);
137 base_qrule->init(base_elem->type(), inf_side->
p_level());
142 libmesh_assert_equal_to (Dim, 3);
144 base_fe->attach_quadrature_rule(base_qrule.get());
148 base_fe->init_base_shape_functions(base_fe->qrule->get_points(),
152 const unsigned int n_radial_qp =
153 cast_int<unsigned int>(som.size());
154 const unsigned int n_base_qp = base_qrule->n_points();
155 const unsigned int n_total_qp = n_radial_qp * n_base_qp;
158 _total_qrule_weights.resize(n_total_qp);
164 const Order base_mapping_order ( base_elem->default_order() );
165 const ElemType base_mapping_elem_type ( base_elem->type() );
169 const unsigned int n_radial_mapping_sf =
170 cast_int<unsigned int>(radial_map.size());
171 const unsigned int n_base_mapping_shape_functions = Base::n_base_mapping_sf(base_mapping_elem_type,
174 const unsigned int n_total_mapping_shape_functions =
175 n_radial_mapping_sf * n_base_mapping_shape_functions;
180 _radial_node_index.resize (n_total_mapping_shape_functions);
181 _base_node_index.resize (n_total_mapping_shape_functions);
186 for (
unsigned int n=0; n<n_total_mapping_shape_functions; n++)
188 compute_node_indices (inf_face_elem_type,
191 _radial_node_index[n]);
193 libmesh_assert_less (_base_node_index[n], n_base_mapping_shape_functions);
194 libmesh_assert_less (_radial_node_index[n], n_radial_mapping_sf);
201 std::vector<std::vector<Real>> & psi_map = this->_fe_map->get_psi();
202 std::vector<std::vector<Real>> & dpsidxi_map = this->_fe_map->get_dpsidxi();
203 std::vector<std::vector<Real>> & d2psidxi2_map = this->_fe_map->get_d2psidxi2();
204 psi_map.resize (n_total_mapping_shape_functions);
205 dpsidxi_map.resize (n_total_mapping_shape_functions);
206 d2psidxi2_map.resize (n_total_mapping_shape_functions);
210 std::vector<std::vector<Real>> & dpsideta_map = this->_fe_map->get_dpsideta();
211 std::vector<std::vector<Real>> & d2psidxideta_map = this->_fe_map->get_d2psidxideta();
212 std::vector<std::vector<Real>> & d2psideta2_map = this->_fe_map->get_d2psideta2();
213 dpsideta_map.resize (n_total_mapping_shape_functions);
214 d2psidxideta_map.resize (n_total_mapping_shape_functions);
215 d2psideta2_map.resize (n_total_mapping_shape_functions);
218 for (
unsigned int i=0; i<n_total_mapping_shape_functions; i++)
220 psi_map[i].resize (n_total_qp);
221 dpsidxi_map[i].resize (n_total_qp);
222 d2psidxi2_map[i].resize (n_total_qp);
226 std::vector<std::vector<Real>> & dpsideta_map = this->_fe_map->get_dpsideta();
227 std::vector<std::vector<Real>> & d2psidxideta_map = this->_fe_map->get_d2psidxideta();
228 std::vector<std::vector<Real>> & d2psideta2_map = this->_fe_map->get_d2psideta2();
229 dpsideta_map[i].resize (n_total_qp);
230 d2psidxideta_map[i].resize (n_total_qp);
231 d2psideta2_map[i].resize (n_total_qp);
239 const std::vector<std::vector<Real>> & S_map = (base_fe->get_fe_map()).get_phi_map();
240 const std::vector<std::vector<Real>> & Ss_map = (base_fe->get_fe_map()).get_dphidxi_map();
242 std::vector<std::vector<Real>> & psi_map = this->_fe_map->get_psi();
243 std::vector<std::vector<Real>> & dpsidxi_map = this->_fe_map->get_dpsidxi();
244 std::vector<std::vector<Real>> & dpsideta_map = this->_fe_map->get_dpsideta();
246 for (
unsigned int rp=0; rp<n_radial_qp; rp++)
247 for (
unsigned int bp=0; bp<n_base_qp; bp++)
248 for (
unsigned int ti=0; ti<n_total_mapping_shape_functions; ti++)
251 const unsigned int bi = _base_node_index [ti];
252 const unsigned int ri = _radial_node_index[ti];
253 psi_map [ti][bp+rp*n_base_qp] = S_map [bi][bp] * radial_map [ri][rp];
254 dpsidxi_map [ti][bp+rp*n_base_qp] = Ss_map[bi][bp] * radial_map [ri][rp];
255 dpsideta_map [ti][bp+rp*n_base_qp] = S_map [bi][bp] * dradialdv_map[ri][rp];
269 const std::vector<Real> & radial_qw = radial_qrule->get_weights();
270 const std::vector<Real> & base_qw = base_qrule->get_weights();
272 libmesh_assert_equal_to (radial_qw.size(), n_radial_qp);
273 libmesh_assert_equal_to (base_qw.size(), n_base_qp);
275 for (
unsigned int rp=0; rp<n_radial_qp; rp++)
276 for (
unsigned int bp=0; bp<n_base_qp; bp++)
278 _total_qrule_weights[bp + rp*n_base_qp] = radial_qw[rp] * base_qw[bp];
304 #endif //ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS void init_face_shape_functions(const std::vector< Point > &qp, const Elem *side)
The base class for all geometric element types.
INSTANTIATE_INF_FE_MBRF(1, CARTESIAN, Elem *, Base::build_elem(const Elem *))
unsigned int p_level() const
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i, bool proxy=true)=0
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void edge_reinit(const Elem *elem, const unsigned int edge, const Real tolerance=TOLERANCE, const std::vector< Point > *const pts=nullptr, const std::vector< Real > *const weights=nullptr) override
virtual void reinit(const Elem *elem, const std::vector< Point > *const pts=nullptr, const std::vector< Real > *const weights=nullptr) override
virtual ElemType type() const =0