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.");
97 phi[i][p](0) = dxidx_map[p]*phi_ref.slice(0) + detadx_map[p]*phi_ref.slice(1);
99 phi[i][p](1) = dxidy_map[p]*phi_ref.slice(0) + detady_map[p]*phi_ref.slice(1);
101 phi[i][p](2) = dxidz_map[p]*phi_ref.slice(0) + detadz_map[p]*phi_ref.slice(1);
143 phi[i][p].slice(0) = dxidx_map[p]*phi_ref.slice(0) + detadx_map[p]*phi_ref.slice(1)
144 + dzetadx_map[p]*phi_ref.slice(2);
146 phi[i][p].slice(1) = dxidy_map[p]*phi_ref.slice(0) + detady_map[p]*phi_ref.slice(1)
147 + dzetady_map[p]*phi_ref.slice(2);
149 phi[i][p].slice(2) = dxidz_map[p]*phi_ref.slice(0) + detadz_map[p]*phi_ref.slice(1)
150 + dzetadz_map[p]*phi_ref.slice(2);
156 libmesh_error_msg(
"Invalid dim = " <<
dim);
160 template<
typename OutputShape>
163 const std::vector<Point> &,
165 std::vector<std::vector<OutputShape>> & curl_phi)
const 171 libmesh_error_msg(
"These element transformations only make sense in 2D and 3D.");
183 const std::vector<std::vector<OutputShape>> & dphi_dxi = fe.
get_dphidxi();
184 const std::vector<std::vector<OutputShape>> & dphi_deta = fe.
get_dphideta();
192 const Real curl_ref = dphi_dxi[i][p].slice(1) - dphi_deta[i][p].slice(0);
193 curl_phi[i][p].slice(0) = curl_ref * (dxidy_map[p]*detadz_map[p] - dxidz_map[p]*detady_map[p]);
194 curl_phi[i][p].slice(1) = curl_ref * -(dxidx_map[p]*detadz_map[p] - dxidz_map[p]*detadx_map[p]);
195 curl_phi[i][p].slice(2) = curl_ref * (dxidx_map[p]*detady_map[p] - dxidy_map[p]*detadx_map[p]);
203 const std::vector<std::vector<OutputShape>> & dphi_dxi = fe.
get_dphidxi();
204 const std::vector<std::vector<OutputShape>> & dphi_deta = fe.
get_dphideta();
205 const std::vector<std::vector<OutputShape>> & dphi_dzeta = fe.
get_dphidzeta();
216 Real dx_dxi = dxyz_dxi[p](0);
217 Real dx_deta = dxyz_deta[p](0);
218 Real dx_dzeta = dxyz_dzeta[p](0);
220 Real dy_dxi = dxyz_dxi[p](1);
221 Real dy_deta = dxyz_deta[p](1);
222 Real dy_dzeta = dxyz_dzeta[p](1);
224 Real dz_dxi = dxyz_dxi[p](2);
225 Real dz_deta = dxyz_deta[p](2);
226 Real dz_dzeta = dxyz_dzeta[p](2);
228 const Real inv_jac = 1.0/J[p];
240 curl_phi[i][p].slice(0) = inv_jac*( dx_dxi*( dphi_deta[i][p].slice(2) -
241 dphi_dzeta[i][p].slice(1) ) +
242 dx_deta*( dphi_dzeta[i][p].slice(0) -
243 dphi_dxi[i][p].slice(2) ) +
244 dx_dzeta*( dphi_dxi[i][p].slice(1) -
245 dphi_deta[i][p].slice(0) ) );
247 curl_phi[i][p].slice(1) = inv_jac*( dy_dxi*( dphi_deta[i][p].slice(2) -
248 dphi_dzeta[i][p].slice(1) ) +
249 dy_deta*( dphi_dzeta[i][p].slice(0)-
250 dphi_dxi[i][p].slice(2) ) +
251 dy_dzeta*( dphi_dxi[i][p].slice(1) -
252 dphi_deta[i][p].slice(0) ) );
254 curl_phi[i][p].slice(2) = inv_jac*( dz_dxi*( dphi_deta[i][p].slice(2) -
255 dphi_dzeta[i][p].slice(1) ) +
256 dz_deta*( dphi_dzeta[i][p].slice(0) -
257 dphi_dxi[i][p].slice(2) ) +
258 dz_dzeta*( dphi_dxi[i][p].slice(1) -
259 dphi_deta[i][p].slice(0) ) );
266 libmesh_error_msg(
"Invalid dim = " <<
dim);
275 libmesh_error_msg(
"HCurl transformations only make sense for vector-valued elements.");
281 libmesh_error_msg(
"HCurl transformations only make sense for vector-valued elements.");
287 libmesh_error_msg(
"HCurl transformations only make sense for vector-valued elements.");
293 const std::vector<Point> &,
295 std::vector<std::vector<Real>> &,
298 libmesh_error_msg(
"HCurl transformations only make sense for vector-valued elements.");
304 const std::vector<Point> &,
306 std::vector<std::vector<Real>> &)
const 308 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