18 #include "libmesh/hcurl_fe_transformation.h" 19 #include "libmesh/fe_interface.h" 20 #include "libmesh/int_range.h" 25 template<
typename OutputShape>
33 template<
typename OutputShape>
41 template<
typename OutputShape>
45 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 52 template<
typename OutputShape>
54 const Elem *
const elem,
55 const std::vector<Point> & qp,
57 std::vector<std::vector<OutputShape>> & phi,
64 libmesh_error_msg(
"These element transformations only make sense in 2D and 3D.");
95 phi[i][p](0) = dxidx_map[p]*phi_ref.slice(0) + detadx_map[p]*phi_ref.slice(1);
97 phi[i][p](1) = dxidy_map[p]*phi_ref.slice(0) + detady_map[p]*phi_ref.slice(1);
139 phi[i][p].slice(0) = dxidx_map[p]*phi_ref.slice(0) + detadx_map[p]*phi_ref.slice(1)
140 + dzetadx_map[p]*phi_ref.slice(2);
142 phi[i][p].slice(1) = dxidy_map[p]*phi_ref.slice(0) + detady_map[p]*phi_ref.slice(1)
143 + dzetady_map[p]*phi_ref.slice(2);
145 phi[i][p].slice(2) = dxidz_map[p]*phi_ref.slice(0) + detadz_map[p]*phi_ref.slice(1)
146 + dzetadz_map[p]*phi_ref.slice(2);
152 libmesh_error_msg(
"Invalid dim = " <<
dim);
156 template<
typename OutputShape>
159 const std::vector<Point> &,
161 std::vector<std::vector<OutputShape>> & curl_phi)
const 167 libmesh_error_msg(
"These element transformations only make sense in 2D and 3D.");
171 const std::vector<std::vector<OutputShape>> & dphi_dxi = fe.
get_dphidxi();
172 const std::vector<std::vector<OutputShape>> & dphi_deta = fe.
get_dphideta();
181 curl_phi[i][p].slice(0) = curl_phi[i][p].slice(1) = 0.0;
182 curl_phi[i][p].slice(2) = ( dphi_dxi[i][p].slice(1) - dphi_deta[i][p].slice(0) )/J[p];
190 const std::vector<std::vector<OutputShape>> & dphi_dxi = fe.
get_dphidxi();
191 const std::vector<std::vector<OutputShape>> & dphi_deta = fe.
get_dphideta();
192 const std::vector<std::vector<OutputShape>> & dphi_dzeta = fe.
get_dphidzeta();
203 Real dx_dxi = dxyz_dxi[p](0);
204 Real dx_deta = dxyz_deta[p](0);
205 Real dx_dzeta = dxyz_dzeta[p](0);
207 Real dy_dxi = dxyz_dxi[p](1);
208 Real dy_deta = dxyz_deta[p](1);
209 Real dy_dzeta = dxyz_dzeta[p](1);
211 Real dz_dxi = dxyz_dxi[p](2);
212 Real dz_deta = dxyz_deta[p](2);
213 Real dz_dzeta = dxyz_dzeta[p](2);
215 const Real inv_jac = 1.0/J[p];
227 curl_phi[i][p].slice(0) = inv_jac*( dx_dxi*( dphi_deta[i][p].slice(2) -
228 dphi_dzeta[i][p].slice(1) ) +
229 dx_deta*( dphi_dzeta[i][p].slice(0) -
230 dphi_dxi[i][p].slice(2) ) +
231 dx_dzeta*( dphi_dxi[i][p].slice(1) -
232 dphi_deta[i][p].slice(0) ) );
234 curl_phi[i][p].slice(1) = inv_jac*( dy_dxi*( dphi_deta[i][p].slice(2) -
235 dphi_dzeta[i][p].slice(1) ) +
236 dy_deta*( dphi_dzeta[i][p].slice(0)-
237 dphi_dxi[i][p].slice(2) ) +
238 dy_dzeta*( dphi_dxi[i][p].slice(1) -
239 dphi_deta[i][p].slice(0) ) );
241 curl_phi[i][p].slice(2) = inv_jac*( dz_dxi*( dphi_deta[i][p].slice(2) -
242 dphi_dzeta[i][p].slice(1) ) +
243 dz_deta*( dphi_dzeta[i][p].slice(0) -
244 dphi_dxi[i][p].slice(2) ) +
245 dz_dzeta*( dphi_dxi[i][p].slice(1) -
246 dphi_deta[i][p].slice(0) ) );
253 libmesh_error_msg(
"Invalid dim = " <<
dim);
262 libmesh_error_msg(
"HCurl transformations only make sense for vector-valued elements.");
268 libmesh_error_msg(
"HCurl transformations only make sense for vector-valued elements.");
274 libmesh_error_msg(
"HCurl transformations only make sense for vector-valued elements.");
280 const std::vector<Point> &,
282 std::vector<std::vector<Real>> &,
285 libmesh_error_msg(
"HCurl transformations only make sense for vector-valued elements.");
291 const std::vector<Point> &,
293 std::vector<std::vector<Real>> &)
const 295 libmesh_error_msg(
"HCurl transformations only make sense for vector-valued elements.");
const std::vector< Real > & get_detadz() const
This is the base class from which all geometric element types are derived.
const std::vector< RealGradient > & get_dxyzdzeta() const
The libMesh namespace provides an interface to certain functionality in the library.
const std::vector< std::vector< OutputShape > > & get_dphideta() const
const std::vector< Real > & get_dxidz() const
const std::vector< std::vector< OutputShape > > & get_dphidzeta() const
FEType get_fe_type() const
const std::vector< RealGradient > & get_dxyzdxi() const
static Real shape(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int i, const Point &p)
const std::vector< Real > & get_dzetadx() const
const std::vector< Real > & get_jacobian() const
const std::vector< Real > & get_dxidx() const
const std::vector< Real > & get_dzetady() const
const std::vector< Real > & get_dxidy() const
const std::vector< Real > & get_dzetadz() const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const std::vector< Real > & get_detady() const
const std::vector< RealGradient > & get_dxyzdeta() const
const std::vector< std::vector< OutputShape > > & get_dphidxi() const
const FEMap & get_fe_map() const
const std::vector< std::vector< Real > > & get_d2xidxyz2() const
Second derivatives of "xi" reference coordinate wrt physical coordinates.
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
This class forms the foundation from which generic finite elements may be derived.
const std::vector< Real > & get_detadx() const