libMesh::FEMap Class Reference

Computes finite element mapping function values, gradients, etc. More...

#include <fe_map.h>

Inheritance diagram for libMesh::FEMap:

Public Member Functions

 FEMap ()
 
virtual ~FEMap ()
 
template<unsigned int Dim>
void init_reference_to_physical_map (const std::vector< Point > &qp, const Elem *elem)
 
void compute_single_point_map (const unsigned int dim, const std::vector< Real > &qw, const Elem *elem, unsigned int p, const std::vector< const Node * > &elem_nodes, bool compute_second_derivatives)
 
virtual void compute_affine_map (const unsigned int dim, const std::vector< Real > &qw, const Elem *elem)
 
virtual void compute_null_map (const unsigned int dim, const std::vector< Real > &qw)
 
virtual void compute_map (const unsigned int dim, const std::vector< Real > &qw, const Elem *elem, bool calculate_d2phi)
 
virtual void compute_face_map (int dim, const std::vector< Real > &qw, const Elem *side)
 
void compute_edge_map (int dim, const std::vector< Real > &qw, const Elem *side)
 
template<unsigned int Dim>
void init_face_shape_functions (const std::vector< Point > &qp, const Elem *side)
 
template<unsigned int Dim>
void init_edge_shape_functions (const std::vector< Point > &qp, const Elem *edge)
 
const std::vector< Point > & get_xyz () const
 
const std::vector< Real > & get_jacobian () const
 
const std::vector< Real > & get_JxW () const
 
const std::vector< RealGradient > & get_dxyzdxi () const
 
const std::vector< RealGradient > & get_dxyzdeta () const
 
const std::vector< RealGradient > & get_dxyzdzeta () const
 
const std::vector< RealGradient > & get_d2xyzdxi2 () const
 
const std::vector< RealGradient > & get_d2xyzdeta2 () const
 
const std::vector< RealGradient > & get_d2xyzdzeta2 () const
 
const std::vector< RealGradient > & get_d2xyzdxideta () const
 
const std::vector< RealGradient > & get_d2xyzdxidzeta () const
 
const std::vector< RealGradient > & get_d2xyzdetadzeta () const
 
const std::vector< Real > & get_dxidx () const
 
const std::vector< Real > & get_dxidy () const
 
const std::vector< Real > & get_dxidz () const
 
const std::vector< Real > & get_detadx () const
 
const std::vector< Real > & get_detady () const
 
const std::vector< Real > & get_detadz () const
 
const std::vector< Real > & get_dzetadx () const
 
const std::vector< Real > & get_dzetady () const
 
const std::vector< Real > & get_dzetadz () const
 
const std::vector< std::vector< Real > > & get_d2xidxyz2 () const
 
const std::vector< std::vector< Real > > & get_d2etadxyz2 () const
 
const std::vector< std::vector< Real > > & get_d2zetadxyz2 () const
 
const std::vector< std::vector< Real > > & get_psi () const
 
const std::vector< std::vector< Real > > & get_phi_map () const
 
const std::vector< std::vector< Real > > & get_dphidxi_map () const
 
const std::vector< std::vector< Real > > & get_dphideta_map () const
 
const std::vector< std::vector< Real > > & get_dphidzeta_map () const
 
const std::vector< std::vector< Point > > & get_tangents () const
 
const std::vector< Point > & get_normals () const
 
const std::vector< Real > & get_curvatures () const
 
void print_JxW (std::ostream &os) const
 
void print_xyz (std::ostream &os) const
 
std::vector< std::vector< Real > > & get_psi ()
 
std::vector< std::vector< Real > > & get_dpsidxi ()
 
std::vector< std::vector< Real > > & get_dpsideta ()
 
std::vector< std::vector< Real > > & get_d2psidxi2 ()
 
std::vector< std::vector< Real > > & get_d2psidxideta ()
 
std::vector< std::vector< Real > > & get_d2psideta2 ()
 
std::vector< std::vector< Real > > & get_phi_map ()
 
std::vector< std::vector< Real > > & get_dphidxi_map ()
 
std::vector< std::vector< Real > > & get_dphideta_map ()
 
std::vector< std::vector< Real > > & get_dphidzeta_map ()
 
std::vector< std::vector< Real > > & get_d2phidxi2_map ()
 
std::vector< std::vector< Real > > & get_d2phidxideta_map ()
 
std::vector< std::vector< Real > > & get_d2phidxidzeta_map ()
 
std::vector< std::vector< Real > > & get_d2phideta2_map ()
 
std::vector< std::vector< Real > > & get_d2phidetadzeta_map ()
 
std::vector< std::vector< Real > > & get_d2phidzeta2_map ()
 
std::vector< Real > & get_JxW ()
 

Static Public Member Functions

static std::unique_ptr< FEMapbuild (FEType fe_type)
 

Protected Member Functions

void determine_calculations ()
 
void resize_quadrature_map_vectors (const unsigned int dim, unsigned int n_qp)
 
Real dxdxi_map (const unsigned int p) const
 
Real dydxi_map (const unsigned int p) const
 
Real dzdxi_map (const unsigned int p) const
 
Real dxdeta_map (const unsigned int p) const
 
Real dydeta_map (const unsigned int p) const
 
Real dzdeta_map (const unsigned int p) const
 
Real dxdzeta_map (const unsigned int p) const
 
Real dydzeta_map (const unsigned int p) const
 
Real dzdzeta_map (const unsigned int p) const
 

Protected Attributes

std::vector< Pointxyz
 
std::vector< RealGradientdxyzdxi_map
 
std::vector< RealGradientdxyzdeta_map
 
std::vector< RealGradientdxyzdzeta_map
 
std::vector< RealGradientd2xyzdxi2_map
 
std::vector< RealGradientd2xyzdxideta_map
 
std::vector< RealGradientd2xyzdeta2_map
 
std::vector< RealGradientd2xyzdxidzeta_map
 
std::vector< RealGradientd2xyzdetadzeta_map
 
std::vector< RealGradientd2xyzdzeta2_map
 
std::vector< Realdxidx_map
 
std::vector< Realdxidy_map
 
std::vector< Realdxidz_map
 
std::vector< Realdetadx_map
 
std::vector< Realdetady_map
 
std::vector< Realdetadz_map
 
std::vector< Realdzetadx_map
 
std::vector< Realdzetady_map
 
std::vector< Realdzetadz_map
 
std::vector< std::vector< Real > > d2xidxyz2_map
 
std::vector< std::vector< Real > > d2etadxyz2_map
 
std::vector< std::vector< Real > > d2zetadxyz2_map
 
std::vector< std::vector< Real > > phi_map
 
std::vector< std::vector< Real > > dphidxi_map
 
std::vector< std::vector< Real > > dphideta_map
 
std::vector< std::vector< Real > > dphidzeta_map
 
std::vector< std::vector< Real > > d2phidxi2_map
 
std::vector< std::vector< Real > > d2phidxideta_map
 
std::vector< std::vector< Real > > d2phidxidzeta_map
 
std::vector< std::vector< Real > > d2phideta2_map
 
std::vector< std::vector< Real > > d2phidetadzeta_map
 
std::vector< std::vector< Real > > d2phidzeta2_map
 
std::vector< std::vector< Real > > psi_map
 
std::vector< std::vector< Real > > dpsidxi_map
 
std::vector< std::vector< Real > > dpsideta_map
 
std::vector< std::vector< Real > > d2psidxi2_map
 
std::vector< std::vector< Real > > d2psidxideta_map
 
std::vector< std::vector< Real > > d2psideta2_map
 
std::vector< std::vector< Point > > tangents
 
std::vector< Pointnormals
 
std::vector< Realcurvatures
 
std::vector< Realjac
 
std::vector< RealJxW
 
bool calculations_started
 
bool calculate_xyz
 
bool calculate_dxyz
 
bool calculate_d2xyz
 

Private Member Functions

void compute_inverse_map_second_derivs (unsigned p)
 

Private Attributes

std::vector< const Node * > elem_nodes
 

Friends

template<unsigned int Dim, FEFamily T>
class FE
 

Detailed Description

Computes finite element mapping function values, gradients, etc.

Class contained in FE that encapsulates mapping (i.e. from physical space to reference space and vice-versa) quantities and operations.

Author
Paul Bauman
Date
2012

Definition at line 49 of file fe_map.h.

Constructor & Destructor Documentation

libMesh::FEMap::FEMap ( )

Definition at line 42 of file fe_map.C.

42  :
43  calculations_started(false),
44  calculate_xyz(false),
45  calculate_dxyz(false),
46  calculate_d2xyz(false)
47 {}
bool calculate_dxyz
Definition: fe_map.h:888
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculations_started
Definition: fe_map.h:878
bool calculate_xyz
Definition: fe_map.h:883

Member Function Documentation

std::unique_ptr< FEMap > libMesh::FEMap::build ( FEType  fe_type)
static

Definition at line 51 of file fe_map.C.

References libMesh::FEType::family, and libMesh::XYZ.

Referenced by ~FEMap().

52 {
53  switch( fe_type.family )
54  {
55  case XYZ:
56  return libmesh_make_unique<FEXYZMap>();
57 
58  default:
59  return libmesh_make_unique<FEMap>();
60  }
61 }
void libMesh::FEMap::compute_affine_map ( const unsigned int  dim,
const std::vector< Real > &  qw,
const Elem elem 
)
virtual

Compute the jacobian and some other additional data fields. Takes the integration weights as input, along with a pointer to the element. The element is assumed to have a constant Jacobian

Definition at line 1221 of file fe_map.C.

References calculate_d2xyz, calculate_dxyz, calculate_xyz, compute_single_point_map(), d2xyzdeta2_map, d2xyzdetadzeta_map, d2xyzdxi2_map, d2xyzdxideta_map, d2xyzdxidzeta_map, d2xyzdzeta2_map, detadx_map, detady_map, detadz_map, dxidx_map, dxidy_map, dxidz_map, dxyzdeta_map, dxyzdxi_map, dxyzdzeta_map, dzetadx_map, dzetady_map, dzetadz_map, elem_nodes, jac, JxW, n_nodes, libMesh::Elem::n_nodes(), libMesh::Elem::node_ptr(), phi_map, resize_quadrature_map_vectors(), and xyz.

Referenced by compute_map(), and ~FEMap().

1224 {
1225  // Start logging the map computation.
1226  LOG_SCOPE("compute_affine_map()", "FEMap");
1227 
1228  libmesh_assert(elem);
1229 
1230  const unsigned int n_qp = cast_int<unsigned int>(qw.size());
1231 
1232  // Resize the vectors to hold data at the quadrature points
1233  this->resize_quadrature_map_vectors(dim, n_qp);
1234 
1235  // Determine the nodes contributing to element elem
1236  unsigned int n_nodes = elem->n_nodes();
1237  elem_nodes.resize(elem->n_nodes());
1238  for (unsigned int i=0; i<n_nodes; i++)
1239  elem_nodes[i] = elem->node_ptr(i);
1240 
1241  // Compute map at quadrature point 0
1242  this->compute_single_point_map(dim, qw, elem, 0, elem_nodes, /*compute_second_derivatives=*/false);
1243 
1244  // Compute xyz at all other quadrature points
1245  if (calculate_xyz)
1246  for (unsigned int p=1; p<n_qp; p++)
1247  {
1248  xyz[p].zero();
1249  for (std::size_t i=0; i<phi_map.size(); i++) // sum over the nodes
1250  xyz[p].add_scaled (*elem_nodes[i], phi_map[i][p] );
1251  }
1252 
1253  // Copy other map data from quadrature point 0
1254  if (calculate_dxyz)
1255  for (unsigned int p=1; p<n_qp; p++) // for each extra quadrature point
1256  {
1257  dxyzdxi_map[p] = dxyzdxi_map[0];
1258  dxidx_map[p] = dxidx_map[0];
1259  dxidy_map[p] = dxidy_map[0];
1260  dxidz_map[p] = dxidz_map[0];
1261 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
1262  // The map should be affine, so second derivatives are zero
1263  if (calculate_d2xyz)
1264  d2xyzdxi2_map[p] = 0.;
1265 #endif
1266  if (dim > 1)
1267  {
1268  dxyzdeta_map[p] = dxyzdeta_map[0];
1269  detadx_map[p] = detadx_map[0];
1270  detady_map[p] = detady_map[0];
1271  detadz_map[p] = detadz_map[0];
1272 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
1273  if (calculate_d2xyz)
1274  {
1275  d2xyzdxideta_map[p] = 0.;
1276  d2xyzdeta2_map[p] = 0.;
1277  }
1278 #endif
1279  if (dim > 2)
1280  {
1281  dxyzdzeta_map[p] = dxyzdzeta_map[0];
1282  dzetadx_map[p] = dzetadx_map[0];
1283  dzetady_map[p] = dzetady_map[0];
1284  dzetadz_map[p] = dzetadz_map[0];
1285 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
1286  if (calculate_d2xyz)
1287  {
1288  d2xyzdxidzeta_map[p] = 0.;
1289  d2xyzdetadzeta_map[p] = 0.;
1290  d2xyzdzeta2_map[p] = 0.;
1291  }
1292 #endif
1293  }
1294  }
1295  jac[p] = jac[0];
1296  JxW[p] = JxW[0] / qw[0] * qw[p];
1297  }
1298 }
bool calculate_dxyz
Definition: fe_map.h:888
std::vector< RealGradient > d2xyzdzeta2_map
Definition: fe_map.h:675
std::vector< Real > dzetady_map
Definition: fe_map.h:727
std::vector< Real > dxidz_map
Definition: fe_map.h:695
std::vector< std::vector< Real > > phi_map
Definition: fe_map.h:758
std::vector< RealGradient > d2xyzdxideta_map
Definition: fe_map.h:649
std::vector< RealGradient > dxyzdzeta_map
Definition: fe_map.h:637
std::vector< Real > dzetadx_map
Definition: fe_map.h:721
std::vector< RealGradient > dxyzdxi_map
Definition: fe_map.h:625
const dof_id_type n_nodes
Definition: tecplot_io.C:67
std::vector< RealGradient > d2xyzdeta2_map
Definition: fe_map.h:655
std::vector< RealGradient > d2xyzdxi2_map
Definition: fe_map.h:643
std::vector< Real > dzetadz_map
Definition: fe_map.h:733
bool calculate_d2xyz
Definition: fe_map.h:893
std::vector< RealGradient > d2xyzdetadzeta_map
Definition: fe_map.h:669
std::vector< Real > dxidx_map
Definition: fe_map.h:683
bool calculate_xyz
Definition: fe_map.h:883
std::vector< Real > dxidy_map
Definition: fe_map.h:689
std::vector< Real > JxW
Definition: fe_map.h:872
std::vector< Point > xyz
Definition: fe_map.h:619
std::vector< const Node * > elem_nodes
Definition: fe_map.h:912
std::vector< Real > detady_map
Definition: fe_map.h:708
std::vector< RealGradient > dxyzdeta_map
Definition: fe_map.h:631
void resize_quadrature_map_vectors(const unsigned int dim, unsigned int n_qp)
Definition: fe_map.C:1140
std::vector< Real > jac
Definition: fe_map.h:867
std::vector< Real > detadz_map
Definition: fe_map.h:714
void compute_single_point_map(const unsigned int dim, const std::vector< Real > &qw, const Elem *elem, unsigned int p, const std::vector< const Node * > &elem_nodes, bool compute_second_derivatives)
Definition: fe_map.C:401
std::vector< Real > detadx_map
Definition: fe_map.h:702
std::vector< RealGradient > d2xyzdxidzeta_map
Definition: fe_map.h:663
void libMesh::FEMap::compute_edge_map ( int  dim,
const std::vector< Real > &  qw,
const Elem side 
)

Same as before, but for an edge. Useful for some projections.

Definition at line 921 of file fe_boundary.C.

References calculate_d2xyz, calculate_dxyz, calculate_xyz, compute_face_map(), curvatures, d2psidxi2_map, d2xyzdeta2_map, d2xyzdxi2_map, d2xyzdxideta_map, determine_calculations(), dpsidxi_map, dxdxi_map(), dxyzdeta_map, dxyzdxi_map, dydxi_map(), dzdxi_map(), libMesh::FE< Dim, T >::edge_reinit(), init_edge_shape_functions(), init_face_shape_functions(), JxW, normals, libMesh::Elem::point(), psi_map, libMesh::Real, libMesh::FE< Dim, T >::reinit(), libMesh::FE< Dim, T >::side_map(), tangents, and xyz.

Referenced by ~FEMap().

924 {
925  libmesh_assert(edge);
926 
927  if (dim == 2)
928  {
929  // A 2D finite element living in either 2D or 3D space.
930  // The edges here are the sides of the element, so the
931  // (misnamed) compute_face_map function does what we want
932  this->compute_face_map(dim, qw, edge);
933  return;
934  }
935 
936  libmesh_assert_equal_to (dim, 3); // 1D is unnecessary and currently unsupported
937 
938  LOG_SCOPE("compute_edge_map()", "FEMap");
939 
940  // We're calculating now!
941  this->determine_calculations();
942 
943  // The number of quadrature points.
944  const unsigned int n_qp = cast_int<unsigned int>(qw.size());
945 
946  // Resize the vectors to hold data at the quadrature points
947  if (calculate_xyz)
948  this->xyz.resize(n_qp);
949  if (calculate_dxyz)
950  {
951  this->dxyzdxi_map.resize(n_qp);
952  this->dxyzdeta_map.resize(n_qp);
953  this->tangents.resize(n_qp);
954  this->normals.resize(n_qp);
955  this->JxW.resize(n_qp);
956  }
957  if (calculate_d2xyz)
958  {
959  this->d2xyzdxi2_map.resize(n_qp);
960  this->d2xyzdxideta_map.resize(n_qp);
961  this->d2xyzdeta2_map.resize(n_qp);
962  this->curvatures.resize(n_qp);
963  }
964 
965  // Clear the entities that will be summed
966  for (unsigned int p=0; p<n_qp; p++)
967  {
968  if (calculate_xyz)
969  this->xyz[p].zero();
970  if (calculate_dxyz)
971  {
972  this->tangents[p].resize(1);
973  this->dxyzdxi_map[p].zero();
974  this->dxyzdeta_map[p].zero();
975  }
976  if (calculate_d2xyz)
977  {
978  this->d2xyzdxi2_map[p].zero();
979  this->d2xyzdxideta_map[p].zero();
980  this->d2xyzdeta2_map[p].zero();
981  }
982  }
983 
984  // compute x, dxdxi at the quadrature points
985  for (std::size_t i=0; i<this->psi_map.size(); i++) // sum over the nodes
986  {
987  const Point & edge_point = edge->point(i);
988 
989  for (unsigned int p=0; p<n_qp; p++) // for each quadrature point...
990  {
991  if (calculate_xyz)
992  this->xyz[p].add_scaled (edge_point, this->psi_map[i][p]);
993  if (calculate_dxyz)
994  this->dxyzdxi_map[p].add_scaled (edge_point, this->dpsidxi_map[i][p]);
995  if (calculate_d2xyz)
996  this->d2xyzdxi2_map[p].add_scaled (edge_point, this->d2psidxi2_map[i][p]);
997  }
998  }
999 
1000  // Compute the tangents at the quadrature point
1001  // FIXME: normals (plural!) and curvatures are uncalculated
1002  if (calculate_dxyz)
1003  for (unsigned int p=0; p<n_qp; p++)
1004  {
1005  const Point n = this->dxyzdxi_map[p].cross(this->dxyzdeta_map[p]);
1006  this->tangents[p][0] = this->dxyzdxi_map[p].unit();
1007 
1008  // compute the jacobian at the quadrature points
1009  const Real the_jac = std::sqrt(this->dxdxi_map(p)*this->dxdxi_map(p) +
1010  this->dydxi_map(p)*this->dydxi_map(p) +
1011  this->dzdxi_map(p)*this->dzdxi_map(p));
1012 
1013  libmesh_assert_greater (the_jac, 0.);
1014 
1015  this->JxW[p] = the_jac*qw[p];
1016  }
1017 }
std::vector< std::vector< Real > > psi_map
Definition: fe_map.h:812
bool calculate_dxyz
Definition: fe_map.h:888
Real dxdxi_map(const unsigned int p) const
Definition: fe_map.h:550
Real dydxi_map(const unsigned int p) const
Definition: fe_map.h:558
std::vector< RealGradient > d2xyzdxideta_map
Definition: fe_map.h:649
std::vector< RealGradient > dxyzdxi_map
Definition: fe_map.h:625
std::vector< RealGradient > d2xyzdeta2_map
Definition: fe_map.h:655
std::vector< RealGradient > d2xyzdxi2_map
Definition: fe_map.h:643
bool calculate_d2xyz
Definition: fe_map.h:893
Real dzdxi_map(const unsigned int p) const
Definition: fe_map.h:566
bool calculate_xyz
Definition: fe_map.h:883
std::vector< Real > curvatures
Definition: fe_map.h:862
std::vector< std::vector< Real > > d2psidxi2_map
Definition: fe_map.h:831
std::vector< Real > JxW
Definition: fe_map.h:872
std::vector< Point > normals
Definition: fe_map.h:855
std::vector< Point > xyz
Definition: fe_map.h:619
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< std::vector< Real > > dpsidxi_map
Definition: fe_map.h:818
std::vector< std::vector< Point > > tangents
Definition: fe_map.h:850
std::vector< RealGradient > dxyzdeta_map
Definition: fe_map.h:631
void determine_calculations()
Definition: fe_map.h:528
virtual void compute_face_map(int dim, const std::vector< Real > &qw, const Elem *side)
Definition: fe_boundary.C:573
void libMesh::FEMap::compute_face_map ( int  dim,
const std::vector< Real > &  qw,
const Elem side 
)
virtual

Same as compute_map, but for a side. Useful for boundary integration.

Reimplemented in libMesh::FEXYZMap.

Definition at line 573 of file fe_boundary.C.

References calculate_d2xyz, calculate_dxyz, calculate_xyz, libMesh::TypeVector< T >::cross(), curvatures, d2psideta2_map, d2psidxi2_map, d2psidxideta_map, d2xyzdeta2_map, d2xyzdxi2_map, d2xyzdxideta_map, libMesh::Elem::default_order(), determine_calculations(), dpsideta_map, dpsidxi_map, dxdeta_map(), dxdxi_map(), dxyzdeta_map, dxyzdxi_map, dydeta_map(), dydxi_map(), dzdeta_map(), dzdxi_map(), libMesh::FE< Dim, T >::inverse_map(), JxW, libMesh::FE< Dim, T >::map_eta(), libMesh::FE< Dim, T >::map_xi(), libMesh::FE< Dim, T >::n_shape_functions(), libMesh::Elem::node_id(), normals, libMesh::Elem::parent(), libMesh::Elem::point(), psi_map, libMesh::Real, tangents, libMesh::Elem::type(), libMesh::TypeVector< T >::unit(), and xyz.

Referenced by compute_edge_map(), and ~FEMap().

575 {
576  libmesh_assert(side);
577 
578  // We're calculating now!
579  this->determine_calculations();
580 
581  LOG_SCOPE("compute_face_map()", "FEMap");
582 
583  // The number of quadrature points.
584  const unsigned int n_qp = cast_int<unsigned int>(qw.size());
585 
586  switch (dim)
587  {
588  case 1:
589  {
590  // A 1D finite element, currently assumed to be in 1D space
591  // This means the boundary is a "0D finite element", a
592  // NODEELEM.
593 
594  // Resize the vectors to hold data at the quadrature points
595  {
596  if (calculate_xyz)
597  this->xyz.resize(n_qp);
598  if (calculate_dxyz)
599  normals.resize(n_qp);
600 
601  if (calculate_dxyz)
602  this->JxW.resize(n_qp);
603  }
604 
605  // If we have no quadrature points, there's nothing else to do
606  if (!n_qp)
607  break;
608 
609  // We need to look back at the full edge to figure out the normal
610  // vector
611  const Elem * elem = side->parent();
612  libmesh_assert (elem);
613  if (calculate_dxyz)
614  {
615  if (side->node_id(0) == elem->node_id(0))
616  normals[0] = Point(-1.);
617  else
618  {
619  libmesh_assert_equal_to (side->node_id(0),
620  elem->node_id(1));
621  normals[0] = Point(1.);
622  }
623  }
624 
625  // Calculate x at the point
626  if (calculate_xyz)
627  libmesh_assert_equal_to (this->psi_map.size(), 1);
628  // In the unlikely event we have multiple quadrature
629  // points, they'll be in the same place
630  for (unsigned int p=0; p<n_qp; p++)
631  {
632  if (calculate_xyz)
633  {
634  this->xyz[p].zero();
635  this->xyz[p].add_scaled (side->point(0), this->psi_map[0][p]);
636  }
637  if (calculate_dxyz)
638  {
639  normals[p] = normals[0];
640  this->JxW[p] = 1.0*qw[p];
641  }
642  }
643 
644  // done computing the map
645  break;
646  }
647 
648  case 2:
649  {
650  // A 2D finite element living in either 2D or 3D space.
651  // This means the boundary is a 1D finite element, i.e.
652  // and EDGE2 or EDGE3.
653  // Resize the vectors to hold data at the quadrature points
654  {
655  if (calculate_xyz)
656  this->xyz.resize(n_qp);
657  if (calculate_dxyz)
658  {
659  this->dxyzdxi_map.resize(n_qp);
660  this->tangents.resize(n_qp);
661  this->normals.resize(n_qp);
662 
663  this->JxW.resize(n_qp);
664  }
665 
666  if (calculate_d2xyz)
667  {
668  this->d2xyzdxi2_map.resize(n_qp);
669  this->curvatures.resize(n_qp);
670  }
671  }
672 
673  // Clear the entities that will be summed
674  // Compute the tangent & normal at the quadrature point
675  for (unsigned int p=0; p<n_qp; p++)
676  {
677  if (calculate_xyz)
678  this->xyz[p].zero();
679  if (calculate_dxyz)
680  {
681  this->tangents[p].resize(LIBMESH_DIM-1); // 1 Tangent in 2D, 2 in 3D
682  this->dxyzdxi_map[p].zero();
683  }
684  if (calculate_d2xyz)
685  this->d2xyzdxi2_map[p].zero();
686  }
687 
688  const unsigned int n_mapping_shape_functions =
690  side->default_order());
691 
692  // compute x, dxdxi at the quadrature points
693  for (unsigned int i=0; i<n_mapping_shape_functions; i++) // sum over the nodes
694  {
695  const Point & side_point = side->point(i);
696 
697  for (unsigned int p=0; p<n_qp; p++) // for each quadrature point...
698  {
699  if (calculate_xyz)
700  this->xyz[p].add_scaled (side_point, this->psi_map[i][p]);
701  if (calculate_dxyz)
702  this->dxyzdxi_map[p].add_scaled (side_point, this->dpsidxi_map[i][p]);
703  if (calculate_d2xyz)
704  this->d2xyzdxi2_map[p].add_scaled(side_point, this->d2psidxi2_map[i][p]);
705  }
706  }
707 
708  // Compute the tangent & normal at the quadrature point
709  if (calculate_dxyz)
710  {
711  for (unsigned int p=0; p<n_qp; p++)
712  {
713  // The first tangent comes from just the edge's Jacobian
714  this->tangents[p][0] = this->dxyzdxi_map[p].unit();
715 
716 #if LIBMESH_DIM == 2
717  // For a 2D element living in 2D, the normal is given directly
718  // from the entries in the edge Jacobian.
719  this->normals[p] = (Point(this->dxyzdxi_map[p](1), -this->dxyzdxi_map[p](0), 0.)).unit();
720 
721 #elif LIBMESH_DIM == 3
722  // For a 2D element living in 3D, there is a second tangent.
723  // For the second tangent, we need to refer to the full
724  // element's (not just the edge's) Jacobian.
725  const Elem * elem = side->parent();
726  libmesh_assert(elem);
727 
728  // Inverse map xyz[p] to a reference point on the parent...
729  Point reference_point = FE<2,LAGRANGE>::inverse_map(elem, this->xyz[p]);
730 
731  // Get dxyz/dxi and dxyz/deta from the parent map.
732  Point dx_dxi = FE<2,LAGRANGE>::map_xi (elem, reference_point);
733  Point dx_deta = FE<2,LAGRANGE>::map_eta(elem, reference_point);
734 
735  // The second tangent vector is formed by crossing these vectors.
736  tangents[p][1] = dx_dxi.cross(dx_deta).unit();
737 
738  // Finally, the normal in this case is given by crossing these
739  // two tangents.
740  normals[p] = tangents[p][0].cross(tangents[p][1]).unit();
741 #endif
742 
743 
744  // The curvature is computed via the familiar Frenet formula:
745  // curvature = [d^2(x) / d (xi)^2] dot [normal]
746  // For a reference, see:
747  // F.S. Merritt, Mathematics Manual, 1962, McGraw-Hill, p. 310
748  //
749  // Note: The sign convention here is different from the
750  // 3D case. Concave-upward curves (smiles) have a positive
751  // curvature. Concave-downward curves (frowns) have a
752  // negative curvature. Be sure to take that into account!
753  if (calculate_d2xyz)
754  {
755  const Real numerator = this->d2xyzdxi2_map[p] * this->normals[p];
756  const Real denominator = this->dxyzdxi_map[p].norm_sq();
757  libmesh_assert_not_equal_to (denominator, 0);
758  curvatures[p] = numerator / denominator;
759  }
760  }
761 
762  // compute the jacobian at the quadrature points
763  for (unsigned int p=0; p<n_qp; p++)
764  {
765  const Real the_jac = this->dxyzdxi_map[p].norm();
766 
767  libmesh_assert_greater (the_jac, 0.);
768 
769  this->JxW[p] = the_jac*qw[p];
770  }
771  }
772 
773  // done computing the map
774  break;
775  }
776 
777 
778 
779  case 3:
780  {
781  // A 3D finite element living in 3D space.
782  // Resize the vectors to hold data at the quadrature points
783  {
784  if (calculate_xyz)
785  this->xyz.resize(n_qp);
786  if (calculate_dxyz)
787  {
788  this->dxyzdxi_map.resize(n_qp);
789  this->dxyzdeta_map.resize(n_qp);
790  this->tangents.resize(n_qp);
791  this->normals.resize(n_qp);
792  this->JxW.resize(n_qp);
793  }
794  if (calculate_d2xyz)
795  {
796  this->d2xyzdxi2_map.resize(n_qp);
797  this->d2xyzdxideta_map.resize(n_qp);
798  this->d2xyzdeta2_map.resize(n_qp);
799  this->curvatures.resize(n_qp);
800  }
801  }
802 
803  // Clear the entities that will be summed
804  for (unsigned int p=0; p<n_qp; p++)
805  {
806  if (calculate_xyz)
807  this->xyz[p].zero();
808  if (calculate_dxyz)
809  {
810  this->tangents[p].resize(LIBMESH_DIM-1); // 1 Tangent in 2D, 2 in 3D
811  this->dxyzdxi_map[p].zero();
812  this->dxyzdeta_map[p].zero();
813  }
814  if (calculate_d2xyz)
815  {
816  this->d2xyzdxi2_map[p].zero();
817  this->d2xyzdxideta_map[p].zero();
818  this->d2xyzdeta2_map[p].zero();
819  }
820  }
821 
822  const unsigned int n_mapping_shape_functions =
824  side->default_order());
825 
826  // compute x, dxdxi at the quadrature points
827  for (unsigned int i=0; i<n_mapping_shape_functions; i++) // sum over the nodes
828  {
829  const Point & side_point = side->point(i);
830 
831  for (unsigned int p=0; p<n_qp; p++) // for each quadrature point...
832  {
833  if (calculate_xyz)
834  this->xyz[p].add_scaled (side_point, this->psi_map[i][p]);
835  if (calculate_dxyz)
836  {
837  this->dxyzdxi_map[p].add_scaled (side_point, this->dpsidxi_map[i][p]);
838  this->dxyzdeta_map[p].add_scaled(side_point, this->dpsideta_map[i][p]);
839  }
840  if (calculate_d2xyz)
841  {
842  this->d2xyzdxi2_map[p].add_scaled (side_point, this->d2psidxi2_map[i][p]);
843  this->d2xyzdxideta_map[p].add_scaled(side_point, this->d2psidxideta_map[i][p]);
844  this->d2xyzdeta2_map[p].add_scaled (side_point, this->d2psideta2_map[i][p]);
845  }
846  }
847  }
848 
849  // Compute the tangents, normal, and curvature at the quadrature point
850  if (calculate_dxyz)
851  {
852  for (unsigned int p=0; p<n_qp; p++)
853  {
854  const Point n = this->dxyzdxi_map[p].cross(this->dxyzdeta_map[p]);
855  this->normals[p] = n.unit();
856  this->tangents[p][0] = this->dxyzdxi_map[p].unit();
857  this->tangents[p][1] = n.cross(this->dxyzdxi_map[p]).unit();
858 
859  if (calculate_d2xyz)
860  {
861  // Compute curvature using the typical nomenclature
862  // of the first and second fundamental forms.
863  // For reference, see:
864  // 1) http://mathworld.wolfram.com/MeanCurvature.html
865  // (note -- they are using inward normal)
866  // 2) F.S. Merritt, Mathematics Manual, 1962, McGraw-Hill
867  const Real L = -this->d2xyzdxi2_map[p] * this->normals[p];
868  const Real M = -this->d2xyzdxideta_map[p] * this->normals[p];
869  const Real N = -this->d2xyzdeta2_map[p] * this->normals[p];
870  const Real E = this->dxyzdxi_map[p].norm_sq();
871  const Real F = this->dxyzdxi_map[p] * this->dxyzdeta_map[p];
872  const Real G = this->dxyzdeta_map[p].norm_sq();
873 
874  const Real numerator = E*N -2.*F*M + G*L;
875  const Real denominator = E*G - F*F;
876  libmesh_assert_not_equal_to (denominator, 0.);
877  curvatures[p] = 0.5*numerator/denominator;
878  }
879  }
880 
881  // compute the jacobian at the quadrature points, see
882  // http://sp81.msi.umn.edu:999/fluent/fidap/help/theory/thtoc.htm
883  for (unsigned int p=0; p<n_qp; p++)
884  {
885  const Real g11 = (dxdxi_map(p)*dxdxi_map(p) +
886  dydxi_map(p)*dydxi_map(p) +
887  dzdxi_map(p)*dzdxi_map(p));
888 
889  const Real g12 = (dxdxi_map(p)*dxdeta_map(p) +
890  dydxi_map(p)*dydeta_map(p) +
891  dzdxi_map(p)*dzdeta_map(p));
892 
893  const Real g21 = g12;
894 
895  const Real g22 = (dxdeta_map(p)*dxdeta_map(p) +
896  dydeta_map(p)*dydeta_map(p) +
897  dzdeta_map(p)*dzdeta_map(p));
898 
899 
900  const Real the_jac = std::sqrt(g11*g22 - g12*g21);
901 
902  libmesh_assert_greater (the_jac, 0.);
903 
904  this->JxW[p] = the_jac*qw[p];
905  }
906  }
907 
908  // done computing the map
909  break;
910  }
911 
912 
913  default:
914  libmesh_error_msg("Invalid dimension dim = " << dim);
915  }
916 }
std::vector< std::vector< Real > > dpsideta_map
Definition: fe_map.h:824
std::vector< std::vector< Real > > psi_map
Definition: fe_map.h:812
std::vector< std::vector< Real > > d2psideta2_map
Definition: fe_map.h:845
bool calculate_dxyz
Definition: fe_map.h:888
static Point map_xi(const Elem *elem, const Point &reference_point)
Definition: fe_map.C:2000
Real dxdxi_map(const unsigned int p) const
Definition: fe_map.h:550
unsigned short int side
Definition: xdr_io.C:49
Real dydxi_map(const unsigned int p) const
Definition: fe_map.h:558
std::vector< std::vector< Real > > d2psidxideta_map
Definition: fe_map.h:838
std::vector< RealGradient > d2xyzdxideta_map
Definition: fe_map.h:649
std::vector< RealGradient > dxyzdxi_map
Definition: fe_map.h:625
std::vector< RealGradient > d2xyzdeta2_map
Definition: fe_map.h:655
std::vector< RealGradient > d2xyzdxi2_map
Definition: fe_map.h:643
bool calculate_d2xyz
Definition: fe_map.h:893
Real dzdxi_map(const unsigned int p) const
Definition: fe_map.h:566
bool calculate_xyz
Definition: fe_map.h:883
Real dxdeta_map(const unsigned int p) const
Definition: fe_map.h:574
Real dydeta_map(const unsigned int p) const
Definition: fe_map.h:582
std::vector< Real > curvatures
Definition: fe_map.h:862
std::vector< std::vector< Real > > d2psidxi2_map
Definition: fe_map.h:831
std::vector< Real > JxW
Definition: fe_map.h:872
std::vector< Point > normals
Definition: fe_map.h:855
std::vector< Point > xyz
Definition: fe_map.h:619
static Point map_eta(const Elem *elem, const Point &reference_point)
Definition: fe_map.C:2028
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< std::vector< Real > > dpsidxi_map
Definition: fe_map.h:818
virtual unsigned int n_shape_functions() const libmesh_override
Definition: fe.C:36
std::vector< std::vector< Point > > tangents
Definition: fe_map.h:850
std::vector< RealGradient > dxyzdeta_map
Definition: fe_map.h:631
void determine_calculations()
Definition: fe_map.h:528
Real dzdeta_map(const unsigned int p) const
Definition: fe_map.h:590
static Point inverse_map(const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
Definition: fe_map.C:1564
void libMesh::FEMap::compute_inverse_map_second_derivs ( unsigned  p)
private

A helper function used by FEMap::compute_single_point_map() to compute second derivatives of the inverse map.

Definition at line 1444 of file fe_map.C.

References A, d2etadxyz2_map, d2xidxyz2_map, d2xyzdeta2_map, d2xyzdetadzeta_map, d2xyzdxi2_map, d2xyzdxideta_map, d2xyzdxidzeta_map, d2xyzdzeta2_map, d2zetadxyz2_map, detadx_map, detady_map, detadz_map, dxidx_map, dxidy_map, dxidz_map, dzetadx_map, dzetady_map, and dzetadz_map.

Referenced by compute_single_point_map().

1445 {
1446 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
1447  // Only certain second derivatives are valid depending on the
1448  // dimension...
1449  std::set<unsigned> valid_indices;
1450 
1451  // Construct J^{-1}, A, and B matrices (see JWP's notes for details)
1452  // for cases in which the element dimension matches LIBMESH_DIM.
1453 #if LIBMESH_DIM==1
1454  RealTensor
1455  Jinv(dxidx_map[p], 0., 0.,
1456  0., 0., 0.,
1457  0., 0., 0.),
1458 
1459  A(d2xyzdxi2_map[p](0), 0., 0.,
1460  0., 0., 0.,
1461  0., 0., 0.),
1462 
1463  B(0., 0., 0.,
1464  0., 0., 0.,
1465  0., 0., 0.);
1466 
1468  dxi (dxidx_map[p], 0., 0.),
1469  deta (0., 0., 0.),
1470  dzeta(0., 0., 0.);
1471 
1472  // In 1D, we have only the xx second derivative
1473  valid_indices.insert(0);
1474 
1475 #elif LIBMESH_DIM==2
1476  RealTensor
1477  Jinv(dxidx_map[p], dxidy_map[p], 0.,
1478  detadx_map[p], detady_map[p], 0.,
1479  0., 0., 0.),
1480 
1481  A(d2xyzdxi2_map[p](0), d2xyzdeta2_map[p](0), 0.,
1482  d2xyzdxi2_map[p](1), d2xyzdeta2_map[p](1), 0.,
1483  0., 0., 0.),
1484 
1485  B(d2xyzdxideta_map[p](0), 0., 0.,
1486  d2xyzdxideta_map[p](1), 0., 0.,
1487  0., 0., 0.);
1488 
1490  dxi (dxidx_map[p], dxidy_map[p], 0.),
1491  deta (detadx_map[p], detady_map[p], 0.),
1492  dzeta(0., 0., 0.);
1493 
1494  // In 2D, we have xx, xy, and yy second derivatives
1495  const unsigned tmp[3] = {0,1,3};
1496  valid_indices.insert(tmp, tmp+3);
1497 
1498 #elif LIBMESH_DIM==3
1499  RealTensor
1500  Jinv(dxidx_map[p], dxidy_map[p], dxidz_map[p],
1501  detadx_map[p], detady_map[p], detadz_map[p],
1502  dzetadx_map[p], dzetady_map[p], dzetadz_map[p]),
1503 
1504  A(d2xyzdxi2_map[p](0), d2xyzdeta2_map[p](0), d2xyzdzeta2_map[p](0),
1505  d2xyzdxi2_map[p](1), d2xyzdeta2_map[p](1), d2xyzdzeta2_map[p](1),
1506  d2xyzdxi2_map[p](2), d2xyzdeta2_map[p](2), d2xyzdzeta2_map[p](2)),
1507 
1511 
1513  dxi (dxidx_map[p], dxidy_map[p], dxidz_map[p]),
1514  deta (detadx_map[p], detady_map[p], detadz_map[p]),
1515  dzeta(dzetadx_map[p], dzetady_map[p], dzetadz_map[p]);
1516 
1517  // In 3D, we have xx, xy, xz, yy, yz, and zz second derivatives
1518  const unsigned tmp[6] = {0,1,2,3,4,5};
1519  valid_indices.insert(tmp, tmp+6);
1520 
1521 #endif
1522 
1523  // For (s,t) in {(x,x), (x,y), (x,z), (y,y), (y,z), (z,z)}, compute the
1524  // vector of inverse map second derivatives [xi_{s t}, eta_{s t}, zeta_{s t}]
1525  unsigned ctr=0;
1526  for (unsigned s=0; s<3; ++s)
1527  for (unsigned t=s; t<3; ++t)
1528  {
1529  if (valid_indices.count(ctr))
1530  {
1532  v1(dxi(s)*dxi(t),
1533  deta(s)*deta(t),
1534  dzeta(s)*dzeta(t)),
1535 
1536  v2(dxi(s)*deta(t) + deta(s)*dxi(t),
1537  dxi(s)*dzeta(t) + dzeta(s)*dxi(t),
1538  deta(s)*dzeta(t) + dzeta(s)*deta(t));
1539 
1540  // Compute the inverse map second derivatives
1541  RealVectorValue v3 = -Jinv*(A*v1 + B*v2);
1542 
1543  // Store them in the appropriate locations in the class data structures
1544  d2xidxyz2_map[p][ctr] = v3(0);
1545 
1546  if (LIBMESH_DIM > 1)
1547  d2etadxyz2_map[p][ctr] = v3(1);
1548 
1549  if (LIBMESH_DIM > 2)
1550  d2zetadxyz2_map[p][ctr] = v3(2);
1551  }
1552 
1553  // Increment the counter
1554  ctr++;
1555  }
1556 
1557 #endif // LIBMESH_ENABLE_SECOND_DERIVATIVES
1558 }
std::vector< std::vector< Real > > d2etadxyz2_map
Definition: fe_map.h:746
VectorValue< Real > RealVectorValue
std::vector< RealGradient > d2xyzdzeta2_map
Definition: fe_map.h:675
std::vector< Real > dzetady_map
Definition: fe_map.h:727
std::vector< std::vector< Real > > d2xidxyz2_map
Definition: fe_map.h:740
RealTensorValue RealTensor
std::vector< Real > dxidz_map
Definition: fe_map.h:695
std::vector< RealGradient > d2xyzdxideta_map
Definition: fe_map.h:649
std::vector< Real > dzetadx_map
Definition: fe_map.h:721
std::vector< RealGradient > d2xyzdeta2_map
Definition: fe_map.h:655
std::vector< RealGradient > d2xyzdxi2_map
Definition: fe_map.h:643
std::vector< Real > dzetadz_map
Definition: fe_map.h:733
std::vector< std::vector< Real > > d2zetadxyz2_map
Definition: fe_map.h:752
std::vector< RealGradient > d2xyzdetadzeta_map
Definition: fe_map.h:669
std::vector< Real > dxidx_map
Definition: fe_map.h:683
std::vector< Real > dxidy_map
Definition: fe_map.h:689
static PetscErrorCode Mat * A
std::vector< Real > detady_map
Definition: fe_map.h:708
std::vector< Real > detadz_map
Definition: fe_map.h:714
std::vector< Real > detadx_map
Definition: fe_map.h:702
std::vector< RealGradient > d2xyzdxidzeta_map
Definition: fe_map.h:663
void libMesh::FEMap::compute_map ( const unsigned int  dim,
const std::vector< Real > &  qw,
const Elem elem,
bool  calculate_d2phi 
)
virtual

Compute the jacobian and some other additional data fields. Takes the integration weights as input, along with a pointer to the element. Also takes a boolean parameter indicating whether second derivatives need to be calculated, allowing us to potentially skip unnecessary, expensive computations.

Definition at line 1377 of file fe_map.C.

References compute_affine_map(), compute_null_map(), compute_single_point_map(), elem_nodes, libMesh::MeshTools::Subdivision::find_one_ring(), libMesh::Elem::has_affine_map(), libmesh_nullptr, libMesh::Elem::n_nodes(), libMesh::Elem::node_ptr(), resize_quadrature_map_vectors(), libMesh::TRI3SUBDIVISION, and libMesh::Elem::type().

Referenced by ~FEMap().

1381 {
1382  if (!elem)
1383  {
1384  compute_null_map(dim, qw);
1385  return;
1386  }
1387 
1388  if (elem->has_affine_map())
1389  {
1390  compute_affine_map(dim, qw, elem);
1391  return;
1392  }
1393 
1394  // Start logging the map computation.
1395  LOG_SCOPE("compute_map()", "FEMap");
1396 
1397  libmesh_assert(elem);
1398 
1399  const unsigned int n_qp = cast_int<unsigned int>(qw.size());
1400 
1401  // Resize the vectors to hold data at the quadrature points
1402  this->resize_quadrature_map_vectors(dim, n_qp);
1403 
1404  // Determine the nodes contributing to element elem
1405  std::vector<const Node *> elem_nodes;
1406  if (elem->type() == TRI3SUBDIVISION)
1407  {
1408  // Subdivision surface FE require the 1-ring around elem
1409  libmesh_assert_equal_to (dim, 2);
1410  const Tri3Subdivision * sd_elem = static_cast<const Tri3Subdivision *>(elem);
1411  MeshTools::Subdivision::find_one_ring(sd_elem, elem_nodes);
1412  }
1413  else
1414  {
1415  // All other FE use only the nodes of elem itself
1416  elem_nodes.resize(elem->n_nodes(), libmesh_nullptr);
1417  for (unsigned int i=0; i<elem->n_nodes(); i++)
1418  elem_nodes[i] = elem->node_ptr(i);
1419  }
1420 
1421  // Compute map at all quadrature points
1422  for (unsigned int p=0; p!=n_qp; p++)
1423  this->compute_single_point_map(dim, qw, elem, p, elem_nodes, calculate_d2phi);
1424 }
virtual void compute_affine_map(const unsigned int dim, const std::vector< Real > &qw, const Elem *elem)
Definition: fe_map.C:1221
const class libmesh_nullptr_t libmesh_nullptr
void find_one_ring(const Tri3Subdivision *elem, std::vector< const Node * > &nodes)
std::vector< const Node * > elem_nodes
Definition: fe_map.h:912
virtual void compute_null_map(const unsigned int dim, const std::vector< Real > &qw)
Definition: fe_map.C:1302
void resize_quadrature_map_vectors(const unsigned int dim, unsigned int n_qp)
Definition: fe_map.C:1140
void compute_single_point_map(const unsigned int dim, const std::vector< Real > &qw, const Elem *elem, unsigned int p, const std::vector< const Node * > &elem_nodes, bool compute_second_derivatives)
Definition: fe_map.C:401
void libMesh::FEMap::compute_null_map ( const unsigned int  dim,
const std::vector< Real > &  qw 
)
virtual

Assign a fake jacobian and some other additional data fields. Takes the integration weights as input. For use on non-element evaluations.

Definition at line 1302 of file fe_map.C.

References calculate_d2xyz, calculate_dxyz, calculate_xyz, d2xyzdeta2_map, d2xyzdetadzeta_map, d2xyzdxi2_map, d2xyzdxideta_map, d2xyzdxidzeta_map, d2xyzdzeta2_map, detadx_map, detady_map, detadz_map, dxidx_map, dxidy_map, dxidz_map, dxyzdeta_map, dxyzdxi_map, dxyzdzeta_map, dzetadx_map, dzetady_map, dzetadz_map, jac, JxW, resize_quadrature_map_vectors(), and xyz.

Referenced by compute_map(), and ~FEMap().

1304 {
1305  // Start logging the map computation.
1306  LOG_SCOPE("compute_null_map()", "FEMap");
1307 
1308  const unsigned int n_qp = cast_int<unsigned int>(qw.size());
1309 
1310  // Resize the vectors to hold data at the quadrature points
1311  this->resize_quadrature_map_vectors(dim, n_qp);
1312 
1313  // Compute "fake" xyz
1314  for (unsigned int p=1; p<n_qp; p++)
1315  {
1316  if (calculate_xyz)
1317  xyz[p].zero();
1318 
1319  if (calculate_dxyz)
1320  {
1321  dxyzdxi_map[p] = 0;
1322  dxidx_map[p] = 0;
1323  dxidy_map[p] = 0;
1324  dxidz_map[p] = 0;
1325  }
1326 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
1327  if (calculate_d2xyz)
1328  {
1329  d2xyzdxi2_map[p] = 0;
1330  }
1331 #endif
1332  if (dim > 1)
1333  {
1334  if (calculate_dxyz)
1335  {
1336  dxyzdeta_map[p] = 0;
1337  detadx_map[p] = 0;
1338  detady_map[p] = 0;
1339  detadz_map[p] = 0;
1340  }
1341 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
1342  if (calculate_d2xyz)
1343  {
1344  d2xyzdxideta_map[p] = 0.;
1345  d2xyzdeta2_map[p] = 0.;
1346  }
1347 #endif
1348  if (dim > 2)
1349  {
1350  if (calculate_dxyz)
1351  {
1352  dxyzdzeta_map[p] = 0;
1353  dzetadx_map[p] = 0;
1354  dzetady_map[p] = 0;
1355  dzetadz_map[p] = 0;
1356  }
1357 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
1358  if (calculate_d2xyz)
1359  {
1360  d2xyzdxidzeta_map[p] = 0;
1361  d2xyzdetadzeta_map[p] = 0;
1362  d2xyzdzeta2_map[p] = 0;
1363  }
1364 #endif
1365  }
1366  }
1367  if (calculate_dxyz)
1368  {
1369  jac[p] = 1;
1370  JxW[p] = qw[p];
1371  }
1372  }
1373 }
bool calculate_dxyz
Definition: fe_map.h:888
std::vector< RealGradient > d2xyzdzeta2_map
Definition: fe_map.h:675
std::vector< Real > dzetady_map
Definition: fe_map.h:727
std::vector< Real > dxidz_map
Definition: fe_map.h:695
std::vector< RealGradient > d2xyzdxideta_map
Definition: fe_map.h:649
std::vector< RealGradient > dxyzdzeta_map
Definition: fe_map.h:637
std::vector< Real > dzetadx_map
Definition: fe_map.h:721
std::vector< RealGradient > dxyzdxi_map
Definition: fe_map.h:625
std::vector< RealGradient > d2xyzdeta2_map
Definition: fe_map.h:655
std::vector< RealGradient > d2xyzdxi2_map
Definition: fe_map.h:643
std::vector< Real > dzetadz_map
Definition: fe_map.h:733
bool calculate_d2xyz
Definition: fe_map.h:893
std::vector< RealGradient > d2xyzdetadzeta_map
Definition: fe_map.h:669
std::vector< Real > dxidx_map
Definition: fe_map.h:683
bool calculate_xyz
Definition: fe_map.h:883
std::vector< Real > dxidy_map
Definition: fe_map.h:689
std::vector< Real > JxW
Definition: fe_map.h:872
std::vector< Point > xyz
Definition: fe_map.h:619
std::vector< Real > detady_map
Definition: fe_map.h:708
std::vector< RealGradient > dxyzdeta_map
Definition: fe_map.h:631
void resize_quadrature_map_vectors(const unsigned int dim, unsigned int n_qp)
Definition: fe_map.C:1140
std::vector< Real > jac
Definition: fe_map.h:867
std::vector< Real > detadz_map
Definition: fe_map.h:714
std::vector< Real > detadx_map
Definition: fe_map.h:702
std::vector< RealGradient > d2xyzdxidzeta_map
Definition: fe_map.h:663
void libMesh::FEMap::compute_single_point_map ( const unsigned int  dim,
const std::vector< Real > &  qw,
const Elem elem,
unsigned int  p,
const std::vector< const Node * > &  elem_nodes,
bool  compute_second_derivatives 
)

Compute the jacobian and some other additional data fields at the single point with index p. Takes the integration weights as input, along with a pointer to the element and a list of points that contribute to the element. Also takes a boolean flag telling whether second derivatives should actually be computed.

Definition at line 401 of file fe_map.C.

References A, calculate_d2xyz, calculate_dxyz, calculate_xyz, calculations_started, compute_inverse_map_second_derivs(), d2etadxyz2_map, d2phideta2_map, d2phidetadzeta_map, d2phidxi2_map, d2phidxideta_map, d2phidxidzeta_map, d2phidzeta2_map, d2xidxyz2_map, d2xyzdeta2_map, d2xyzdetadzeta_map, d2xyzdxi2_map, d2xyzdxideta_map, d2xyzdxidzeta_map, d2xyzdzeta2_map, d2zetadxyz2_map, detadx_map, detady_map, detadz_map, dphideta_map, dphidxi_map, dphidzeta_map, dxdeta_map(), dxdxi_map(), dxdzeta_map(), dxidx_map, dxidy_map, dxidz_map, dxyzdeta_map, dxyzdxi_map, dxyzdzeta_map, dydeta_map(), dydxi_map(), dydzeta_map(), dzdeta_map(), dzdxi_map(), dzdzeta_map(), dzetadx_map, dzetady_map, dzetadz_map, libMesh::err, libMesh::DofObject::id(), jac, JxW, phi_map, libMesh::Elem::print_info(), libMesh::Real, libMesh::DenseMatrix< T >::vector_mult(), and xyz.

Referenced by compute_affine_map(), compute_map(), and ~FEMap().

407 {
408  libmesh_assert(elem);
409  libmesh_assert(calculations_started);
410 
411  if (calculate_xyz)
412  libmesh_assert_equal_to(phi_map.size(), elem_nodes.size());
413 
414  switch (dim)
415  {
416  //--------------------------------------------------------------------
417  // 0D
418  case 0:
419  {
420  libmesh_assert(elem_nodes[0]);
421  if (calculate_xyz)
422  xyz[p] = *elem_nodes[0];
423  if (calculate_dxyz)
424  {
425  jac[p] = 1.0;
426  JxW[p] = qw[p];
427  }
428  break;
429  }
430 
431  //--------------------------------------------------------------------
432  // 1D
433  case 1:
434  {
435  // Clear the entities that will be summed
436  if (calculate_xyz)
437  xyz[p].zero();
438  if (calculate_dxyz)
439  dxyzdxi_map[p].zero();
440 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
441  if (calculate_d2xyz)
442  {
443  d2xyzdxi2_map[p].zero();
444  // Inverse map second derivatives
445  d2xidxyz2_map[p].assign(6, 0.);
446  }
447 #endif
448 
449  // compute x, dx, d2x at the quadrature point
450  for (std::size_t i=0; i<elem_nodes.size(); i++) // sum over the nodes
451  {
452  // Reference to the point, helps eliminate
453  // excessive temporaries in the inner loop
454  libmesh_assert(elem_nodes[i]);
455  const Point & elem_point = *elem_nodes[i];
456 
457  if (calculate_xyz)
458  xyz[p].add_scaled (elem_point, phi_map[i][p] );
459  if (calculate_dxyz)
460  dxyzdxi_map[p].add_scaled (elem_point, dphidxi_map[i][p]);
461 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
462  if (calculate_d2xyz)
463  d2xyzdxi2_map[p].add_scaled(elem_point, d2phidxi2_map[i][p]);
464 #endif
465  }
466 
467  // Compute the jacobian
468  //
469  // 1D elements can live in 2D or 3D space.
470  // The transformation matrix from local->global
471  // coordinates is
472  //
473  // T = | dx/dxi |
474  // | dy/dxi |
475  // | dz/dxi |
476  //
477  // The generalized determinant of T (from the
478  // so-called "normal" eqns.) is
479  // jac = "det(T)" = sqrt(det(T'T))
480  //
481  // where T'= transpose of T, so
482  //
483  // jac = sqrt( (dx/dxi)^2 + (dy/dxi)^2 + (dz/dxi)^2 )
484 
485  if (calculate_dxyz)
486  {
487  jac[p] = dxyzdxi_map[p].norm();
488 
489  if (jac[p] <= 0.)
490  {
491  // Don't call print_info() recursively if we're already
492  // failing. print_info() calls Elem::volume() which may
493  // call FE::reinit() and trigger the same failure again.
494  static bool failing = false;
495  if (!failing)
496  {
497  failing = true;
498  elem->print_info(libMesh::err);
499  if (calculate_xyz)
500  {
501  libmesh_error_msg("ERROR: negative Jacobian " \
502  << jac[p] \
503  << " at point " \
504  << xyz[p] \
505  << " in element " \
506  << elem->id());
507  }
508  else
509  {
510  // In this case xyz[p] is not defined, so don't
511  // try to print it out.
512  libmesh_error_msg("ERROR: negative Jacobian " \
513  << jac[p] \
514  << " at point index " \
515  << p \
516  << " in element " \
517  << elem->id());
518  }
519  }
520  else
521  {
522  // We were already failing when we called this, so just
523  // stop the current computation and return with
524  // incomplete results.
525  return;
526  }
527  }
528 
529  // The inverse Jacobian entries also come from the
530  // generalized inverse of T (see also the 2D element
531  // living in 3D code).
532  const Real jacm2 = 1./jac[p]/jac[p];
533  dxidx_map[p] = jacm2*dxdxi_map(p);
534 #if LIBMESH_DIM > 1
535  dxidy_map[p] = jacm2*dydxi_map(p);
536 #endif
537 #if LIBMESH_DIM > 2
538  dxidz_map[p] = jacm2*dzdxi_map(p);
539 #endif
540 
541  JxW[p] = jac[p]*qw[p];
542  }
543 
544 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
545 
546  if (calculate_d2xyz)
547  {
548 #if LIBMESH_DIM == 1
549  // Compute inverse map second derivatives for 1D-element-living-in-1D case
551 #elif LIBMESH_DIM == 2
552  // Compute inverse map second derivatives for 1D-element-living-in-2D case
553  // See JWP notes for details
554 
555  // numer = x_xi*x_{xi xi} + y_xi*y_{xi xi}
556  Real numer =
557  dxyzdxi_map[p](0)*d2xyzdxi2_map[p](0) +
558  dxyzdxi_map[p](1)*d2xyzdxi2_map[p](1);
559 
560  // denom = (x_xi)^2 + (y_xi)^2 must be >= 0.0
561  Real denom =
562  dxyzdxi_map[p](0)*dxyzdxi_map[p](0) +
563  dxyzdxi_map[p](1)*dxyzdxi_map[p](1);
564 
565  if (denom <= 0.0)
566  {
567  // Don't call print_info() recursively if we're already
568  // failing. print_info() calls Elem::volume() which may
569  // call FE::reinit() and trigger the same failure again.
570  static bool failing = false;
571  if (!failing)
572  {
573  failing = true;
574  elem->print_info(libMesh::err);
575  libmesh_error_msg("Encountered invalid 1D element!");
576  }
577  else
578  {
579  // We were already failing when we called this, so just
580  // stop the current computation and return with
581  // incomplete results.
582  return;
583  }
584  }
585 
586  // xi_{x x}
587  d2xidxyz2_map[p][0] = -numer * dxidx_map[p]*dxidx_map[p] / denom;
588 
589  // xi_{x y}
590  d2xidxyz2_map[p][1] = -numer * dxidx_map[p]*dxidy_map[p] / denom;
591 
592  // xi_{y y}
593  d2xidxyz2_map[p][3] = -numer * dxidy_map[p]*dxidy_map[p] / denom;
594 
595 #elif LIBMESH_DIM == 3
596  // Compute inverse map second derivatives for 1D-element-living-in-3D case
597  // See JWP notes for details
598 
599  // numer = x_xi*x_{xi xi} + y_xi*y_{xi xi} + z_xi*z_{xi xi}
600  Real numer =
601  dxyzdxi_map[p](0)*d2xyzdxi2_map[p](0) +
602  dxyzdxi_map[p](1)*d2xyzdxi2_map[p](1) +
603  dxyzdxi_map[p](2)*d2xyzdxi2_map[p](2);
604 
605  // denom = (x_xi)^2 + (y_xi)^2 + (z_xi)^2 must be >= 0.0
606  Real denom =
607  dxyzdxi_map[p](0)*dxyzdxi_map[p](0) +
608  dxyzdxi_map[p](1)*dxyzdxi_map[p](1) +
609  dxyzdxi_map[p](2)*dxyzdxi_map[p](2);
610 
611  if (denom <= 0.0)
612  {
613  // Don't call print_info() recursively if we're already
614  // failing. print_info() calls Elem::volume() which may
615  // call FE::reinit() and trigger the same failure again.
616  static bool failing = false;
617  if (!failing)
618  {
619  failing = true;
620  elem->print_info(libMesh::err);
621  libmesh_error_msg("Encountered invalid 1D element!");
622  }
623  else
624  {
625  // We were already failing when we called this, so just
626  // stop the current computation and return with
627  // incomplete results.
628  return;
629  }
630  }
631 
632  // xi_{x x}
633  d2xidxyz2_map[p][0] = -numer * dxidx_map[p]*dxidx_map[p] / denom;
634 
635  // xi_{x y}
636  d2xidxyz2_map[p][1] = -numer * dxidx_map[p]*dxidy_map[p] / denom;
637 
638  // xi_{x z}
639  d2xidxyz2_map[p][2] = -numer * dxidx_map[p]*dxidz_map[p] / denom;
640 
641  // xi_{y y}
642  d2xidxyz2_map[p][3] = -numer * dxidy_map[p]*dxidy_map[p] / denom;
643 
644  // xi_{y z}
645  d2xidxyz2_map[p][4] = -numer * dxidy_map[p]*dxidz_map[p] / denom;
646 
647  // xi_{z z}
648  d2xidxyz2_map[p][5] = -numer * dxidz_map[p]*dxidz_map[p] / denom;
649 #endif
650  } // calculate_d2xyz
651 
652 #endif // LIBMESH_ENABLE_SECOND_DERIVATIVES
653 
654  // done computing the map
655  break;
656  }
657 
658 
659  //--------------------------------------------------------------------
660  // 2D
661  case 2:
662  {
663  //------------------------------------------------------------------
664  // Compute the (x,y) values at the quadrature points,
665  // the Jacobian at the quadrature points
666 
667  if (calculate_xyz)
668  xyz[p].zero();
669 
670  if (calculate_dxyz)
671  {
672  dxyzdxi_map[p].zero();
673  dxyzdeta_map[p].zero();
674  }
675 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
676  if (calculate_d2xyz)
677  {
678  d2xyzdxi2_map[p].zero();
679  d2xyzdxideta_map[p].zero();
680  d2xyzdeta2_map[p].zero();
681  // Inverse map second derivatives
682  d2xidxyz2_map[p].assign(6, 0.);
683  d2etadxyz2_map[p].assign(6, 0.);
684  }
685 #endif
686 
687 
688  // compute (x,y) at the quadrature points, derivatives once
689  for (std::size_t i=0; i<elem_nodes.size(); i++) // sum over the nodes
690  {
691  // Reference to the point, helps eliminate
692  // excessive temporaries in the inner loop
693  libmesh_assert(elem_nodes[i]);
694  const Point & elem_point = *elem_nodes[i];
695 
696  if (calculate_xyz)
697  xyz[p].add_scaled (elem_point, phi_map[i][p] );
698 
699  if (calculate_dxyz)
700  {
701  dxyzdxi_map[p].add_scaled (elem_point, dphidxi_map[i][p] );
702  dxyzdeta_map[p].add_scaled (elem_point, dphideta_map[i][p]);
703  }
704 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
705  if (calculate_d2xyz)
706  {
707  d2xyzdxi2_map[p].add_scaled (elem_point, d2phidxi2_map[i][p]);
708  d2xyzdxideta_map[p].add_scaled (elem_point, d2phidxideta_map[i][p]);
709  d2xyzdeta2_map[p].add_scaled (elem_point, d2phideta2_map[i][p]);
710  }
711 #endif
712  }
713 
714  if (calculate_dxyz)
715  {
716  // compute the jacobian once
717  const Real dx_dxi = dxdxi_map(p),
718  dx_deta = dxdeta_map(p),
719  dy_dxi = dydxi_map(p),
720  dy_deta = dydeta_map(p);
721 
722 #if LIBMESH_DIM == 2
723  // Compute the Jacobian. This assumes the 2D face
724  // lives in 2D space
725  //
726  // Symbolically, the matrix determinant is
727  //
728  // | dx/dxi dx/deta |
729  // jac = | dy/dxi dy/deta |
730  //
731  // jac = dx/dxi*dy/deta - dx/deta*dy/dxi
732  jac[p] = (dx_dxi*dy_deta - dx_deta*dy_dxi);
733 
734  if (jac[p] <= 0.)
735  {
736  // Don't call print_info() recursively if we're already
737  // failing. print_info() calls Elem::volume() which may
738  // call FE::reinit() and trigger the same failure again.
739  static bool failing = false;
740  if (!failing)
741  {
742  failing = true;
743  elem->print_info(libMesh::err);
744  if (calculate_xyz)
745  {
746  libmesh_error_msg("ERROR: negative Jacobian " \
747  << jac[p] \
748  << " at point " \
749  << xyz[p] \
750  << " in element " \
751  << elem->id());
752  }
753  else
754  {
755  // In this case xyz[p] is not defined, so don't
756  // try to print it out.
757  libmesh_error_msg("ERROR: negative Jacobian " \
758  << jac[p] \
759  << " at point index " \
760  << p \
761  << " in element " \
762  << elem->id());
763  }
764  }
765  else
766  {
767  // We were already failing when we called this, so just
768  // stop the current computation and return with
769  // incomplete results.
770  return;
771  }
772  }
773 
774  JxW[p] = jac[p]*qw[p];
775 
776  // Compute the shape function derivatives wrt x,y at the
777  // quadrature points
778  const Real inv_jac = 1./jac[p];
779 
780  dxidx_map[p] = dy_deta*inv_jac; //dxi/dx = (1/J)*dy/deta
781  dxidy_map[p] = -dx_deta*inv_jac; //dxi/dy = -(1/J)*dx/deta
782  detadx_map[p] = -dy_dxi* inv_jac; //deta/dx = -(1/J)*dy/dxi
783  detady_map[p] = dx_dxi* inv_jac; //deta/dy = (1/J)*dx/dxi
784 
785  dxidz_map[p] = detadz_map[p] = 0.;
786 
787  if (compute_second_derivatives)
789 
790 #else // LIBMESH_DIM == 3
791 
792  const Real dz_dxi = dzdxi_map(p),
793  dz_deta = dzdeta_map(p);
794 
795  // Compute the Jacobian. This assumes a 2D face in
796  // 3D space.
797  //
798  // The transformation matrix T from local to global
799  // coordinates is
800  //
801  // | dx/dxi dx/deta |
802  // T = | dy/dxi dy/deta |
803  // | dz/dxi dz/deta |
804  // note det(T' T) = det(T')det(T) = det(T)det(T)
805  // so det(T) = std::sqrt(det(T' T))
806  //
807  //----------------------------------------------
808  // Notes:
809  //
810  // dX = R dXi -> R'dX = R'R dXi
811  // (R^-1)dX = dXi [(R'R)^-1 R']dX = dXi
812  //
813  // so R^-1 = (R'R)^-1 R'
814  //
815  // and R^-1 R = (R'R)^-1 R'R = I.
816  //
817  const Real g11 = (dx_dxi*dx_dxi +
818  dy_dxi*dy_dxi +
819  dz_dxi*dz_dxi);
820 
821  const Real g12 = (dx_dxi*dx_deta +
822  dy_dxi*dy_deta +
823  dz_dxi*dz_deta);
824 
825  const Real g21 = g12;
826 
827  const Real g22 = (dx_deta*dx_deta +
828  dy_deta*dy_deta +
829  dz_deta*dz_deta);
830 
831  const Real det = (g11*g22 - g12*g21);
832 
833  if (det <= 0.)
834  {
835  // Don't call print_info() recursively if we're already
836  // failing. print_info() calls Elem::volume() which may
837  // call FE::reinit() and trigger the same failure again.
838  static bool failing = false;
839  if (!failing)
840  {
841  failing = true;
842  elem->print_info(libMesh::err);
843  if (calculate_xyz)
844  {
845  libmesh_error_msg("ERROR: negative Jacobian " \
846  << det \
847  << " at point " \
848  << xyz[p] \
849  << " in element " \
850  << elem->id());
851  }
852  else
853  {
854  // In this case xyz[p] is not defined, so don't
855  // try to print it out.
856  libmesh_error_msg("ERROR: negative Jacobian " \
857  << det \
858  << " at point index " \
859  << p \
860  << " in element " \
861  << elem->id());
862  }
863  }
864  else
865  {
866  // We were already failing when we called this, so just
867  // stop the current computation and return with
868  // incomplete results.
869  return;
870  }
871  }
872 
873  const Real inv_det = 1./det;
874  jac[p] = std::sqrt(det);
875 
876  JxW[p] = jac[p]*qw[p];
877 
878  const Real g11inv = g22*inv_det;
879  const Real g12inv = -g12*inv_det;
880  const Real g21inv = -g21*inv_det;
881  const Real g22inv = g11*inv_det;
882 
883  dxidx_map[p] = g11inv*dx_dxi + g12inv*dx_deta;
884  dxidy_map[p] = g11inv*dy_dxi + g12inv*dy_deta;
885  dxidz_map[p] = g11inv*dz_dxi + g12inv*dz_deta;
886 
887  detadx_map[p] = g21inv*dx_dxi + g22inv*dx_deta;
888  detady_map[p] = g21inv*dy_dxi + g22inv*dy_deta;
889  detadz_map[p] = g21inv*dz_dxi + g22inv*dz_deta;
890 
891 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
892 
893  if (calculate_d2xyz)
894  {
895  // Compute inverse map second derivative values for
896  // 2D-element-living-in-3D case. We pursue a least-squares
897  // solution approach for this "non-square" case, see JWP notes
898  // for details.
899 
900  // A = [ x_{xi xi} x_{eta eta} ]
901  // [ y_{xi xi} y_{eta eta} ]
902  // [ z_{xi xi} z_{eta eta} ]
903  DenseMatrix<Real> A(3,2);
904  A(0,0) = d2xyzdxi2_map[p](0); A(0,1) = d2xyzdeta2_map[p](0);
905  A(1,0) = d2xyzdxi2_map[p](1); A(1,1) = d2xyzdeta2_map[p](1);
906  A(2,0) = d2xyzdxi2_map[p](2); A(2,1) = d2xyzdeta2_map[p](2);
907 
908  // J^T, the transpose of the Jacobian matrix
909  DenseMatrix<Real> JT(2,3);
910  JT(0,0) = dx_dxi; JT(0,1) = dy_dxi; JT(0,2) = dz_dxi;
911  JT(1,0) = dx_deta; JT(1,1) = dy_deta; JT(1,2) = dz_deta;
912 
913  // (J^T J)^(-1), this has already been computed for us above...
914  DenseMatrix<Real> JTJinv(2,2);
915  JTJinv(0,0) = g11inv; JTJinv(0,1) = g12inv;
916  JTJinv(1,0) = g21inv; JTJinv(1,1) = g22inv;
917 
918  // Some helper variables
920  dxi (dxidx_map[p], dxidy_map[p], dxidz_map[p]),
921  deta (detadx_map[p], detady_map[p], detadz_map[p]);
922 
923  // To be filled in below
924  DenseVector<Real> tmp1(2);
925  DenseVector<Real> tmp2(3);
926  DenseVector<Real> tmp3(2);
927 
928  // For (s,t) in {(x,x), (x,y), (x,z), (y,y), (y,z), (z,z)}, compute the
929  // vector of inverse map second derivatives [xi_{s t}, eta_{s t}]
930  unsigned ctr=0;
931  for (unsigned s=0; s<3; ++s)
932  for (unsigned t=s; t<3; ++t)
933  {
934  // Construct tmp1 = [xi_s*xi_t, eta_s*eta_t]
935  tmp1(0) = dxi(s)*dxi(t);
936  tmp1(1) = deta(s)*deta(t);
937 
938  // Compute tmp2 = A * tmp1
939  A.vector_mult(tmp2, tmp1);
940 
941  // Compute scalar value "alpha"
942  Real alpha = dxi(s)*deta(t) + deta(s)*dxi(t);
943 
944  // Compute tmp2 <- tmp2 + alpha * x_{xi eta}
945  for (unsigned i=0; i<3; ++i)
946  tmp2(i) += alpha*d2xyzdxideta_map[p](i);
947 
948  // Compute tmp3 = J^T * tmp2
949  JT.vector_mult(tmp3, tmp2);
950 
951  // Compute tmp1 = (J^T J)^(-1) * tmp3. tmp1 is available for us to reuse.
952  JTJinv.vector_mult(tmp1, tmp3);
953 
954  // Fill in appropriate entries, don't forget to multiply by -1!
955  d2xidxyz2_map[p][ctr] = -tmp1(0);
956  d2etadxyz2_map[p][ctr] = -tmp1(1);
957 
958  // Increment the counter
959  ctr++;
960  }
961  }
962 
963 #endif // LIBMESH_ENABLE_SECOND_DERIVATIVES
964 
965 #endif // LIBMESH_DIM == 3
966  }
967  // done computing the map
968  break;
969  }
970 
971 
972 
973  //--------------------------------------------------------------------
974  // 3D
975  case 3:
976  {
977  //------------------------------------------------------------------
978  // Compute the (x,y,z) values at the quadrature points,
979  // the Jacobian at the quadrature point
980 
981  // Clear the entities that will be summed
982  if (calculate_xyz)
983  xyz[p].zero ();
984  if (calculate_dxyz)
985  {
986  dxyzdxi_map[p].zero ();
987  dxyzdeta_map[p].zero ();
988  dxyzdzeta_map[p].zero ();
989  }
990 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
991  if (calculate_d2xyz)
992  {
993  d2xyzdxi2_map[p].zero();
994  d2xyzdxideta_map[p].zero();
995  d2xyzdxidzeta_map[p].zero();
996  d2xyzdeta2_map[p].zero();
997  d2xyzdetadzeta_map[p].zero();
998  d2xyzdzeta2_map[p].zero();
999  // Inverse map second derivatives
1000  d2xidxyz2_map[p].assign(6, 0.);
1001  d2etadxyz2_map[p].assign(6, 0.);
1002  d2zetadxyz2_map[p].assign(6, 0.);
1003  }
1004 #endif
1005 
1006 
1007  // compute (x,y,z) at the quadrature points,
1008  // dxdxi, dydxi, dzdxi,
1009  // dxdeta, dydeta, dzdeta,
1010  // dxdzeta, dydzeta, dzdzeta all once
1011  for (std::size_t i=0; i<elem_nodes.size(); i++) // sum over the nodes
1012  {
1013  // Reference to the point, helps eliminate
1014  // excessive temporaries in the inner loop
1015  libmesh_assert(elem_nodes[i]);
1016  const Point & elem_point = *elem_nodes[i];
1017 
1018  if (calculate_xyz)
1019  xyz[p].add_scaled (elem_point, phi_map[i][p] );
1020  if (calculate_dxyz)
1021  {
1022  dxyzdxi_map[p].add_scaled (elem_point, dphidxi_map[i][p] );
1023  dxyzdeta_map[p].add_scaled (elem_point, dphideta_map[i][p] );
1024  dxyzdzeta_map[p].add_scaled (elem_point, dphidzeta_map[i][p]);
1025  }
1026 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
1027  if (calculate_d2xyz)
1028  {
1029  d2xyzdxi2_map[p].add_scaled (elem_point,
1030  d2phidxi2_map[i][p]);
1031  d2xyzdxideta_map[p].add_scaled (elem_point,
1032  d2phidxideta_map[i][p]);
1033  d2xyzdxidzeta_map[p].add_scaled (elem_point,
1034  d2phidxidzeta_map[i][p]);
1035  d2xyzdeta2_map[p].add_scaled (elem_point,
1036  d2phideta2_map[i][p]);
1037  d2xyzdetadzeta_map[p].add_scaled (elem_point,
1038  d2phidetadzeta_map[i][p]);
1039  d2xyzdzeta2_map[p].add_scaled (elem_point,
1040  d2phidzeta2_map[i][p]);
1041  }
1042 #endif
1043  }
1044 
1045  if (calculate_dxyz)
1046  {
1047  // compute the jacobian
1048  const Real
1049  dx_dxi = dxdxi_map(p), dy_dxi = dydxi_map(p), dz_dxi = dzdxi_map(p),
1050  dx_deta = dxdeta_map(p), dy_deta = dydeta_map(p), dz_deta = dzdeta_map(p),
1051  dx_dzeta = dxdzeta_map(p), dy_dzeta = dydzeta_map(p), dz_dzeta = dzdzeta_map(p);
1052 
1053  // Symbolically, the matrix determinant is
1054  //
1055  // | dx/dxi dy/dxi dz/dxi |
1056  // jac = | dx/deta dy/deta dz/deta |
1057  // | dx/dzeta dy/dzeta dz/dzeta |
1058  //
1059  // jac = dx/dxi*(dy/deta*dz/dzeta - dz/deta*dy/dzeta) +
1060  // dy/dxi*(dz/deta*dx/dzeta - dx/deta*dz/dzeta) +
1061  // dz/dxi*(dx/deta*dy/dzeta - dy/deta*dx/dzeta)
1062 
1063  jac[p] = (dx_dxi*(dy_deta*dz_dzeta - dz_deta*dy_dzeta) +
1064  dy_dxi*(dz_deta*dx_dzeta - dx_deta*dz_dzeta) +
1065  dz_dxi*(dx_deta*dy_dzeta - dy_deta*dx_dzeta));
1066 
1067  if (jac[p] <= 0.)
1068  {
1069  // Don't call print_info() recursively if we're already
1070  // failing. print_info() calls Elem::volume() which may
1071  // call FE::reinit() and trigger the same failure again.
1072  static bool failing = false;
1073  if (!failing)
1074  {
1075  failing = true;
1076  elem->print_info(libMesh::err);
1077  if (calculate_xyz)
1078  {
1079  libmesh_error_msg("ERROR: negative Jacobian " \
1080  << jac[p] \
1081  << " at point " \
1082  << xyz[p] \
1083  << " in element " \
1084  << elem->id());
1085  }
1086  else
1087  {
1088  // In this case xyz[p] is not defined, so don't
1089  // try to print it out.
1090  libmesh_error_msg("ERROR: negative Jacobian " \
1091  << jac[p] \
1092  << " at point index " \
1093  << p \
1094  << " in element " \
1095  << elem->id());
1096  }
1097  }
1098  else
1099  {
1100  // We were already failing when we called this, so just
1101  // stop the current computation and return with
1102  // incomplete results.
1103  return;
1104  }
1105  }
1106 
1107  JxW[p] = jac[p]*qw[p];
1108 
1109  // Compute the shape function derivatives wrt x,y at the
1110  // quadrature points
1111  const Real inv_jac = 1./jac[p];
1112 
1113  dxidx_map[p] = (dy_deta*dz_dzeta - dz_deta*dy_dzeta)*inv_jac;
1114  dxidy_map[p] = (dz_deta*dx_dzeta - dx_deta*dz_dzeta)*inv_jac;
1115  dxidz_map[p] = (dx_deta*dy_dzeta - dy_deta*dx_dzeta)*inv_jac;
1116 
1117  detadx_map[p] = (dz_dxi*dy_dzeta - dy_dxi*dz_dzeta )*inv_jac;
1118  detady_map[p] = (dx_dxi*dz_dzeta - dz_dxi*dx_dzeta )*inv_jac;
1119  detadz_map[p] = (dy_dxi*dx_dzeta - dx_dxi*dy_dzeta )*inv_jac;
1120 
1121  dzetadx_map[p] = (dy_dxi*dz_deta - dz_dxi*dy_deta )*inv_jac;
1122  dzetady_map[p] = (dz_dxi*dx_deta - dx_dxi*dz_deta )*inv_jac;
1123  dzetadz_map[p] = (dx_dxi*dy_deta - dy_dxi*dx_deta )*inv_jac;
1124  }
1125 
1126  if (compute_second_derivatives)
1128 
1129  // done computing the map
1130  break;
1131  }
1132 
1133  default:
1134  libmesh_error_msg("Invalid dim = " << dim);
1135  }
1136 }
std::vector< std::vector< Real > > dphidzeta_map
Definition: fe_map.h:773
void compute_inverse_map_second_derivs(unsigned p)
Definition: fe_map.C:1444
Real dxdzeta_map(const unsigned int p) const
Definition: fe_map.h:598
std::vector< std::vector< Real > > dphidxi_map
Definition: fe_map.h:763
std::vector< std::vector< Real > > d2etadxyz2_map
Definition: fe_map.h:746
bool calculate_dxyz
Definition: fe_map.h:888
VectorValue< Real > RealVectorValue
std::vector< RealGradient > d2xyzdzeta2_map
Definition: fe_map.h:675
std::vector< Real > dzetady_map
Definition: fe_map.h:727
std::vector< std::vector< Real > > d2xidxyz2_map
Definition: fe_map.h:740
Real dxdxi_map(const unsigned int p) const
Definition: fe_map.h:550
std::vector< std::vector< Real > > d2phideta2_map
Definition: fe_map.h:795
std::vector< std::vector< Real > > d2phidxidzeta_map
Definition: fe_map.h:790
std::vector< Real > dxidz_map
Definition: fe_map.h:695
std::vector< std::vector< Real > > phi_map
Definition: fe_map.h:758
Real dydxi_map(const unsigned int p) const
Definition: fe_map.h:558
std::vector< std::vector< Real > > d2phidetadzeta_map
Definition: fe_map.h:800
std::vector< RealGradient > d2xyzdxideta_map
Definition: fe_map.h:649
std::vector< RealGradient > dxyzdzeta_map
Definition: fe_map.h:637
std::vector< Real > dzetadx_map
Definition: fe_map.h:721
std::vector< RealGradient > dxyzdxi_map
Definition: fe_map.h:625
Real dydzeta_map(const unsigned int p) const
Definition: fe_map.h:606
std::vector< RealGradient > d2xyzdeta2_map
Definition: fe_map.h:655
std::vector< RealGradient > d2xyzdxi2_map
Definition: fe_map.h:643
std::vector< Real > dzetadz_map
Definition: fe_map.h:733
bool calculate_d2xyz
Definition: fe_map.h:893
std::vector< std::vector< Real > > d2zetadxyz2_map
Definition: fe_map.h:752
Real dzdxi_map(const unsigned int p) const
Definition: fe_map.h:566
bool calculations_started
Definition: fe_map.h:878
std::vector< RealGradient > d2xyzdetadzeta_map
Definition: fe_map.h:669
std::vector< Real > dxidx_map
Definition: fe_map.h:683
bool calculate_xyz
Definition: fe_map.h:883
std::vector< Real > dxidy_map
Definition: fe_map.h:689
OStreamProxy err(std::cerr)
Real dxdeta_map(const unsigned int p) const
Definition: fe_map.h:574
Real dydeta_map(const unsigned int p) const
Definition: fe_map.h:582
std::vector< Real > JxW
Definition: fe_map.h:872
std::vector< std::vector< Real > > d2phidxideta_map
Definition: fe_map.h:785
std::vector< Point > xyz
Definition: fe_map.h:619
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< const Node * > elem_nodes
Definition: fe_map.h:912
static PetscErrorCode Mat * A
std::vector< Real > detady_map
Definition: fe_map.h:708
std::vector< RealGradient > dxyzdeta_map
Definition: fe_map.h:631
std::vector< Real > jac
Definition: fe_map.h:867
std::vector< Real > detadz_map
Definition: fe_map.h:714
std::vector< std::vector< Real > > d2phidzeta2_map
Definition: fe_map.h:805
std::vector< std::vector< Real > > d2phidxi2_map
Definition: fe_map.h:780
std::vector< Real > detadx_map
Definition: fe_map.h:702
std::vector< std::vector< Real > > dphideta_map
Definition: fe_map.h:768
Real dzdeta_map(const unsigned int p) const
Definition: fe_map.h:590
std::vector< RealGradient > d2xyzdxidzeta_map
Definition: fe_map.h:663
Real dzdzeta_map(const unsigned int p) const
Definition: fe_map.h:614
void libMesh::FEMap::determine_calculations ( )
inlineprotected

Determine which values are to be calculated

Definition at line 528 of file fe_map.h.

References calculate_d2xyz, calculate_dxyz, calculations_started, and resize_quadrature_map_vectors().

Referenced by compute_edge_map(), compute_face_map(), init_edge_shape_functions(), init_face_shape_functions(), init_reference_to_physical_map(), and resize_quadrature_map_vectors().

528  {
529  calculations_started = true;
530 
531 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
532  // Second derivative calculations currently have first derivative
533  // calculations as a prerequisite
534  if (calculate_d2xyz)
535  calculate_dxyz = true;
536 #endif
537  }
bool calculate_dxyz
Definition: fe_map.h:888
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculations_started
Definition: fe_map.h:878
Real libMesh::FEMap::dxdeta_map ( const unsigned int  p) const
inlineprotected

Used in FEMap::compute_map(), which should be be usable in derived classes, and therefore protected.

Returns
The x value of the pth entry of the dxzydeta_map.

Definition at line 574 of file fe_map.h.

References dxyzdeta_map.

Referenced by libMesh::FEXYZMap::compute_face_map(), compute_face_map(), and compute_single_point_map().

574 { return dxyzdeta_map[p](0); }
std::vector< RealGradient > dxyzdeta_map
Definition: fe_map.h:631
Real libMesh::FEMap::dxdxi_map ( const unsigned int  p) const
inlineprotected

Used in FEMap::compute_map(), which should be be usable in derived classes, and therefore protected.

Returns
The x value of the pth entry of the dxzydxi_map.

Definition at line 550 of file fe_map.h.

References dxyzdxi_map.

Referenced by compute_edge_map(), libMesh::FEXYZMap::compute_face_map(), compute_face_map(), and compute_single_point_map().

550 { return dxyzdxi_map[p](0); }
std::vector< RealGradient > dxyzdxi_map
Definition: fe_map.h:625
Real libMesh::FEMap::dxdzeta_map ( const unsigned int  p) const
inlineprotected

Used in FEMap::compute_map(), which should be be usable in derived classes, and therefore protected.

Returns
The x value of the pth entry of the dxzydzeta_map.

Definition at line 598 of file fe_map.h.

References dxyzdzeta_map.

Referenced by compute_single_point_map().

598 { return dxyzdzeta_map[p](0); }
std::vector< RealGradient > dxyzdzeta_map
Definition: fe_map.h:637
Real libMesh::FEMap::dydeta_map ( const unsigned int  p) const
inlineprotected

Used in FEMap::compute_map(), which should be be usable in derived classes, and therefore protected.

Returns
The y value of the pth entry of the dxzydeta_map.

Definition at line 582 of file fe_map.h.

References dxyzdeta_map.

Referenced by libMesh::FEXYZMap::compute_face_map(), compute_face_map(), and compute_single_point_map().

582 { return dxyzdeta_map[p](1); }
std::vector< RealGradient > dxyzdeta_map
Definition: fe_map.h:631
Real libMesh::FEMap::dydxi_map ( const unsigned int  p) const
inlineprotected

Used in FEMap::compute_map(), which should be be usable in derived classes, and therefore protected.

Returns
The y value of the pth entry of the dxzydxi_map.

Definition at line 558 of file fe_map.h.

References dxyzdxi_map.

Referenced by compute_edge_map(), libMesh::FEXYZMap::compute_face_map(), compute_face_map(), and compute_single_point_map().

558 { return dxyzdxi_map[p](1); }
std::vector< RealGradient > dxyzdxi_map
Definition: fe_map.h:625
Real libMesh::FEMap::dydzeta_map ( const unsigned int  p) const
inlineprotected

Used in FEMap::compute_map(), which should be be usable in derived classes, and therefore protected.

Returns
The y value of the pth entry of the dxzydzeta_map.

Definition at line 606 of file fe_map.h.

References dxyzdzeta_map.

Referenced by compute_single_point_map().

606 { return dxyzdzeta_map[p](1); }
std::vector< RealGradient > dxyzdzeta_map
Definition: fe_map.h:637
Real libMesh::FEMap::dzdeta_map ( const unsigned int  p) const
inlineprotected

Used in FEMap::compute_map(), which should be be usable in derived classes, and therefore protected.

Returns
The z value of the pth entry of the dxzydeta_map.

Definition at line 590 of file fe_map.h.

References dxyzdeta_map.

Referenced by libMesh::FEXYZMap::compute_face_map(), compute_face_map(), and compute_single_point_map().

590 { return dxyzdeta_map[p](2); }
std::vector< RealGradient > dxyzdeta_map
Definition: fe_map.h:631
Real libMesh::FEMap::dzdxi_map ( const unsigned int  p) const
inlineprotected

Used in FEMap::compute_map(), which should be be usable in derived classes, and therefore protected.

Returns
The z value of the pth entry of the dxzydxi_map.

Definition at line 566 of file fe_map.h.

References dxyzdxi_map.

Referenced by compute_edge_map(), libMesh::FEXYZMap::compute_face_map(), compute_face_map(), and compute_single_point_map().

566 { return dxyzdxi_map[p](2); }
std::vector< RealGradient > dxyzdxi_map
Definition: fe_map.h:625
Real libMesh::FEMap::dzdzeta_map ( const unsigned int  p) const
inlineprotected

Used in FEMap::compute_map(), which should be be usable in derived classes, and therefore protected.

Returns
The z value of the pth entry of the dxzydzeta_map.

Definition at line 614 of file fe_map.h.

References dxyzdzeta_map.

Referenced by compute_single_point_map().

614 { return dxyzdzeta_map[p](2); }
std::vector< RealGradient > dxyzdzeta_map
Definition: fe_map.h:637
const std::vector<Real>& libMesh::FEMap::get_curvatures ( ) const
inline
Returns
The curvatures for use in face integration.

Definition at line 381 of file fe_map.h.

References calculate_d2xyz, calculations_started, curvatures, print_JxW(), and print_xyz().

382  { libmesh_assert(!calculations_started || calculate_d2xyz);
383  calculate_d2xyz = true; return curvatures;}
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculations_started
Definition: fe_map.h:878
std::vector< Real > curvatures
Definition: fe_map.h:862
const std::vector<std::vector<Real> >& libMesh::FEMap::get_d2etadxyz2 ( ) const
inline

Second derivatives of "eta" reference coordinate wrt physical coordinates.

Definition at line 318 of file fe_map.h.

References calculate_d2xyz, calculations_started, and d2etadxyz2_map.

Referenced by libMesh::H1FETransformation< OutputShape >::map_d2phi().

319  { libmesh_assert(!calculations_started || calculate_d2xyz);
320  calculate_d2xyz = true; return d2etadxyz2_map; }
std::vector< std::vector< Real > > d2etadxyz2_map
Definition: fe_map.h:746
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculations_started
Definition: fe_map.h:878
std::vector<std::vector<Real> >& libMesh::FEMap::get_d2phideta2_map ( )
inline
Returns
The reference to physical map 2nd derivative

Definition at line 494 of file fe_map.h.

References calculate_d2xyz, calculations_started, and d2phideta2_map.

495  { libmesh_assert(!calculations_started || calculate_d2xyz);
496  calculate_d2xyz = true; return d2phideta2_map; }
std::vector< std::vector< Real > > d2phideta2_map
Definition: fe_map.h:795
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculations_started
Definition: fe_map.h:878
std::vector<std::vector<Real> >& libMesh::FEMap::get_d2phidetadzeta_map ( )
inline
Returns
The reference to physical map 2nd derivative

Definition at line 501 of file fe_map.h.

References calculate_d2xyz, calculations_started, and d2phidetadzeta_map.

502  { libmesh_assert(!calculations_started || calculate_d2xyz);
503  calculate_d2xyz = true; return d2phidetadzeta_map; }
std::vector< std::vector< Real > > d2phidetadzeta_map
Definition: fe_map.h:800
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculations_started
Definition: fe_map.h:878
std::vector<std::vector<Real> >& libMesh::FEMap::get_d2phidxi2_map ( )
inline
Returns
The reference to physical map 2nd derivative

Definition at line 473 of file fe_map.h.

References calculate_d2xyz, calculations_started, and d2phidxi2_map.

474  { libmesh_assert(!calculations_started || calculate_d2xyz);
475  calculate_d2xyz = true; return d2phidxi2_map; }
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculations_started
Definition: fe_map.h:878
std::vector< std::vector< Real > > d2phidxi2_map
Definition: fe_map.h:780
std::vector<std::vector<Real> >& libMesh::FEMap::get_d2phidxideta_map ( )
inline
Returns
The reference to physical map 2nd derivative

Definition at line 480 of file fe_map.h.

References calculate_d2xyz, calculations_started, and d2phidxideta_map.

481  { libmesh_assert(!calculations_started || calculate_d2xyz);
482  calculate_d2xyz = true; return d2phidxideta_map; }
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculations_started
Definition: fe_map.h:878
std::vector< std::vector< Real > > d2phidxideta_map
Definition: fe_map.h:785
std::vector<std::vector<Real> >& libMesh::FEMap::get_d2phidxidzeta_map ( )
inline
Returns
The reference to physical map 2nd derivative

Definition at line 487 of file fe_map.h.

References calculate_d2xyz, calculations_started, and d2phidxidzeta_map.

488  { libmesh_assert(!calculations_started || calculate_d2xyz);
489  calculate_d2xyz = true; return d2phidxidzeta_map; }
std::vector< std::vector< Real > > d2phidxidzeta_map
Definition: fe_map.h:790
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculations_started
Definition: fe_map.h:878
std::vector<std::vector<Real> >& libMesh::FEMap::get_d2phidzeta2_map ( )
inline
Returns
The reference to physical map 2nd derivative

Definition at line 508 of file fe_map.h.

References calculate_d2xyz, calculations_started, and d2phidzeta2_map.

509  { libmesh_assert(!calculations_started || calculate_d2xyz);
510  calculate_d2xyz = true; return d2phidzeta2_map; }
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculations_started
Definition: fe_map.h:878
std::vector< std::vector< Real > > d2phidzeta2_map
Definition: fe_map.h:805
std::vector<std::vector<Real> >& libMesh::FEMap::get_d2psideta2 ( )
inline
Returns
The reference to physical map 2nd derivative for the side/edge

Definition at line 437 of file fe_map.h.

References calculate_d2xyz, calculations_started, and d2psideta2_map.

438  { libmesh_assert(!calculations_started || calculate_d2xyz);
439  calculate_d2xyz = true; return d2psideta2_map; }
std::vector< std::vector< Real > > d2psideta2_map
Definition: fe_map.h:845
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculations_started
Definition: fe_map.h:878
std::vector<std::vector<Real> >& libMesh::FEMap::get_d2psidxi2 ( )
inline
Returns
The reference to physical map 2nd derivative for the side/edge

Definition at line 423 of file fe_map.h.

References calculate_d2xyz, calculations_started, and d2psidxi2_map.

424  { libmesh_assert(!calculations_started || calculate_d2xyz);
425  calculate_d2xyz = true; return d2psidxi2_map; }
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculations_started
Definition: fe_map.h:878
std::vector< std::vector< Real > > d2psidxi2_map
Definition: fe_map.h:831
std::vector<std::vector<Real> >& libMesh::FEMap::get_d2psidxideta ( )
inline
Returns
The reference to physical map 2nd derivative for the side/edge

Definition at line 430 of file fe_map.h.

References calculate_d2xyz, calculations_started, and d2psidxideta_map.

431  { libmesh_assert(!calculations_started || calculate_d2xyz);
432  calculate_d2xyz = true; return d2psidxideta_map; }
std::vector< std::vector< Real > > d2psidxideta_map
Definition: fe_map.h:838
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculations_started
Definition: fe_map.h:878
const std::vector<std::vector<Real> >& libMesh::FEMap::get_d2xidxyz2 ( ) const
inline

Second derivatives of "xi" reference coordinate wrt physical coordinates.

Definition at line 311 of file fe_map.h.

References calculate_d2xyz, calculations_started, and d2xidxyz2_map.

Referenced by libMesh::HCurlFETransformation< OutputShape >::init_map_d2phi(), libMesh::H1FETransformation< OutputShape >::init_map_d2phi(), and libMesh::H1FETransformation< OutputShape >::map_d2phi().

312  { libmesh_assert(!calculations_started || calculate_d2xyz);
313  calculate_d2xyz = true; return d2xidxyz2_map; }
std::vector< std::vector< Real > > d2xidxyz2_map
Definition: fe_map.h:740
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculations_started
Definition: fe_map.h:878
const std::vector<RealGradient>& libMesh::FEMap::get_d2xyzdeta2 ( ) const
inline
Returns
The second partial derivatives in eta.

Definition at line 195 of file fe_map.h.

References calculate_d2xyz, calculations_started, and d2xyzdeta2_map.

196  { libmesh_assert(!calculations_started || calculate_d2xyz);
197  calculate_d2xyz = true; return d2xyzdeta2_map; }
std::vector< RealGradient > d2xyzdeta2_map
Definition: fe_map.h:655
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculations_started
Definition: fe_map.h:878
const std::vector<RealGradient>& libMesh::FEMap::get_d2xyzdetadzeta ( ) const
inline
Returns
The second partial derivatives in eta-zeta.

Definition at line 229 of file fe_map.h.

References calculate_d2xyz, calculations_started, and d2xyzdetadzeta_map.

230  { libmesh_assert(!calculations_started || calculate_d2xyz);
231  calculate_d2xyz = true; return d2xyzdetadzeta_map; }
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculations_started
Definition: fe_map.h:878
std::vector< RealGradient > d2xyzdetadzeta_map
Definition: fe_map.h:669
const std::vector<RealGradient>& libMesh::FEMap::get_d2xyzdxi2 ( ) const
inline
Returns
The second partial derivatives in xi.

Definition at line 188 of file fe_map.h.

References calculate_d2xyz, calculations_started, and d2xyzdxi2_map.

189  { libmesh_assert(!calculations_started || calculate_d2xyz);
190  calculate_d2xyz = true; return d2xyzdxi2_map; }
std::vector< RealGradient > d2xyzdxi2_map
Definition: fe_map.h:643
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculations_started
Definition: fe_map.h:878
const std::vector<RealGradient>& libMesh::FEMap::get_d2xyzdxideta ( ) const
inline
Returns
The second partial derivatives in xi-eta.

Definition at line 213 of file fe_map.h.

References calculate_d2xyz, calculations_started, and d2xyzdxideta_map.

214  { libmesh_assert(!calculations_started || calculate_d2xyz);
215  calculate_d2xyz = true; return d2xyzdxideta_map; }
std::vector< RealGradient > d2xyzdxideta_map
Definition: fe_map.h:649
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculations_started
Definition: fe_map.h:878
const std::vector<RealGradient>& libMesh::FEMap::get_d2xyzdxidzeta ( ) const
inline
Returns
The second partial derivatives in xi-zeta.

Definition at line 222 of file fe_map.h.

References calculate_d2xyz, calculations_started, and d2xyzdxidzeta_map.

223  { libmesh_assert(!calculations_started || calculate_d2xyz);
224  calculate_d2xyz = true; return d2xyzdxidzeta_map; }
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculations_started
Definition: fe_map.h:878
std::vector< RealGradient > d2xyzdxidzeta_map
Definition: fe_map.h:663
const std::vector<RealGradient>& libMesh::FEMap::get_d2xyzdzeta2 ( ) const
inline
Returns
The second partial derivatives in zeta.

Definition at line 204 of file fe_map.h.

References calculate_d2xyz, calculations_started, and d2xyzdzeta2_map.

205  { libmesh_assert(!calculations_started || calculate_d2xyz);
206  calculate_d2xyz = true; return d2xyzdzeta2_map; }
std::vector< RealGradient > d2xyzdzeta2_map
Definition: fe_map.h:675
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculations_started
Definition: fe_map.h:878
const std::vector<std::vector<Real> >& libMesh::FEMap::get_d2zetadxyz2 ( ) const
inline

Second derivatives of "zeta" reference coordinate wrt physical coordinates.

Definition at line 325 of file fe_map.h.

References calculate_d2xyz, calculations_started, and d2zetadxyz2_map.

Referenced by libMesh::H1FETransformation< OutputShape >::map_d2phi().

326  { libmesh_assert(!calculations_started || calculate_d2xyz);
327  calculate_d2xyz = true; return d2zetadxyz2_map; }
bool calculate_d2xyz
Definition: fe_map.h:893
std::vector< std::vector< Real > > d2zetadxyz2_map
Definition: fe_map.h:752
bool calculations_started
Definition: fe_map.h:878
const std::vector<Real>& libMesh::FEMap::get_detadx ( ) const
inline
const std::vector<Real>& libMesh::FEMap::get_detady ( ) const
inline
const std::vector<Real>& libMesh::FEMap::get_detadz ( ) const
inline
const std::vector<std::vector<Real> >& libMesh::FEMap::get_dphideta_map ( ) const
inline
Returns
The reference to physical map derivative

Definition at line 353 of file fe_map.h.

References calculate_dxyz, calculations_started, and dphideta_map.

354  { libmesh_assert(!calculations_started || calculate_dxyz);
355  calculate_dxyz = true; return dphideta_map; }
bool calculate_dxyz
Definition: fe_map.h:888
bool calculations_started
Definition: fe_map.h:878
std::vector< std::vector< Real > > dphideta_map
Definition: fe_map.h:768
std::vector<std::vector<Real> >& libMesh::FEMap::get_dphideta_map ( )
inline
Returns
The reference to physical map derivative

Definition at line 458 of file fe_map.h.

References calculate_dxyz, calculations_started, and dphideta_map.

459  { libmesh_assert(!calculations_started || calculate_dxyz);
460  calculate_dxyz = true; return dphideta_map; }
bool calculate_dxyz
Definition: fe_map.h:888
bool calculations_started
Definition: fe_map.h:878
std::vector< std::vector< Real > > dphideta_map
Definition: fe_map.h:768
const std::vector<std::vector<Real> >& libMesh::FEMap::get_dphidxi_map ( ) const
inline
Returns
The reference to physical map derivative

Definition at line 346 of file fe_map.h.

References calculate_dxyz, calculations_started, and dphidxi_map.

347  { libmesh_assert(!calculations_started || calculate_dxyz);
348  calculate_dxyz = true; return dphidxi_map; }
std::vector< std::vector< Real > > dphidxi_map
Definition: fe_map.h:763
bool calculate_dxyz
Definition: fe_map.h:888
bool calculations_started
Definition: fe_map.h:878
std::vector<std::vector<Real> >& libMesh::FEMap::get_dphidxi_map ( )
inline
Returns
The reference to physical map derivative

Definition at line 451 of file fe_map.h.

References calculate_dxyz, calculations_started, and dphidxi_map.

452  { libmesh_assert(!calculations_started || calculate_dxyz);
453  calculate_dxyz = true; return dphidxi_map; }
std::vector< std::vector< Real > > dphidxi_map
Definition: fe_map.h:763
bool calculate_dxyz
Definition: fe_map.h:888
bool calculations_started
Definition: fe_map.h:878
const std::vector<std::vector<Real> >& libMesh::FEMap::get_dphidzeta_map ( ) const
inline
Returns
The reference to physical map derivative

Definition at line 360 of file fe_map.h.

References calculate_dxyz, calculations_started, and dphidzeta_map.

361  { libmesh_assert(!calculations_started || calculate_dxyz);
362  calculate_dxyz = true; return dphidzeta_map; }
std::vector< std::vector< Real > > dphidzeta_map
Definition: fe_map.h:773
bool calculate_dxyz
Definition: fe_map.h:888
bool calculations_started
Definition: fe_map.h:878
std::vector<std::vector<Real> >& libMesh::FEMap::get_dphidzeta_map ( )
inline
Returns
The reference to physical map derivative

Definition at line 465 of file fe_map.h.

References calculate_dxyz, calculations_started, and dphidzeta_map.

466  { libmesh_assert(!calculations_started || calculate_dxyz);
467  calculate_dxyz = true; return dphidzeta_map; }
std::vector< std::vector< Real > > dphidzeta_map
Definition: fe_map.h:773
bool calculate_dxyz
Definition: fe_map.h:888
bool calculations_started
Definition: fe_map.h:878
std::vector<std::vector<Real> >& libMesh::FEMap::get_dpsideta ( )
inline
Returns
The reference to physical map derivative for the side/edge

Definition at line 416 of file fe_map.h.

References calculate_dxyz, calculations_started, and dpsideta_map.

417  { libmesh_assert(!calculations_started || calculate_dxyz);
418  calculate_dxyz = true; return dpsideta_map; }
std::vector< std::vector< Real > > dpsideta_map
Definition: fe_map.h:824
bool calculate_dxyz
Definition: fe_map.h:888
bool calculations_started
Definition: fe_map.h:878
std::vector<std::vector<Real> >& libMesh::FEMap::get_dpsidxi ( )
inline
Returns
The reference to physical map derivative for the side/edge

Definition at line 409 of file fe_map.h.

References calculate_dxyz, calculations_started, and dpsidxi_map.

410  { libmesh_assert(!calculations_started || calculate_dxyz);
411  calculate_dxyz = true; return dpsidxi_map; }
bool calculate_dxyz
Definition: fe_map.h:888
bool calculations_started
Definition: fe_map.h:878
std::vector< std::vector< Real > > dpsidxi_map
Definition: fe_map.h:818
const std::vector<Real>& libMesh::FEMap::get_dxidy ( ) const
inline
const std::vector<Real>& libMesh::FEMap::get_dxidz ( ) const
inline
const std::vector<RealGradient>& libMesh::FEMap::get_dxyzdeta ( ) const
inline
Returns
The element tangents in eta-direction at the quadrature points.

Definition at line 173 of file fe_map.h.

References calculate_dxyz, calculations_started, and dxyzdeta_map.

Referenced by libMesh::HCurlFETransformation< OutputShape >::map_curl().

174  { libmesh_assert(!calculations_started || calculate_dxyz);
175  calculate_dxyz = true; return dxyzdeta_map; }
bool calculate_dxyz
Definition: fe_map.h:888
bool calculations_started
Definition: fe_map.h:878
std::vector< RealGradient > dxyzdeta_map
Definition: fe_map.h:631
const std::vector<RealGradient>& libMesh::FEMap::get_dxyzdxi ( ) const
inline
Returns
The element tangents in xi-direction at the quadrature points.

Definition at line 165 of file fe_map.h.

References calculate_dxyz, calculations_started, and dxyzdxi_map.

Referenced by libMesh::HCurlFETransformation< OutputShape >::map_curl().

166  { libmesh_assert(!calculations_started || calculate_dxyz);
167  calculate_dxyz = true; return dxyzdxi_map; }
bool calculate_dxyz
Definition: fe_map.h:888
std::vector< RealGradient > dxyzdxi_map
Definition: fe_map.h:625
bool calculations_started
Definition: fe_map.h:878
const std::vector<RealGradient>& libMesh::FEMap::get_dxyzdzeta ( ) const
inline
Returns
The element tangents in zeta-direction at the quadrature points.

Definition at line 181 of file fe_map.h.

References calculate_dxyz, calculations_started, and dxyzdzeta_map.

Referenced by libMesh::HCurlFETransformation< OutputShape >::map_curl().

182  { libmesh_assert(!calculations_started || calculate_dxyz);
183  calculate_dxyz = true; return dxyzdzeta_map; }
bool calculate_dxyz
Definition: fe_map.h:888
std::vector< RealGradient > dxyzdzeta_map
Definition: fe_map.h:637
bool calculations_started
Definition: fe_map.h:878
const std::vector<Real>& libMesh::FEMap::get_dzetadx ( ) const
inline
const std::vector<Real>& libMesh::FEMap::get_dzetady ( ) const
inline
const std::vector<Real>& libMesh::FEMap::get_dzetadz ( ) const
inline
const std::vector<Real>& libMesh::FEMap::get_jacobian ( ) const
inline
Returns
The element Jacobian for each quadrature point.

Definition at line 149 of file fe_map.h.

References calculate_dxyz, calculations_started, and jac.

Referenced by libMesh::HCurlFETransformation< OutputShape >::map_curl().

150  { libmesh_assert(!calculations_started || calculate_dxyz);
151  calculate_dxyz = true; return jac; }
bool calculate_dxyz
Definition: fe_map.h:888
bool calculations_started
Definition: fe_map.h:878
std::vector< Real > jac
Definition: fe_map.h:867
const std::vector<Real>& libMesh::FEMap::get_JxW ( ) const
inline
Returns
The element Jacobian times the quadrature weight for each quadrature point.

Definition at line 157 of file fe_map.h.

References calculate_dxyz, calculations_started, and JxW.

158  { libmesh_assert(!calculations_started || calculate_dxyz);
159  calculate_dxyz = true; return JxW; }
bool calculate_dxyz
Definition: fe_map.h:888
bool calculations_started
Definition: fe_map.h:878
std::vector< Real > JxW
Definition: fe_map.h:872
std::vector<Real>& libMesh::FEMap::get_JxW ( )
inline
Returns
Writable reference to the element Jacobian times the quadrature weight for each quadrature point.

Definition at line 519 of file fe_map.h.

References calculate_dxyz, calculations_started, and JxW.

520  { libmesh_assert(!calculations_started || calculate_dxyz);
521  calculate_dxyz = true; return JxW; }
bool calculate_dxyz
Definition: fe_map.h:888
bool calculations_started
Definition: fe_map.h:878
std::vector< Real > JxW
Definition: fe_map.h:872
const std::vector<Point>& libMesh::FEMap::get_normals ( ) const
inline
Returns
The outward pointing normal vectors for face integration.

Definition at line 374 of file fe_map.h.

References calculate_dxyz, calculations_started, and normals.

375  { libmesh_assert(!calculations_started || calculate_dxyz);
376  calculate_dxyz = true; return normals; }
bool calculate_dxyz
Definition: fe_map.h:888
bool calculations_started
Definition: fe_map.h:878
std::vector< Point > normals
Definition: fe_map.h:855
const std::vector<std::vector<Real> >& libMesh::FEMap::get_phi_map ( ) const
inline
Returns
The reference to physical map for the element

Definition at line 339 of file fe_map.h.

References calculate_xyz, calculations_started, and phi_map.

340  { libmesh_assert(!calculations_started || calculate_xyz);
341  calculate_xyz = true; return phi_map; }
std::vector< std::vector< Real > > phi_map
Definition: fe_map.h:758
bool calculations_started
Definition: fe_map.h:878
bool calculate_xyz
Definition: fe_map.h:883
std::vector<std::vector<Real> >& libMesh::FEMap::get_phi_map ( )
inline
Returns
The reference to physical map for the element

Definition at line 444 of file fe_map.h.

References calculate_xyz, calculations_started, and phi_map.

445  { libmesh_assert(!calculations_started || calculate_xyz);
446  calculate_xyz = true; return phi_map; }
std::vector< std::vector< Real > > phi_map
Definition: fe_map.h:758
bool calculations_started
Definition: fe_map.h:878
bool calculate_xyz
Definition: fe_map.h:883
const std::vector<std::vector<Real> >& libMesh::FEMap::get_psi ( ) const
inline
Returns
The reference to physical map for the side/edge

Definition at line 333 of file fe_map.h.

References psi_map.

334  { return psi_map; }
std::vector< std::vector< Real > > psi_map
Definition: fe_map.h:812
std::vector<std::vector<Real> >& libMesh::FEMap::get_psi ( )
inline
Returns
The reference to physical map for the side/edge

Definition at line 403 of file fe_map.h.

References psi_map.

404  { return psi_map; }
std::vector< std::vector< Real > > psi_map
Definition: fe_map.h:812
const std::vector<std::vector<Point> >& libMesh::FEMap::get_tangents ( ) const
inline
Returns
The tangent vectors for face integration.

Definition at line 367 of file fe_map.h.

References calculate_dxyz, calculations_started, and tangents.

368  { libmesh_assert(!calculations_started || calculate_dxyz);
369  calculate_dxyz = true; return tangents; }
bool calculate_dxyz
Definition: fe_map.h:888
bool calculations_started
Definition: fe_map.h:878
std::vector< std::vector< Point > > tangents
Definition: fe_map.h:850
const std::vector<Point>& libMesh::FEMap::get_xyz ( ) const
inline
Returns
The xyz spatial locations of the quadrature points on the element.

Definition at line 142 of file fe_map.h.

References calculate_xyz, calculations_started, and xyz.

143  { libmesh_assert(!calculations_started || calculate_xyz);
144  calculate_xyz = true; return xyz; }
bool calculations_started
Definition: fe_map.h:878
bool calculate_xyz
Definition: fe_map.h:883
std::vector< Point > xyz
Definition: fe_map.h:619
template<unsigned int Dim>
void libMesh::FEMap::init_edge_shape_functions ( const std::vector< Point > &  qp,
const Elem edge 
)

Same as before, but for an edge. This is used for some projection operators.

Definition at line 513 of file fe_boundary.C.

References calculate_d2xyz, calculate_dxyz, calculate_xyz, d2psidxi2_map, libMesh::Elem::default_order(), determine_calculations(), dpsidxi_map, libMesh::FE< Dim, T >::n_shape_functions(), psi_map, libMesh::FE< Dim, T >::shape(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), and libMesh::Elem::type().

Referenced by compute_edge_map(), and ~FEMap().

515 {
516  // Start logging the shape function initialization
517  LOG_SCOPE("init_edge_shape_functions()", "FEMap");
518 
519  libmesh_assert(edge);
520 
521  // We're calculating now!
522  this->determine_calculations();
523 
524  // The element type and order to use in
525  // the map
526  const Order mapping_order (edge->default_order());
527  const ElemType mapping_elem_type (edge->type());
528 
529  // The number of quadrature points.
530  const unsigned int n_qp = cast_int<unsigned int>(qp.size());
531 
532  const unsigned int n_mapping_shape_functions =
533  FE<Dim,LAGRANGE>::n_shape_functions (mapping_elem_type,
534  mapping_order);
535 
536  // resize the vectors to hold current data
537  // Psi are the shape functions used for the FE mapping
538  if (calculate_xyz)
539  this->psi_map.resize (n_mapping_shape_functions);
540  if (calculate_dxyz)
541  this->dpsidxi_map.resize (n_mapping_shape_functions);
542  if (calculate_d2xyz)
543  this->d2psidxi2_map.resize (n_mapping_shape_functions);
544 
545  for (unsigned int i=0; i<n_mapping_shape_functions; i++)
546  {
547  // Allocate space to store the values of the shape functions
548  // and their first and second derivatives at the quadrature points.
549  if (calculate_xyz)
550  this->psi_map[i].resize (n_qp);
551  if (calculate_dxyz)
552  this->dpsidxi_map[i].resize (n_qp);
553  if (calculate_d2xyz)
554  this->d2psidxi2_map[i].resize (n_qp);
555 
556  // Compute the value of shape function i, and its first and
557  // second derivatives at quadrature point p
558  // (Lagrange shape functions are used for the mapping)
559  for (unsigned int p=0; p<n_qp; p++)
560  {
561  if (calculate_xyz)
562  this->psi_map[i][p] = FE<1,LAGRANGE>::shape (mapping_elem_type, mapping_order, i, qp[p]);
563  if (calculate_dxyz)
564  this->dpsidxi_map[i][p] = FE<1,LAGRANGE>::shape_deriv (mapping_elem_type, mapping_order, i, 0, qp[p]);
565  if (calculate_d2xyz)
566  this->d2psidxi2_map[i][p] = FE<1,LAGRANGE>::shape_second_deriv(mapping_elem_type, mapping_order, i, 0, qp[p]);
567  }
568  }
569 }
std::vector< std::vector< Real > > psi_map
Definition: fe_map.h:812
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
bool calculate_dxyz
Definition: fe_map.h:888
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculate_xyz
Definition: fe_map.h:883
std::vector< std::vector< Real > > d2psidxi2_map
Definition: fe_map.h:831
std::vector< std::vector< Real > > dpsidxi_map
Definition: fe_map.h:818
virtual unsigned int n_shape_functions() const libmesh_override
Definition: fe.C:36
void determine_calculations()
Definition: fe_map.h:528
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<unsigned int Dim>
void libMesh::FEMap::init_face_shape_functions ( const std::vector< Point > &  qp,
const Elem side 
)

Initializes the reference to physical element map for a side. This is used for boundary integration.

Definition at line 408 of file fe_boundary.C.

References calculate_d2xyz, calculate_dxyz, calculate_xyz, d2psideta2_map, d2psidxi2_map, d2psidxideta_map, libMesh::Elem::default_order(), determine_calculations(), dpsideta_map, dpsidxi_map, libMesh::FE< Dim, T >::n_shape_functions(), psi_map, libMesh::FE< Dim, T >::shape(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), and libMesh::Elem::type().

Referenced by compute_edge_map(), and ~FEMap().

410 {
411  // Start logging the shape function initialization
412  LOG_SCOPE("init_face_shape_functions()", "FEMap");
413 
414  libmesh_assert(side);
415 
416  // We're calculating now!
417  this->determine_calculations();
418 
419  // The element type and order to use in
420  // the map
421  const Order mapping_order (side->default_order());
422  const ElemType mapping_elem_type (side->type());
423 
424  // The number of quadrature points.
425  const unsigned int n_qp = cast_int<unsigned int>(qp.size());
426 
427  const unsigned int n_mapping_shape_functions =
428  FE<Dim,LAGRANGE>::n_shape_functions (mapping_elem_type,
429  mapping_order);
430 
431  // resize the vectors to hold current data
432  // Psi are the shape functions used for the FE mapping
433  if (calculate_xyz)
434  this->psi_map.resize (n_mapping_shape_functions);
435 
436  if (Dim > 1)
437  {
438  if (calculate_dxyz)
439  this->dpsidxi_map.resize (n_mapping_shape_functions);
440  if (calculate_d2xyz)
441  this->d2psidxi2_map.resize (n_mapping_shape_functions);
442  }
443 
444  if (Dim == 3)
445  {
446  if (calculate_dxyz)
447  this->dpsideta_map.resize (n_mapping_shape_functions);
448  if (calculate_d2xyz)
449  {
450  this->d2psidxideta_map.resize (n_mapping_shape_functions);
451  this->d2psideta2_map.resize (n_mapping_shape_functions);
452  }
453  }
454 
455  for (unsigned int i=0; i<n_mapping_shape_functions; i++)
456  {
457  // Allocate space to store the values of the shape functions
458  // and their first and second derivatives at the quadrature points.
459  if (calculate_xyz)
460  this->psi_map[i].resize (n_qp);
461  if (Dim > 1)
462  {
463  if (calculate_dxyz)
464  this->dpsidxi_map[i].resize (n_qp);
465  if (calculate_d2xyz)
466  this->d2psidxi2_map[i].resize (n_qp);
467  }
468  if (Dim == 3)
469  {
470  if (calculate_dxyz)
471  this->dpsideta_map[i].resize (n_qp);
472  if (calculate_d2xyz)
473  {
474  this->d2psidxideta_map[i].resize (n_qp);
475  this->d2psideta2_map[i].resize (n_qp);
476  }
477  }
478 
479  // Compute the value of shape function i, and its first and
480  // second derivatives at quadrature point p
481  // (Lagrange shape functions are used for the mapping)
482  for (unsigned int p=0; p<n_qp; p++)
483  {
484  if (calculate_xyz)
485  this->psi_map[i][p] = FE<Dim-1,LAGRANGE>::shape (mapping_elem_type, mapping_order, i, qp[p]);
486  if (Dim > 1)
487  {
488  if (calculate_dxyz)
489  this->dpsidxi_map[i][p] = FE<Dim-1,LAGRANGE>::shape_deriv (mapping_elem_type, mapping_order, i, 0, qp[p]);
490  if (calculate_d2xyz)
491  this->d2psidxi2_map[i][p] = FE<Dim-1,LAGRANGE>::shape_second_deriv(mapping_elem_type, mapping_order, i, 0, qp[p]);
492  }
493  // libMesh::out << "this->d2psidxi2_map["<<i<<"][p]=" << d2psidxi2_map[i][p] << std::endl;
494 
495  // If we are in 3D, then our sides are 2D faces.
496  // For the second derivatives, we must also compute the cross
497  // derivative d^2() / dxi deta
498  if (Dim == 3)
499  {
500  if (calculate_dxyz)
501  this->dpsideta_map[i][p] = FE<Dim-1,LAGRANGE>::shape_deriv (mapping_elem_type, mapping_order, i, 1, qp[p]);
502  if (calculate_d2xyz)
503  {
504  this->d2psidxideta_map[i][p] = FE<Dim-1,LAGRANGE>::shape_second_deriv(mapping_elem_type, mapping_order, i, 1, qp[p]);
505  this->d2psideta2_map[i][p] = FE<Dim-1,LAGRANGE>::shape_second_deriv(mapping_elem_type, mapping_order, i, 2, qp[p]);
506  }
507  }
508  }
509  }
510 }
std::vector< std::vector< Real > > dpsideta_map
Definition: fe_map.h:824
std::vector< std::vector< Real > > psi_map
Definition: fe_map.h:812
std::vector< std::vector< Real > > d2psideta2_map
Definition: fe_map.h:845
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
bool calculate_dxyz
Definition: fe_map.h:888
unsigned short int side
Definition: xdr_io.C:49
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
std::vector< std::vector< Real > > d2psidxideta_map
Definition: fe_map.h:838
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculate_xyz
Definition: fe_map.h:883
std::vector< std::vector< Real > > d2psidxi2_map
Definition: fe_map.h:831
std::vector< std::vector< Real > > dpsidxi_map
Definition: fe_map.h:818
virtual unsigned int n_shape_functions() const libmesh_override
Definition: fe.C:36
void determine_calculations()
Definition: fe_map.h:528
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<unsigned int Dim>
template void libMesh::FEMap::init_reference_to_physical_map< 3 > ( const std::vector< Point > &  qp,
const Elem elem 
)

Definition at line 66 of file fe_map.C.

References calculate_d2xyz, calculate_dxyz, calculate_xyz, d2phideta2_map, d2phidetadzeta_map, d2phidxi2_map, d2phidxideta_map, d2phidxidzeta_map, d2phidzeta2_map, libMesh::Elem::default_order(), determine_calculations(), dphideta_map, dphidxi_map, dphidzeta_map, libMesh::Elem::is_linear(), libMesh::FE< Dim, T >::n_shape_functions(), phi_map, libMesh::FE< Dim, T >::shape(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), and libMesh::Elem::type().

Referenced by ~FEMap().

68 {
69  // Start logging the reference->physical map initialization
70  LOG_SCOPE("init_reference_to_physical_map()", "FEMap");
71 
72  // We're calculating now!
73  this->determine_calculations();
74 
75  // The number of quadrature points.
76  const std::size_t n_qp = qp.size();
77 
78  // The element type and order to use in
79  // the map
80  const Order mapping_order (elem->default_order());
81  const ElemType mapping_elem_type (elem->type());
82 
83  // Number of shape functions used to construct the map
84  // (Lagrange shape functions are used for mapping)
85  const unsigned int n_mapping_shape_functions =
86  FE<Dim,LAGRANGE>::n_shape_functions (mapping_elem_type,
87  mapping_order);
88 
89  if (calculate_xyz)
90  this->phi_map.resize (n_mapping_shape_functions);
91  if (Dim > 0)
92  {
93  if (calculate_dxyz)
94  this->dphidxi_map.resize (n_mapping_shape_functions);
95 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
96  if (calculate_d2xyz)
97  this->d2phidxi2_map.resize (n_mapping_shape_functions);
98 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
99  }
100 
101  if (Dim > 1)
102  {
103  if (calculate_dxyz)
104  this->dphideta_map.resize (n_mapping_shape_functions);
105 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
106  if (calculate_d2xyz)
107  {
108  this->d2phidxideta_map.resize (n_mapping_shape_functions);
109  this->d2phideta2_map.resize (n_mapping_shape_functions);
110  }
111 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
112  }
113 
114  if (Dim > 2)
115  {
116  if (calculate_dxyz)
117  this->dphidzeta_map.resize (n_mapping_shape_functions);
118 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
119  if (calculate_d2xyz)
120  {
121  this->d2phidxidzeta_map.resize (n_mapping_shape_functions);
122  this->d2phidetadzeta_map.resize (n_mapping_shape_functions);
123  this->d2phidzeta2_map.resize (n_mapping_shape_functions);
124  }
125 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
126  }
127 
128 
129  for (unsigned int i=0; i<n_mapping_shape_functions; i++)
130  {
131  if (calculate_xyz)
132  this->phi_map[i].resize (n_qp);
133  if (Dim > 0)
134  {
135  if (calculate_dxyz)
136  this->dphidxi_map[i].resize (n_qp);
137 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
138  if (calculate_d2xyz)
139  {
140  this->d2phidxi2_map[i].resize (n_qp);
141  if (Dim > 1)
142  {
143  this->d2phidxideta_map[i].resize (n_qp);
144  this->d2phideta2_map[i].resize (n_qp);
145  }
146  if (Dim > 2)
147  {
148  this->d2phidxidzeta_map[i].resize (n_qp);
149  this->d2phidetadzeta_map[i].resize (n_qp);
150  this->d2phidzeta2_map[i].resize (n_qp);
151  }
152  }
153 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
154 
155  if (Dim > 1 && calculate_dxyz)
156  this->dphideta_map[i].resize (n_qp);
157 
158  if (Dim > 2 && calculate_dxyz)
159  this->dphidzeta_map[i].resize (n_qp);
160  }
161  }
162 
163  // Optimize for the *linear* geometric elements case:
164  bool is_linear = elem->is_linear();
165 
166  switch (Dim)
167  {
168 
169  //------------------------------------------------------------
170  // 0D
171  case 0:
172  {
173  if (calculate_xyz)
174  for (unsigned int i=0; i<n_mapping_shape_functions; i++)
175  for (std::size_t p=0; p<n_qp; p++)
176  this->phi_map[i][p] = FE<Dim,LAGRANGE>::shape (mapping_elem_type, mapping_order, i, qp[p]);
177 
178  break;
179  }
180 
181  //------------------------------------------------------------
182  // 1D
183  case 1:
184  {
185  // Compute the value of the mapping shape function i at quadrature point p
186  // (Lagrange shape functions are used for mapping)
187  if (is_linear)
188  {
189  for (unsigned int i=0; i<n_mapping_shape_functions; i++)
190  {
191  if (calculate_xyz)
192  this->phi_map[i][0] =
193  FE<Dim,LAGRANGE>::shape(mapping_elem_type,
194  mapping_order,
195  i,
196  qp[0]);
197 
198  if (calculate_dxyz)
199  this->dphidxi_map[i][0] =
200  FE<Dim,LAGRANGE>::shape_deriv(mapping_elem_type,
201  mapping_order,
202  i,
203  0,
204  qp[0]);
205 
206 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
207  if (calculate_d2xyz)
208  this->d2phidxi2_map[i][0] =
209  FE<Dim,LAGRANGE>::shape_second_deriv(mapping_elem_type,
210  mapping_order,
211  i,
212  0,
213  qp[0]);
214 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
215  for (std::size_t p=1; p<n_qp; p++)
216  {
217  if (calculate_xyz)
218  this->phi_map[i][p] = FE<Dim,LAGRANGE>::shape (mapping_elem_type, mapping_order, i, qp[p]);
219  if (calculate_dxyz)
220  this->dphidxi_map[i][p] = this->dphidxi_map[i][0];
221 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
222  if (calculate_d2xyz)
223  this->d2phidxi2_map[i][p] = this->d2phidxi2_map[i][0];
224 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
225  }
226  }
227  }
228  else
229  for (unsigned int i=0; i<n_mapping_shape_functions; i++)
230  for (std::size_t p=0; p<n_qp; p++)
231  {
232  if (calculate_xyz)
233  this->phi_map[i][p] = FE<Dim,LAGRANGE>::shape (mapping_elem_type, mapping_order, i, qp[p]);
234  if (calculate_dxyz)
235  this->dphidxi_map[i][p] = FE<Dim,LAGRANGE>::shape_deriv (mapping_elem_type, mapping_order, i, 0, qp[p]);
236 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
237  if (calculate_d2xyz)
238  this->d2phidxi2_map[i][p] = FE<Dim,LAGRANGE>::shape_second_deriv (mapping_elem_type, mapping_order, i, 0, qp[p]);
239 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
240  }
241 
242  break;
243  }
244  //------------------------------------------------------------
245  // 2D
246  case 2:
247  {
248  // Compute the value of the mapping shape function i at quadrature point p
249  // (Lagrange shape functions are used for mapping)
250  if (is_linear)
251  {
252  for (unsigned int i=0; i<n_mapping_shape_functions; i++)
253  {
254  if (calculate_xyz)
255  this->phi_map[i][0] = FE<Dim,LAGRANGE>::shape (mapping_elem_type, mapping_order, i, qp[0]);
256  if (calculate_dxyz)
257  {
258  this->dphidxi_map[i][0] = FE<Dim,LAGRANGE>::shape_deriv (mapping_elem_type, mapping_order, i, 0, qp[0]);
259  this->dphideta_map[i][0] = FE<Dim,LAGRANGE>::shape_deriv (mapping_elem_type, mapping_order, i, 1, qp[0]);
260  }
261 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
262  if (calculate_d2xyz)
263  {
264  this->d2phidxi2_map[i][0] = FE<Dim,LAGRANGE>::shape_second_deriv (mapping_elem_type, mapping_order, i, 0, qp[0]);
265  this->d2phidxideta_map[i][0] = FE<Dim,LAGRANGE>::shape_second_deriv (mapping_elem_type, mapping_order, i, 1, qp[0]);
266  this->d2phideta2_map[i][0] = FE<Dim,LAGRANGE>::shape_second_deriv (mapping_elem_type, mapping_order, i, 2, qp[0]);
267  }
268 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
269  for (std::size_t p=1; p<n_qp; p++)
270  {
271  if (calculate_xyz)
272  this->phi_map[i][p] = FE<Dim,LAGRANGE>::shape (mapping_elem_type, mapping_order, i, qp[p]);
273  if (calculate_dxyz)
274  {
275  this->dphidxi_map[i][p] = this->dphidxi_map[i][0];
276  this->dphideta_map[i][p] = this->dphideta_map[i][0];
277  }
278 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
279  if (calculate_d2xyz)
280  {
281  this->d2phidxi2_map[i][p] = this->d2phidxi2_map[i][0];
282  this->d2phidxideta_map[i][p] = this->d2phidxideta_map[i][0];
283  this->d2phideta2_map[i][p] = this->d2phideta2_map[i][0];
284  }
285 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
286  }
287  }
288  }
289  else
290  for (unsigned int i=0; i<n_mapping_shape_functions; i++)
291  for (std::size_t p=0; p<n_qp; p++)
292  {
293  if (calculate_xyz)
294  this->phi_map[i][p] = FE<Dim,LAGRANGE>::shape (mapping_elem_type, mapping_order, i, qp[p]);
295  if (calculate_dxyz)
296  {
297  this->dphidxi_map[i][p] = FE<Dim,LAGRANGE>::shape_deriv (mapping_elem_type, mapping_order, i, 0, qp[p]);
298  this->dphideta_map[i][p] = FE<Dim,LAGRANGE>::shape_deriv (mapping_elem_type, mapping_order, i, 1, qp[p]);
299  }
300 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
301  if (calculate_d2xyz)
302  {
303  this->d2phidxi2_map[i][p] = FE<Dim,LAGRANGE>::shape_second_deriv (mapping_elem_type, mapping_order, i, 0, qp[p]);
304  this->d2phidxideta_map[i][p] = FE<Dim,LAGRANGE>::shape_second_deriv (mapping_elem_type, mapping_order, i, 1, qp[p]);
305  this->d2phideta2_map[i][p] = FE<Dim,LAGRANGE>::shape_second_deriv (mapping_elem_type, mapping_order, i, 2, qp[p]);
306  }
307 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
308  }
309 
310  break;
311  }
312 
313  //------------------------------------------------------------
314  // 3D
315  case 3:
316  {
317  // Compute the value of the mapping shape function i at quadrature point p
318  // (Lagrange shape functions are used for mapping)
319  if (is_linear)
320  {
321  for (unsigned int i=0; i<n_mapping_shape_functions; i++)
322  {
323  if (calculate_xyz)
324  this->phi_map[i][0] = FE<Dim,LAGRANGE>::shape (mapping_elem_type, mapping_order, i, qp[0]);
325  if (calculate_dxyz)
326  {
327  this->dphidxi_map[i][0] = FE<Dim,LAGRANGE>::shape_deriv (mapping_elem_type, mapping_order, i, 0, qp[0]);
328  this->dphideta_map[i][0] = FE<Dim,LAGRANGE>::shape_deriv (mapping_elem_type, mapping_order, i, 1, qp[0]);
329  this->dphidzeta_map[i][0] = FE<Dim,LAGRANGE>::shape_deriv (mapping_elem_type, mapping_order, i, 2, qp[0]);
330  }
331 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
332  if (calculate_d2xyz)
333  {
334  this->d2phidxi2_map[i][0] = FE<Dim,LAGRANGE>::shape_second_deriv (mapping_elem_type, mapping_order, i, 0, qp[0]);
335  this->d2phidxideta_map[i][0] = FE<Dim,LAGRANGE>::shape_second_deriv (mapping_elem_type, mapping_order, i, 1, qp[0]);
336  this->d2phideta2_map[i][0] = FE<Dim,LAGRANGE>::shape_second_deriv (mapping_elem_type, mapping_order, i, 2, qp[0]);
337  this->d2phidxidzeta_map[i][0] = FE<Dim,LAGRANGE>::shape_second_deriv (mapping_elem_type, mapping_order, i, 3, qp[0]);
338  this->d2phidetadzeta_map[i][0] = FE<Dim,LAGRANGE>::shape_second_deriv (mapping_elem_type, mapping_order, i, 4, qp[0]);
339  this->d2phidzeta2_map[i][0] = FE<Dim,LAGRANGE>::shape_second_deriv (mapping_elem_type, mapping_order, i, 5, qp[0]);
340  }
341 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
342  for (std::size_t p=1; p<n_qp; p++)
343  {
344  if (calculate_xyz)
345  this->phi_map[i][p] = FE<Dim,LAGRANGE>::shape (mapping_elem_type, mapping_order, i, qp[p]);
346  if (calculate_dxyz)
347  {
348  this->dphidxi_map[i][p] = this->dphidxi_map[i][0];
349  this->dphideta_map[i][p] = this->dphideta_map[i][0];
350  this->dphidzeta_map[i][p] = this->dphidzeta_map[i][0];
351  }
352 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
353  if (calculate_d2xyz)
354  {
355  this->d2phidxi2_map[i][p] = this->d2phidxi2_map[i][0];
356  this->d2phidxideta_map[i][p] = this->d2phidxideta_map[i][0];
357  this->d2phideta2_map[i][p] = this->d2phideta2_map[i][0];
358  this->d2phidxidzeta_map[i][p] = this->d2phidxidzeta_map[i][0];
359  this->d2phidetadzeta_map[i][p] = this->d2phidetadzeta_map[i][0];
360  this->d2phidzeta2_map[i][p] = this->d2phidzeta2_map[i][0];
361  }
362 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
363  }
364  }
365  }
366  else
367  for (unsigned int i=0; i<n_mapping_shape_functions; i++)
368  for (std::size_t p=0; p<n_qp; p++)
369  {
370  if (calculate_xyz)
371  this->phi_map[i][p] = FE<Dim,LAGRANGE>::shape (mapping_elem_type, mapping_order, i, qp[p]);
372  if (calculate_dxyz)
373  {
374  this->dphidxi_map[i][p] = FE<Dim,LAGRANGE>::shape_deriv (mapping_elem_type, mapping_order, i, 0, qp[p]);
375  this->dphideta_map[i][p] = FE<Dim,LAGRANGE>::shape_deriv (mapping_elem_type, mapping_order, i, 1, qp[p]);
376  this->dphidzeta_map[i][p] = FE<Dim,LAGRANGE>::shape_deriv (mapping_elem_type, mapping_order, i, 2, qp[p]);
377  }
378 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
379  if (calculate_d2xyz)
380  {
381  this->d2phidxi2_map[i][p] = FE<Dim,LAGRANGE>::shape_second_deriv (mapping_elem_type, mapping_order, i, 0, qp[p]);
382  this->d2phidxideta_map[i][p] = FE<Dim,LAGRANGE>::shape_second_deriv (mapping_elem_type, mapping_order, i, 1, qp[p]);
383  this->d2phideta2_map[i][p] = FE<Dim,LAGRANGE>::shape_second_deriv (mapping_elem_type, mapping_order, i, 2, qp[p]);
384  this->d2phidxidzeta_map[i][p] = FE<Dim,LAGRANGE>::shape_second_deriv (mapping_elem_type, mapping_order, i, 3, qp[p]);
385  this->d2phidetadzeta_map[i][p] = FE<Dim,LAGRANGE>::shape_second_deriv (mapping_elem_type, mapping_order, i, 4, qp[p]);
386  this->d2phidzeta2_map[i][p] = FE<Dim,LAGRANGE>::shape_second_deriv (mapping_elem_type, mapping_order, i, 5, qp[p]);
387  }
388 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
389  }
390 
391  break;
392  }
393 
394  default:
395  libmesh_error_msg("Invalid Dim = " << Dim);
396  }
397 }
std::vector< std::vector< Real > > dphidzeta_map
Definition: fe_map.h:773
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
std::vector< std::vector< Real > > dphidxi_map
Definition: fe_map.h:763
bool calculate_dxyz
Definition: fe_map.h:888
std::vector< std::vector< Real > > d2phideta2_map
Definition: fe_map.h:795
std::vector< std::vector< Real > > d2phidxidzeta_map
Definition: fe_map.h:790
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
std::vector< std::vector< Real > > phi_map
Definition: fe_map.h:758
std::vector< std::vector< Real > > d2phidetadzeta_map
Definition: fe_map.h:800
bool calculate_d2xyz
Definition: fe_map.h:893
bool calculate_xyz
Definition: fe_map.h:883
std::vector< std::vector< Real > > d2phidxideta_map
Definition: fe_map.h:785
virtual unsigned int n_shape_functions() const libmesh_override
Definition: fe.C:36
void determine_calculations()
Definition: fe_map.h:528
std::vector< std::vector< Real > > d2phidzeta2_map
Definition: fe_map.h:805
std::vector< std::vector< Real > > d2phidxi2_map
Definition: fe_map.h:780
std::vector< std::vector< Real > > dphideta_map
Definition: fe_map.h:768
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
void libMesh::FEMap::print_JxW ( std::ostream &  os) const

Prints the Jacobian times the weight for each quadrature point.

Definition at line 1428 of file fe_map.C.

References JxW.

Referenced by get_curvatures().

1429 {
1430  for (std::size_t i=0; i<JxW.size(); ++i)
1431  os << " [" << i << "]: " << JxW[i] << std::endl;
1432 }
std::vector< Real > JxW
Definition: fe_map.h:872
void libMesh::FEMap::print_xyz ( std::ostream &  os) const

Prints the spatial location of each quadrature point (on the physical element).

Definition at line 1436 of file fe_map.C.

References xyz.

Referenced by get_curvatures().

1437 {
1438  for (std::size_t i=0; i<xyz.size(); ++i)
1439  os << " [" << i << "]: " << xyz[i];
1440 }
std::vector< Point > xyz
Definition: fe_map.h:619
void libMesh::FEMap::resize_quadrature_map_vectors ( const unsigned int  dim,
unsigned int  n_qp 
)
protected

A utility function for use by compute_*_map

Definition at line 1140 of file fe_map.C.

References calculate_d2xyz, calculate_dxyz, calculate_xyz, d2etadxyz2_map, d2xidxyz2_map, d2xyzdeta2_map, d2xyzdetadzeta_map, d2xyzdxi2_map, d2xyzdxideta_map, d2xyzdxidzeta_map, d2xyzdzeta2_map, d2zetadxyz2_map, detadx_map, detady_map, detadz_map, determine_calculations(), dxidx_map, dxidy_map, dxidz_map, dxyzdeta_map, dxyzdxi_map, dxyzdzeta_map, dzetadx_map, dzetady_map, dzetadz_map, jac, JxW, and xyz.

Referenced by compute_affine_map(), compute_map(), compute_null_map(), and determine_calculations().

1141 {
1142  // We're calculating now!
1143  this->determine_calculations();
1144 
1145  // Resize the vectors to hold data at the quadrature points
1146  if (calculate_xyz)
1147  xyz.resize(n_qp);
1148  if (calculate_dxyz)
1149  {
1150  dxyzdxi_map.resize(n_qp);
1151  dxidx_map.resize(n_qp);
1152  dxidy_map.resize(n_qp); // 1D element may live in 2D ...
1153  dxidz_map.resize(n_qp); // ... or 3D
1154  }
1155 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
1156  if (calculate_d2xyz)
1157  {
1158  d2xyzdxi2_map.resize(n_qp);
1159 
1160  // Inverse map second derivatives
1161  d2xidxyz2_map.resize(n_qp);
1162  for (std::size_t i=0; i<d2xidxyz2_map.size(); ++i)
1163  d2xidxyz2_map[i].assign(6, 0.);
1164  }
1165 #endif
1166  if (dim > 1)
1167  {
1168  if (calculate_dxyz)
1169  {
1170  dxyzdeta_map.resize(n_qp);
1171  detadx_map.resize(n_qp);
1172  detady_map.resize(n_qp);
1173  detadz_map.resize(n_qp);
1174  }
1175 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
1176  if (calculate_d2xyz)
1177  {
1178  d2xyzdxideta_map.resize(n_qp);
1179  d2xyzdeta2_map.resize(n_qp);
1180 
1181  // Inverse map second derivatives
1182  d2etadxyz2_map.resize(n_qp);
1183  for (std::size_t i=0; i<d2etadxyz2_map.size(); ++i)
1184  d2etadxyz2_map[i].assign(6, 0.);
1185  }
1186 #endif
1187  if (dim > 2)
1188  {
1189  if (calculate_dxyz)
1190  {
1191  dxyzdzeta_map.resize (n_qp);
1192  dzetadx_map.resize (n_qp);
1193  dzetady_map.resize (n_qp);
1194  dzetadz_map.resize (n_qp);
1195  }
1196 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
1197  if (calculate_d2xyz)
1198  {
1199  d2xyzdxidzeta_map.resize(n_qp);
1200  d2xyzdetadzeta_map.resize(n_qp);
1201  d2xyzdzeta2_map.resize(n_qp);
1202 
1203  // Inverse map second derivatives
1204  d2zetadxyz2_map.resize(n_qp);
1205  for (std::size_t i=0; i<d2zetadxyz2_map.size(); ++i)
1206  d2zetadxyz2_map[i].assign(6, 0.);
1207  }
1208 #endif
1209  }
1210  }
1211 
1212  if (calculate_dxyz)
1213  {
1214  jac.resize(n_qp);
1215  JxW.resize(n_qp);
1216  }
1217 }
std::vector< std::vector< Real > > d2etadxyz2_map
Definition: fe_map.h:746
bool calculate_dxyz
Definition: fe_map.h:888
std::vector< RealGradient > d2xyzdzeta2_map
Definition: fe_map.h:675
std::vector< Real > dzetady_map
Definition: fe_map.h:727
std::vector< std::vector< Real > > d2xidxyz2_map
Definition: fe_map.h:740
std::vector< Real > dxidz_map
Definition: fe_map.h:695
std::vector< RealGradient > d2xyzdxideta_map
Definition: fe_map.h:649
std::vector< RealGradient > dxyzdzeta_map
Definition: fe_map.h:637
std::vector< Real > dzetadx_map
Definition: fe_map.h:721
std::vector< RealGradient > dxyzdxi_map
Definition: fe_map.h:625
std::vector< RealGradient > d2xyzdeta2_map
Definition: fe_map.h:655
std::vector< RealGradient > d2xyzdxi2_map
Definition: fe_map.h:643
std::vector< Real > dzetadz_map
Definition: fe_map.h:733
bool calculate_d2xyz
Definition: fe_map.h:893
std::vector< std::vector< Real > > d2zetadxyz2_map
Definition: fe_map.h:752
std::vector< RealGradient > d2xyzdetadzeta_map
Definition: fe_map.h:669
std::vector< Real > dxidx_map
Definition: fe_map.h:683
bool calculate_xyz
Definition: fe_map.h:883
std::vector< Real > dxidy_map
Definition: fe_map.h:689
std::vector< Real > JxW
Definition: fe_map.h:872
std::vector< Point > xyz
Definition: fe_map.h:619
std::vector< Real > detady_map
Definition: fe_map.h:708
std::vector< RealGradient > dxyzdeta_map
Definition: fe_map.h:631
void determine_calculations()
Definition: fe_map.h:528
std::vector< Real > jac
Definition: fe_map.h:867
std::vector< Real > detadz_map
Definition: fe_map.h:714
std::vector< Real > detadx_map
Definition: fe_map.h:702
std::vector< RealGradient > d2xyzdxidzeta_map
Definition: fe_map.h:663

Friends And Related Function Documentation

template<unsigned int Dim, FEFamily T>
friend class FE
friend

FE classes should be able to reset calculations_started in a few special cases.

Definition at line 900 of file fe_map.h.

Member Data Documentation

std::vector<Real> libMesh::FEMap::curvatures
protected

The mean curvature (= one half the sum of the principal curvatures) on the boundary at the quadrature points. The mean curvature is a scalar value.

Definition at line 862 of file fe_map.h.

Referenced by compute_edge_map(), libMesh::FEXYZMap::compute_face_map(), compute_face_map(), and get_curvatures().

std::vector<std::vector<Real> > libMesh::FEMap::d2etadxyz2_map
protected

Second derivatives of "eta" reference coordinate wrt physical coordinates. At each qp: (eta_{xx}, eta_{xy}, eta_{xz}, eta_{yy}, eta_{yz}, eta_{zz})

Definition at line 746 of file fe_map.h.

Referenced by compute_inverse_map_second_derivs(), compute_single_point_map(), get_d2etadxyz2(), and resize_quadrature_map_vectors().

std::vector<std::vector<Real> > libMesh::FEMap::d2phideta2_map
protected

Map for the second derivative, d^2(phi)/d(eta)^2.

Definition at line 795 of file fe_map.h.

Referenced by compute_single_point_map(), get_d2phideta2_map(), and init_reference_to_physical_map().

std::vector<std::vector<Real> > libMesh::FEMap::d2phidetadzeta_map
protected

Map for the second derivative, d^2(phi)/d(eta)d(zeta).

Definition at line 800 of file fe_map.h.

Referenced by compute_single_point_map(), get_d2phidetadzeta_map(), and init_reference_to_physical_map().

std::vector<std::vector<Real> > libMesh::FEMap::d2phidxi2_map
protected

Map for the second derivative, d^2(phi)/d(xi)^2.

Definition at line 780 of file fe_map.h.

Referenced by compute_single_point_map(), get_d2phidxi2_map(), and init_reference_to_physical_map().

std::vector<std::vector<Real> > libMesh::FEMap::d2phidxideta_map
protected

Map for the second derivative, d^2(phi)/d(xi)d(eta).

Definition at line 785 of file fe_map.h.

Referenced by compute_single_point_map(), get_d2phidxideta_map(), and init_reference_to_physical_map().

std::vector<std::vector<Real> > libMesh::FEMap::d2phidxidzeta_map
protected

Map for the second derivative, d^2(phi)/d(xi)d(zeta).

Definition at line 790 of file fe_map.h.

Referenced by compute_single_point_map(), get_d2phidxidzeta_map(), and init_reference_to_physical_map().

std::vector<std::vector<Real> > libMesh::FEMap::d2phidzeta2_map
protected

Map for the second derivative, d^2(phi)/d(zeta)^2.

Definition at line 805 of file fe_map.h.

Referenced by compute_single_point_map(), get_d2phidzeta2_map(), and init_reference_to_physical_map().

std::vector<std::vector<Real> > libMesh::FEMap::d2psideta2_map
protected

Map for the second derivatives (in eta) of the side shape functions. Useful for computing the curvature at the quadrature points.

Definition at line 845 of file fe_map.h.

Referenced by libMesh::FEXYZMap::compute_face_map(), compute_face_map(), get_d2psideta2(), and init_face_shape_functions().

std::vector<std::vector<Real> > libMesh::FEMap::d2psidxi2_map
protected

Map for the second derivatives (in xi) of the side shape functions. Useful for computing the curvature at the quadrature points.

Definition at line 831 of file fe_map.h.

Referenced by compute_edge_map(), libMesh::FEXYZMap::compute_face_map(), compute_face_map(), get_d2psidxi2(), init_edge_shape_functions(), and init_face_shape_functions().

std::vector<std::vector<Real> > libMesh::FEMap::d2psidxideta_map
protected

Map for the second (cross) derivatives in xi, eta of the side shape functions. Useful for computing the curvature at the quadrature points.

Definition at line 838 of file fe_map.h.

Referenced by libMesh::FEXYZMap::compute_face_map(), compute_face_map(), get_d2psidxideta(), and init_face_shape_functions().

std::vector<std::vector<Real> > libMesh::FEMap::d2xidxyz2_map
protected

Second derivatives of "xi" reference coordinate wrt physical coordinates. At each qp: (xi_{xx}, xi_{xy}, xi_{xz}, xi_{yy}, xi_{yz}, xi_{zz})

Definition at line 740 of file fe_map.h.

Referenced by compute_inverse_map_second_derivs(), compute_single_point_map(), get_d2xidxyz2(), and resize_quadrature_map_vectors().

std::vector<RealGradient> libMesh::FEMap::d2xyzdeta2_map
protected
std::vector<RealGradient> libMesh::FEMap::d2xyzdetadzeta_map
protected

Vector of mixed second partial derivatives in eta-zeta: d^2(x)/d(eta)d(zeta) d^2(y)/d(eta)d(zeta) d^2(z)/d(eta)d(zeta)

Definition at line 669 of file fe_map.h.

Referenced by compute_affine_map(), compute_inverse_map_second_derivs(), compute_null_map(), compute_single_point_map(), get_d2xyzdetadzeta(), and resize_quadrature_map_vectors().

std::vector<RealGradient> libMesh::FEMap::d2xyzdxi2_map
protected

Vector of second partial derivatives in xi: d^2(x)/d(xi)^2, d^2(y)/d(xi)^2, d^2(z)/d(xi)^2

Definition at line 643 of file fe_map.h.

Referenced by compute_affine_map(), compute_edge_map(), libMesh::FEXYZMap::compute_face_map(), compute_face_map(), compute_inverse_map_second_derivs(), compute_null_map(), compute_single_point_map(), get_d2xyzdxi2(), and resize_quadrature_map_vectors().

std::vector<RealGradient> libMesh::FEMap::d2xyzdxideta_map
protected

Vector of mixed second partial derivatives in xi-eta: d^2(x)/d(xi)d(eta) d^2(y)/d(xi)d(eta) d^2(z)/d(xi)d(eta)

Definition at line 649 of file fe_map.h.

Referenced by compute_affine_map(), compute_edge_map(), libMesh::FEXYZMap::compute_face_map(), compute_face_map(), compute_inverse_map_second_derivs(), compute_null_map(), compute_single_point_map(), get_d2xyzdxideta(), and resize_quadrature_map_vectors().

std::vector<RealGradient> libMesh::FEMap::d2xyzdxidzeta_map
protected

Vector of second partial derivatives in xi-zeta: d^2(x)/d(xi)d(zeta), d^2(y)/d(xi)d(zeta), d^2(z)/d(xi)d(zeta)

Definition at line 663 of file fe_map.h.

Referenced by compute_affine_map(), compute_inverse_map_second_derivs(), compute_null_map(), compute_single_point_map(), get_d2xyzdxidzeta(), and resize_quadrature_map_vectors().

std::vector<RealGradient> libMesh::FEMap::d2xyzdzeta2_map
protected

Vector of second partial derivatives in zeta: d^2(x)/d(zeta)^2

Definition at line 675 of file fe_map.h.

Referenced by compute_affine_map(), compute_inverse_map_second_derivs(), compute_null_map(), compute_single_point_map(), get_d2xyzdzeta2(), and resize_quadrature_map_vectors().

std::vector<std::vector<Real> > libMesh::FEMap::d2zetadxyz2_map
protected

Second derivatives of "zeta" reference coordinate wrt physical coordinates. At each qp: (zeta_{xx}, zeta_{xy}, zeta_{xz}, zeta_{yy}, zeta_{yz}, zeta_{zz})

Definition at line 752 of file fe_map.h.

Referenced by compute_inverse_map_second_derivs(), compute_single_point_map(), get_d2zetadxyz2(), and resize_quadrature_map_vectors().

std::vector<Real> libMesh::FEMap::detadx_map
protected

Map for partial derivatives: d(eta)/d(x). Needed for the Jacobian.

Definition at line 702 of file fe_map.h.

Referenced by compute_affine_map(), compute_inverse_map_second_derivs(), compute_null_map(), compute_single_point_map(), get_detadx(), and resize_quadrature_map_vectors().

std::vector<Real> libMesh::FEMap::detady_map
protected

Map for partial derivatives: d(eta)/d(y). Needed for the Jacobian.

Definition at line 708 of file fe_map.h.

Referenced by compute_affine_map(), compute_inverse_map_second_derivs(), compute_null_map(), compute_single_point_map(), get_detady(), and resize_quadrature_map_vectors().

std::vector<Real> libMesh::FEMap::detadz_map
protected

Map for partial derivatives: d(eta)/d(z). Needed for the Jacobian.

Definition at line 714 of file fe_map.h.

Referenced by compute_affine_map(), compute_inverse_map_second_derivs(), compute_null_map(), compute_single_point_map(), get_detadz(), and resize_quadrature_map_vectors().

std::vector<std::vector<Real> > libMesh::FEMap::dphideta_map
protected

Map for the derivative, d(phi)/d(eta).

Definition at line 768 of file fe_map.h.

Referenced by compute_single_point_map(), get_dphideta_map(), and init_reference_to_physical_map().

std::vector<std::vector<Real> > libMesh::FEMap::dphidxi_map
protected

Map for the derivative, d(phi)/d(xi).

Definition at line 763 of file fe_map.h.

Referenced by compute_single_point_map(), get_dphidxi_map(), and init_reference_to_physical_map().

std::vector<std::vector<Real> > libMesh::FEMap::dphidzeta_map
protected

Map for the derivative, d(phi)/d(zeta).

Definition at line 773 of file fe_map.h.

Referenced by compute_single_point_map(), get_dphidzeta_map(), and init_reference_to_physical_map().

std::vector<std::vector<Real> > libMesh::FEMap::dpsideta_map
protected

Map for the derivative of the side function, d(psi)/d(eta).

Definition at line 824 of file fe_map.h.

Referenced by libMesh::FEXYZMap::compute_face_map(), compute_face_map(), get_dpsideta(), and init_face_shape_functions().

std::vector<std::vector<Real> > libMesh::FEMap::dpsidxi_map
protected

Map for the derivative of the side functions, d(psi)/d(xi).

Definition at line 818 of file fe_map.h.

Referenced by compute_edge_map(), libMesh::FEXYZMap::compute_face_map(), compute_face_map(), get_dpsidxi(), init_edge_shape_functions(), and init_face_shape_functions().

std::vector<Real> libMesh::FEMap::dxidx_map
protected

Map for partial derivatives: d(xi)/d(x). Needed for the Jacobian.

Definition at line 683 of file fe_map.h.

Referenced by compute_affine_map(), compute_inverse_map_second_derivs(), compute_null_map(), compute_single_point_map(), get_dxidx(), and resize_quadrature_map_vectors().

std::vector<Real> libMesh::FEMap::dxidy_map
protected

Map for partial derivatives: d(xi)/d(y). Needed for the Jacobian.

Definition at line 689 of file fe_map.h.

Referenced by compute_affine_map(), compute_inverse_map_second_derivs(), compute_null_map(), compute_single_point_map(), get_dxidy(), and resize_quadrature_map_vectors().

std::vector<Real> libMesh::FEMap::dxidz_map
protected

Map for partial derivatives: d(xi)/d(z). Needed for the Jacobian.

Definition at line 695 of file fe_map.h.

Referenced by compute_affine_map(), compute_inverse_map_second_derivs(), compute_null_map(), compute_single_point_map(), get_dxidz(), and resize_quadrature_map_vectors().

std::vector<RealGradient> libMesh::FEMap::dxyzdeta_map
protected
std::vector<RealGradient> libMesh::FEMap::dxyzdxi_map
protected
std::vector<RealGradient> libMesh::FEMap::dxyzdzeta_map
protected

Vector of partial derivatives: d(x)/d(zeta), d(y)/d(zeta), d(z)/d(zeta)

Definition at line 637 of file fe_map.h.

Referenced by compute_affine_map(), compute_null_map(), compute_single_point_map(), dxdzeta_map(), dydzeta_map(), dzdzeta_map(), get_dxyzdzeta(), and resize_quadrature_map_vectors().

std::vector<Real> libMesh::FEMap::dzetadx_map
protected

Map for partial derivatives: d(zeta)/d(x). Needed for the Jacobian.

Definition at line 721 of file fe_map.h.

Referenced by compute_affine_map(), compute_inverse_map_second_derivs(), compute_null_map(), compute_single_point_map(), get_dzetadx(), and resize_quadrature_map_vectors().

std::vector<Real> libMesh::FEMap::dzetady_map
protected

Map for partial derivatives: d(zeta)/d(y). Needed for the Jacobian.

Definition at line 727 of file fe_map.h.

Referenced by compute_affine_map(), compute_inverse_map_second_derivs(), compute_null_map(), compute_single_point_map(), get_dzetady(), and resize_quadrature_map_vectors().

std::vector<Real> libMesh::FEMap::dzetadz_map
protected

Map for partial derivatives: d(zeta)/d(z). Needed for the Jacobian.

Definition at line 733 of file fe_map.h.

Referenced by compute_affine_map(), compute_inverse_map_second_derivs(), compute_null_map(), compute_single_point_map(), get_dzetadz(), and resize_quadrature_map_vectors().

std::vector<const Node *> libMesh::FEMap::elem_nodes
private

Work vector for compute_affine_map()

Definition at line 912 of file fe_map.h.

Referenced by compute_affine_map(), compute_map(), and ~FEMap().

std::vector<Real> libMesh::FEMap::jac
protected

Jacobian values at quadrature points

Definition at line 867 of file fe_map.h.

Referenced by compute_affine_map(), compute_null_map(), compute_single_point_map(), get_jacobian(), and resize_quadrature_map_vectors().

std::vector<Real> libMesh::FEMap::JxW
protected
std::vector<Point> libMesh::FEMap::normals
protected

Normal vectors on boundary at quadrature points

Definition at line 855 of file fe_map.h.

Referenced by compute_edge_map(), libMesh::FEXYZMap::compute_face_map(), compute_face_map(), and get_normals().

std::vector<std::vector<Real> > libMesh::FEMap::phi_map
protected

Map for the shape function phi.

Definition at line 758 of file fe_map.h.

Referenced by compute_affine_map(), compute_single_point_map(), get_phi_map(), and init_reference_to_physical_map().

std::vector<std::vector<Real> > libMesh::FEMap::psi_map
protected

Map for the side shape functions, psi.

Definition at line 812 of file fe_map.h.

Referenced by compute_edge_map(), libMesh::FEXYZMap::compute_face_map(), compute_face_map(), get_psi(), init_edge_shape_functions(), and init_face_shape_functions().

std::vector<std::vector<Point> > libMesh::FEMap::tangents
protected

Tangent vectors on boundary at quadrature points.

Definition at line 850 of file fe_map.h.

Referenced by compute_edge_map(), libMesh::FEXYZMap::compute_face_map(), compute_face_map(), and get_tangents().

std::vector<Point> libMesh::FEMap::xyz
protected

The documentation for this class was generated from the following files: