v0.14.0
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
MoFEM::Tools Struct Reference

Auxiliary tools. More...

#include <src/interfaces/Tools.hpp>

Inheritance diagram for MoFEM::Tools:
[legend]
Collaboration diagram for MoFEM::Tools:
[legend]

Public Member Functions

MoFEMErrorCode query_interface (boost::typeindex::type_index type_index, UnknownInterface **iface) const
 
 Tools (const MoFEM::Core &core)
 
- Public Member Functions inherited from MoFEM::UnknownInterface
template<class IFACE >
MoFEMErrorCode registerInterface (bool error_if_registration_failed=true)
 Register interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE *&iface) const
 Get interface reference to pointer of interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE **const iface) const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get reference to interface. More...
 
template<class IFACE >
IFACE * getInterface () const
 Function returning pointer to interface. More...
 
virtual ~UnknownInterface ()=default
 

Static Public Member Functions

static MoFEMErrorCode outerProductOfEdgeIntegrationPtsForQuad (MatrixDouble &pts, const int edge0, const int edge1)
 
static MoFEMErrorCode outerProductOfEdgeIntegrationPtsForHex (MatrixDouble &pts, const int edge0, const int edge1, const int edge2)
 
- Static Public Member Functions inherited from MoFEM::UnknownInterface
static MoFEMErrorCode getLibVersion (Version &version)
 Get library version. More...
 
static MoFEMErrorCode getFileVersion (moab::Interface &moab, Version &version)
 Get database major version. More...
 
static MoFEMErrorCode setFileVersion (moab::Interface &moab, Version version=Version(MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD))
 Get database major version. More...
 
static MoFEMErrorCode getInterfaceVersion (Version &version)
 Get database major version. More...
 

Public Attributes

MoFEM::CorecOre
 

Computational

enum  SEGMENT_MIN_DISTANCE {
  SOLUTION_EXIST, SEGMENT_ONE_IS_POINT, SEGMENT_TWO_IS_POINT, SEGMENT_TWO_AND_TWO_ARE_POINT,
  NO_SOLUTION
}
 
static constexpr double shapeFunMBEDGE0At00 = N_MBEDGE0(0)
 
static constexpr double shapeFunMBEDGE1At00 = N_MBEDGE1(0)
 
static constexpr std::array< double, 2 > shapeFunMBEDGEAt00
 Array of shape function at zero local point on reference element. More...
 
static constexpr double diffN_MBEDGE0x = diffN_MBEDGE0
 
static constexpr double diffN_MBEDGE1x = diffN_MBEDGE1
 
static constexpr std::array< double, 2 > diffShapeFunMBEDGE
 
static constexpr double diffShapeFunMBTRI0x
 derivative of triangle shape function More...
 
static constexpr double diffShapeFunMBTRI0y
 derivative of triangle shape function More...
 
static constexpr double diffShapeFunMBTRI1x
 derivative of triangle shape function More...
 
static constexpr double diffShapeFunMBTRI1y
 derivative of triangle shape function More...
 
static constexpr double diffShapeFunMBTRI2x
 derivative of triangle shape function More...
 
static constexpr double diffShapeFunMBTRI2y
 derivative of triangle shape function More...
 
static constexpr std::array< double, 6 > diffShapeFunMBTRI
 
static constexpr double shapeFunMBTRI0At00 = N_MBTRI0(0, 0)
 
static constexpr double shapeFunMBTRI1At00 = N_MBTRI1(0, 0)
 
static constexpr double shapeFunMBTRI2At00 = N_MBTRI2(0, 0)
 
static constexpr std::array< double, 3 > shapeFunMBTRIAt00
 Array of shape function at zero local point on reference element. More...
 
static constexpr double diffShapeFunMBQUADAtCenter0x
 derivative of quad shape function More...
 
static constexpr double diffShapeFunMBQUADAtCenter0y
 derivative of quad shape function More...
 
static constexpr double diffShapeFunMBQUADAtCenter1x
 derivative of quad shape function More...
 
static constexpr double diffShapeFunMBQUADAtCenter1y
 derivative of quad shape function More...
 
static constexpr double diffShapeFunMBQUADAtCenter2x
 derivative of quad shape function More...
 
static constexpr double diffShapeFunMBQUADAtCenter2y
 derivative of quad shape function More...
 
static constexpr double diffShapeFunMBQUADAtCenter3x
 derivative of quad shape function More...
 
static constexpr double diffShapeFunMBQUADAtCenter3y
 derivative of quad shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter0x
 derivative of HEX shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter0y
 derivative of HEX shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter0z
 derivative of HEX shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter1x
 derivative of HEX shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter1y
 derivative of HEX shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter1z
 derivative of HEX shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter2x
 derivative of HEX shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter2y
 derivative of HEX shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter2z
 derivative of HEX shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter3x
 derivative of HEX shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter3y
 derivative of quad shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter3z
 derivative of quad shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter4x
 derivative of HEX shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter4y
 derivative of quad shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter4z
 derivative of quad shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter5x
 derivative of HEX shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter5y
 derivative of quad shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter5z
 derivative of quad shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter6x
 derivative of HEX shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter6y
 derivative of quad shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter6z
 derivative of quad shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter7x
 derivative of HEX shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter7y
 derivative of quad shape function More...
 
static constexpr double diffShapeFunMBHEXAtCenter7z
 derivative of quad shape function More...
 
static constexpr std::array< double, 8 > diffShapeFunMBQUADAtCenter
 
static constexpr std::array< double, 24 > diffShapeFunMBHEXAtCenter
 
static constexpr double diffShapeFunMBTET0x
 derivative of tetrahedral shape function More...
 
static constexpr double diffShapeFunMBTET0y
 derivative of tetrahedral shape function More...
 
static constexpr double diffShapeFunMBTET0z
 derivative of tetrahedral shape function More...
 
static constexpr double diffShapeFunMBTET1x
 derivative of tetrahedral shape function More...
 
static constexpr double diffShapeFunMBTET1y
 derivative of tetrahedral shape function More...
 
static constexpr double diffShapeFunMBTET1z
 derivative of tetrahedral shape function More...
 
static constexpr double diffShapeFunMBTET2x
 derivative of tetrahedral shape function More...
 
static constexpr double diffShapeFunMBTET2y
 derivative of tetrahedral shape function More...
 
static constexpr double diffShapeFunMBTET2z
 derivative of tetrahedral shape function More...
 
static constexpr double diffShapeFunMBTET3x
 derivative of tetrahedral shape function More...
 
static constexpr double diffShapeFunMBTET3y
 derivative of tetrahedral shape function More...
 
static constexpr double diffShapeFunMBTET3z
 derivative of tetrahedral shape function More...
 
static constexpr std::array< double, 12 > diffShapeFunMBTET
 
static constexpr double shapeFunMBTET0At000 = N_MBTET0(0, 0, 0)
 
static constexpr double shapeFunMBTET1At000 = N_MBTET1(0, 0, 0)
 
static constexpr double shapeFunMBTET2At000 = N_MBTET2(0, 0, 0)
 
static constexpr double shapeFunMBTET3At000 = N_MBTET3(0, 0, 0)
 
static constexpr double shapeFunMBTET0AtOneThird
 
static constexpr double shapeFunMBTET1AtOneThird
 
static constexpr double shapeFunMBTET2AtOneThird
 
static constexpr double shapeFunMBTET3AtOneThird
 
static constexpr std::array< double, 4 > shapeFunMBTETAt000
 Array of shape function at zero local point on reference element. More...
 
static constexpr std::array< double, 4 > shapeFunMBTETAtOneThird
 Array of shape function at center on reference element. More...
 
MoFEMErrorCode minTetsQuality (const Range &tets, double &min_quality, Tag th=nullptr, boost::function< double(double, double)> f=[](double a, double b) -> double { return std::min(a, b);})
 calculate minimal quality of tetrahedra in range More...
 
MoFEMErrorCode getTetsWithQuality (Range &out_tets, const Range &tets, Tag th=nullptr, boost::function< bool(double)> f=[](double q) -> bool { if(q<=0) return true;else return false;})
 Get the Tets With Quality. More...
 
MoFEMErrorCode writeTetsWithQuality (const char *file_name, const char *file_type, const char *options, const Range &tets, Tag th=nullptr, boost::function< bool(double)> f=[](double q) -> bool { if(q<=0) return true;else return false;})
 Write file with tetrahedral of given quality. More...
 
MoFEMErrorCode getTriNormal (const EntityHandle tri, double *normal) const
 Get triangle normal. More...
 
double getTriArea (const EntityHandle tri) const
 Get triangle area. More...
 
double getEdgeLength (const EntityHandle edge)
 Get edge length. More...
 
MoFEMErrorCode findMinDistanceFromTheEdges (const double *v_ptr, const int nb, Range edges, double *min_dist_ptr, double *o_ptr=nullptr, EntityHandle *o_segments=nullptr) const
 Find minimal distance to edges. More...
 
static double volumeLengthQuality (const double *coords)
 Calculate tetrahedron volume length quality. More...
 
static double tetVolume (const double *coords)
 Calculate volume of tetrahedron. More...
 
static double shapeFunMBEDGE0 (const double x)
 
static double shapeFunMBEDGE1 (const double x)
 
template<int LDB = 1>
static MoFEMErrorCode shapeFunMBEDGE (double *shape, const double *ksi, const int nb)
 Calculate shape functions on edge. More...
 
static double shapeFunMBTRI0 (const double x, const double y)
 
static double shapeFunMBTRI1 (const double x, const double y)
 
static double shapeFunMBTRI2 (const double x, const double y)
 
template<int LDB = 1>
static MoFEMErrorCode shapeFunMBTRI (double *shape, const double *ksi, const double *eta, const int nb)
 Calculate shape functions on triangle. More...
 
static double shapeFunMBTET0 (const double x, const double y, const double z)
 
static double shapeFunMBTET1 (const double x, const double y, const double z)
 
static double shapeFunMBTET2 (const double x, const double y, const double z)
 
static double shapeFunMBTET3 (const double x, const double y, const double z)
 
template<int LDB = 1>
static MoFEMErrorCode shapeFunMBTET (double *shape, const double *ksi, const double *eta, const double *zeta, const double nb)
 Calculate shape functions on tetrahedron. More...
 
static MoFEMErrorCode getLocalCoordinatesOnReferenceFourNodeTet (const double *elem_coords, const double *glob_coords, const int nb_nodes, double *local_coords)
 Get the local coordinates on reference four node tet object. More...
 
static MoFEMErrorCode getLocalCoordinatesOnReferenceThreeNodeTri (const double *elem_coords, const double *glob_coords, const int nb_nodes, double *local_coords)
 Get the local coordinates on reference three node tri object. More...
 
static MoFEMErrorCode getLocalCoordinatesOnReferenceThreeNodeTri (const double *elem_coords, const std::complex< double > *glob_coords, const int nb_nodes, std::complex< double > *local_coords)
 Get the local coordinates on reference three node tri object. More...
 
static DEPRECATED MoFEMErrorCode getLocalCoordinatesOnReferenceTriNodeTri (const double *elem_coords, const double *glob_coords, const int nb_nodes, double *local_coords)
 
static MoFEMErrorCode getLocalCoordinatesOnReferenceEdgeNodeEdge (const double *elem_coords, const double *glob_coords, const int nb_nodes, double *local_coords)
 Get the local coordinates on reference four node tet object. More...
 
static MoFEMErrorCode checkIfPointIsInTet (const double tet_coords[], const double global_coord[], const double tol, bool &result)
 Check of point is in tetrahedral. More...
 
static MoFEMErrorCode getTriNormal (const double *coords, double *normal, double *d_normal=nullptr)
 Get the Tri Normal objectGet triangle normal. More...
 
static double getEdgeLength (const double *edge_coords)
 Get edge length. More...
 
static SEGMENT_MIN_DISTANCE minDistancePointFromOnSegment (const double *w_ptr, const double *v_ptr, const double *p_ptr, double *const t_ptr=nullptr)
 Find closet point on the segment from the point. More...
 
static SEGMENT_MIN_DISTANCE minDistanceFromSegments (const double *w_ptr, const double *v_ptr, const double *k_ptr, const double *l_ptr, double *const tvw_ptr=nullptr, double *const tlk_ptr=nullptr)
 Find points on two segments in closest distance. More...
 

Debugging

MoFEMErrorCode checkVectorForNotANumber (const Problem *prb_ptr, const RowColData row_or_col, Vec v)
 Print all DOFs for which element of vector is not a number. More...
 

Mesh refinement

using RefineTrianglesReturn = std::tuple< std::vector< double >, std::vector< int >, std::vector< int > >
 
static constexpr std::array< int, 12 > uniformTriangleRefineTriangles
 
static RefineTrianglesReturn refineTriangle (int nb_levels)
 create uniform triangle mesh of refined elements More...
 
static MatrixDouble refineTriangleIntegrationPts (MatrixDouble pts, RefineTrianglesReturn refined)
 generate integration points for refined triangle mesh for last level More...
 
static MatrixDouble refineTriangleIntegrationPts (int rule, RefineTrianglesReturn refined)
 generate integration points for refined triangle mesh for last level More...
 

Detailed Description

Auxiliary tools.

Definition at line 19 of file Tools.hpp.

Member Typedef Documentation

◆ RefineTrianglesReturn

using MoFEM::Tools::RefineTrianglesReturn = std::tuple<std::vector<double>, std::vector<int>, std::vector<int> >

Definition at line 639 of file Tools.hpp.

Member Enumeration Documentation

◆ SEGMENT_MIN_DISTANCE

Enumerator
SOLUTION_EXIST 
SEGMENT_ONE_IS_POINT 
SEGMENT_TWO_IS_POINT 
SEGMENT_TWO_AND_TWO_ARE_POINT 
NO_SOLUTION 

Definition at line 525 of file Tools.hpp.

Constructor & Destructor Documentation

◆ Tools()

MoFEM::Tools::Tools ( const MoFEM::Core core)
inline

Definition at line 25 of file Tools.hpp.

25 : cOre(const_cast<MoFEM::Core &>(core)) {}

Member Function Documentation

◆ checkIfPointIsInTet()

MoFEMErrorCode MoFEM::Tools::checkIfPointIsInTet ( const double  tet_coords[],
const double  global_coord[],
const double  tol,
bool result 
)
static

Check of point is in tetrahedral.

Parameters
tet_coords
global_coord
tol
result
Returns
MoFEMErrorCode

Definition at line 287 of file Tools.cpp.

289  {
290  double loc_coord[] = {0, 0, 0};
291  double N[4], diffN[12];
293  CHKERR ShapeDiffMBTET(diffN);
294  CHKERR ShapeMBTET(N, &loc_coord[0], &loc_coord[1], &loc_coord[2], 1);
295  CHKERR ShapeMBTET_inverse(N, diffN, tet_coords, global_coord, loc_coord);
296  CHKERR ShapeMBTET(N, &loc_coord[0], &loc_coord[1], &loc_coord[2], 1);
297  result = true;
298  for (int n = 0; n != 4; ++n) {
299  if (N[n] < -tol || (N[n] - 1) > tol) {
300  result = false;
301  break;
302  }
303  }
305 }

◆ checkVectorForNotANumber()

MoFEMErrorCode MoFEM::Tools::checkVectorForNotANumber ( const Problem prb_ptr,
const RowColData  row_or_col,
Vec  v 
)

Print all DOFs for which element of vector is not a number.

Definition at line 307 of file Tools.cpp.

309  {
311  int loc_size;
312  CHKERR VecGetLocalSize(v, &loc_size);
313  int prb_loc_size = 0;
314  boost::shared_ptr<NumeredDofEntity_multiIndex> prb_dofs;
315  switch (row_or_col) {
316  case ROW:
317  prb_loc_size = prb_ptr->getNbLocalDofsRow();
318  prb_dofs = prb_ptr->getNumeredRowDofsPtr();
319  break;
320  case COL:
321  prb_loc_size = prb_ptr->getNbLocalDofsCol();
322  prb_dofs = prb_ptr->getNumeredColDofsPtr();
323  break;
324  break;
325  default:
326  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
327  "Wrong argument, row_or_col should be row or column");
328  }
329  if (loc_size != prb_loc_size) {
330  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
331  "Inconsistent size of vector and problem %d != %d", loc_size,
332  prb_loc_size);
333  }
334  const double *a;
335  CHKERR VecGetArrayRead(v, &a);
336  MPI_Comm comm = PetscObjectComm((PetscObject)v);
337  for (int ii = 0; ii != loc_size; ++ii) {
338  if (!boost::math::isfinite(a[ii])) {
339  NumeredDofEntityByLocalIdx::iterator dit =
340  prb_dofs->get<PetscLocalIdx_mi_tag>().find(ii);
341  std::ostringstream ss;
342  ss << "Not a number " << a[ii] << " on dof: " << endl
343  << **dit << endl
344  << endl;
345  PetscSynchronizedPrintf(comm, "%s", ss.str().c_str());
346  }
347  }
348  CHKERR VecRestoreArrayRead(v, &a);
349  PetscSynchronizedFlush(comm, PETSC_STDOUT);
351 }

◆ findMinDistanceFromTheEdges()

MoFEMErrorCode MoFEM::Tools::findMinDistanceFromTheEdges ( const double v_ptr,
const int  nb,
Range  edges,
double min_dist_ptr,
double o_ptr = nullptr,
EntityHandle o_segments = nullptr 
) const

Find minimal distance to edges.

Note
Finding only edges with have smaller distance than distance set on the input by min_dist_ptr
Parameters
v_ptrpoint coordinates
nbnb points
edgesrange of edges
min_dist_ptron return minimal distance, on input starting distance
o_ptrcoordinates of the point on edge
o_segmentsclosest segments
Returns
MoFEMErrorCode

Definition at line 535 of file Tools.cpp.

537  {
538  MoFEM::Interface &m_field = cOre;
539  moab::Interface &moab(m_field.get_moab());
541 
543 
544  auto get_point = [i](auto &t_w, auto &t_delta, auto t) {
546  t = std::max(0., std::min(1., t));
547  t_p(i) = t_w(i) + t * t_delta(i);
548  return t_p;
549  };
550 
551  auto get_distance = [i](auto &t_p, auto &t_n) {
552  FTensor::Tensor1<double, 3> t_dist_vector;
553  t_dist_vector(i) = t_p(i) - t_n(i);
554  return sqrt(t_dist_vector(i) * t_dist_vector(i));
555  };
556 
557  for (auto e : edges) {
558 
559  int num_nodes;
560  const EntityHandle *conn_fixed;
561  CHKERR moab.get_connectivity(e, conn_fixed, num_nodes, true);
562  VectorDouble6 coords_fixed(6);
563  CHKERR moab.get_coords(conn_fixed, num_nodes, &coords_fixed[0]);
565  &coords_fixed[0], &coords_fixed[1], &coords_fixed[2]);
567  &coords_fixed[3], &coords_fixed[4], &coords_fixed[5]);
568 
569  FTensor::Tensor1<double, 3> t_edge_delta;
570  t_edge_delta(i) = t_f1(i) - t_f0(i);
571 
573  v_ptr, v_ptr + 1, v_ptr + 2);
575  o_ptr, o_ptr + 1, o_ptr + 2);
576  FTensor::Tensor0<FTensor::PackPtr<double *, 1>> t_min_dist(min_dist_ptr);
577 
578  EntityHandle *colsest_segment_it = nullptr;
579  if (o_segments)
580  colsest_segment_it = o_segments;
581 
582  for (int n = 0; n != nb; ++n) {
583 
584  double t;
585  if (Tools::minDistancePointFromOnSegment(&t_f0(0), &t_f1(0), &t_n(0),
586  &t) == Tools::SOLUTION_EXIST) {
587  auto t_p = get_point(t_f0, t_edge_delta, t);
588  auto dist_n = get_distance(t_p, t_n);
589  if (dist_n < t_min_dist || t_min_dist < 0) {
590  t_min_dist = dist_n;
591  if (o_ptr)
592  t_min_coords(i) = t_p(i);
593  if (o_segments)
594  *colsest_segment_it = e;
595  }
596  }
597 
598  ++t_n;
599  ++t_min_dist;
600  if (o_ptr)
601  ++t_min_coords;
602  if (o_segments)
603  ++colsest_segment_it;
604  }
605  }
606 
608 }

◆ getEdgeLength() [1/2]

double MoFEM::Tools::getEdgeLength ( const double edge_coords)
static

Get edge length.

Parameters
edge_coords
Returns
double

Definition at line 415 of file Tools.cpp.

415  {
417  edge_coords[2]);
419  edge_coords[5]);
421  t_coords_n0(i) -= t_coords_n1(i);
422  return sqrt(t_coords_n0(i) * t_coords_n0(i));
423 }

◆ getEdgeLength() [2/2]

double MoFEM::Tools::getEdgeLength ( const EntityHandle  edge)

Get edge length.

Parameters
edge
Returns
double

Definition at line 425 of file Tools.cpp.

425  {
426  MoFEM::Interface &m_field = cOre;
427  moab::Interface &moab(m_field.get_moab());
428  auto get_edge_coords = [edge, &moab](double *const coords) {
430  if (type_from_handle(edge) != MBEDGE) {
431  SETERRQ(PETSC_COMM_SELF, MOFEM_INVALID_DATA, "Works only for edge");
432  }
433  const EntityHandle *conn;
434  int num_nodes;
435  CHKERR moab.get_connectivity(edge, conn, num_nodes, true);
436  CHKERR moab.get_coords(conn, 2, coords);
438  };
439  double coords[6];
440  ierr = get_edge_coords(coords);
441  CHKERRABORT(PETSC_COMM_SELF, ierr);
442  return getEdgeLength(coords);
443 }

◆ getLocalCoordinatesOnReferenceEdgeNodeEdge()

MoFEMErrorCode MoFEM::Tools::getLocalCoordinatesOnReferenceEdgeNodeEdge ( const double elem_coords,
const double glob_coords,
const int  nb_nodes,
double local_coords 
)
static

Get the local coordinates on reference four node tet object.

MatrixDouble elem_coords(4, 3);
// Set nodal coordinates
MatrixDouble global_coords(5, 3);
// Set global coordinates
MatrixDouble local_coords(global_coords.size1(), 3);
&elem_coords(0, 0), &global_coords(0, 0), global_coords.size1(),
&local_coords(0, 0))
Parameters
elem_coordsGlobal element node coordinates
glob_coordsGlobal coordinates
nb_nodesNumber of points
local_coordsResult
Returns
MoFEMErrorCode

Definition at line 203 of file Tools.cpp.

205  {
206 
209 
211  &elem_coords[0], &elem_coords[3], &elem_coords[6]};
212 
213  FTensor::Tensor1<double, 3> t_coords_at_0;
214  // Build matrix and get coordinates of zero point
215  // ii - global coordinates
217  for (auto ii : {0, 1, 2}) {
218  t_a(ii) = diffShapeFunMBEDGE[0] * t_elem_coords(0) +
219  diffShapeFunMBEDGE[1] * t_elem_coords(1);
220  t_coords_at_0(ii) = shapeFunMBEDGEAt00[0] * t_elem_coords(0) +
221  shapeFunMBEDGEAt00[1] * t_elem_coords(1);
222  ++t_elem_coords;
223  }
224 
226  &global_coords[0], &global_coords[1], &global_coords[2]};
228  &local_coords[0]};
229 
230  const double b = t_a(i3) * t_a(i3);
231  const double inv_b = 1 / b;
232 
233  // Calculate right hand side
234  for (int ii = 0; ii != nb_nodes; ++ii) {
235  t_local_coords =
236  inv_b * (t_a(i3) * (t_global_coords(i3) - t_coords_at_0(i3)));
237  ++t_local_coords;
238  ++t_global_coords;
239  }
240 
242 }

◆ getLocalCoordinatesOnReferenceFourNodeTet()

MoFEMErrorCode MoFEM::Tools::getLocalCoordinatesOnReferenceFourNodeTet ( const double elem_coords,
const double glob_coords,
const int  nb_nodes,
double local_coords 
)
static

Get the local coordinates on reference four node tet object.

MatrixDouble elem_coords(4, 3);
// Set nodal coordinates
MatrixDouble global_coords(5, 3);
// Set global coordinates
MatrixDouble local_coords(global_coords.size1(), 3);
&elem_coords(0, 0), &global_coords(0, 0), global_coords.size1(),
&local_coords(0, 0))
Parameters
elem_coordsGlobal element node coordinates
glob_coordsGlobal coordinates
nb_nodesNumber of points
local_coordsResult
Returns
MoFEMErrorCode

Definition at line 88 of file Tools.cpp.

90  {
93 
95  &elem_coords[0], &elem_coords[3], &elem_coords[6], &elem_coords[9]};
96 
100  FTensor::Tensor1<double, 3> t_coords_at_0;
101 
102  // Build matrix and get coordinates of zero point
103  // ii - global coordinates
104  // jj - local derivatives
105  MatrixDouble3by3 a(3, 3);
106  for (auto ii : {0, 1, 2}) {
109  &diffShapeFunMBTET[9]);
110  for (auto jj : {0, 1, 2}) {
111  a(jj, ii) = t_diff(i) * t_elem_coords(i);
112  ++t_diff;
113  }
114  t_coords_at_0(ii) = t_n(i) * t_elem_coords(i);
115  ++t_elem_coords;
116  }
117 
119  &global_coords[0], &global_coords[1], &global_coords[2]};
121  &local_coords[0], &local_coords[1], &local_coords[2]};
122 
123  // Calculate right hand side
125  for (int ii = 0; ii != nb_nodes; ++ii) {
126  t_local_coords(j) = t_global_coords(j) - t_coords_at_0(j);
127  ++t_local_coords;
128  ++t_global_coords;
129  }
130 
131  // Solve problem
132  int IPIV[3];
133  int info = lapack_dgesv(3, nb_nodes, &a(0, 0), 3, IPIV, local_coords, 3);
134  if (info != 0)
135  SETERRQ1(PETSC_COMM_SELF, 1, "info == %d", info);
136 
138 }

◆ getLocalCoordinatesOnReferenceThreeNodeTri() [1/2]

MoFEMErrorCode MoFEM::Tools::getLocalCoordinatesOnReferenceThreeNodeTri ( const double elem_coords,
const double glob_coords,
const int  nb_nodes,
double local_coords 
)
static

Get the local coordinates on reference three node tri object.

MatrixDouble elem_coords(4, 3);
// Set nodal coordinates
MatrixDouble global_coords(5, 3);
// Set global coordinates
MatrixDouble local_coords(global_coords.size1(), 3);
&elem_coords(0, 0), &global_coords(0, 0), global_coords.size1(),
&local_coords(0, 0))
Parameters
elem_coordsGlobal element node coordinates
glob_coordsGlobal coordinates
nb_nodesNumber of points
local_coordsResult
d_elem_coordsDerivative of local coordinates
d_global_coords
Returns
MoFEMErrorCode

Definition at line 188 of file Tools.cpp.

190  {
191  return getLocalCoordinatesOnReferenceThreeNodeTriImpl<double, double>(
192  elem_coords, glob_coords, nb_nodes, local_coords);
193 }

◆ getLocalCoordinatesOnReferenceThreeNodeTri() [2/2]

MoFEMErrorCode MoFEM::Tools::getLocalCoordinatesOnReferenceThreeNodeTri ( const double elem_coords,
const std::complex< double > *  glob_coords,
const int  nb_nodes,
std::complex< double > *  local_coords 
)
static

Get the local coordinates on reference three node tri object.

MatrixDouble elem_coords(4, 3);
// Set nodal coordinates
MatrixDouble global_coords(5, 3);
// Set global coordinates
MatrixDouble local_coords(global_coords.size1(), 3);
&elem_coords(0, 0), &global_coords(0, 0), global_coords.size1(),
&local_coords(0, 0))
Parameters
elem_coordsGlobal element node coordinates
glob_coordsGlobal coordinates
nb_nodesNumber of points
local_coordsResult
d_elem_coordsDerivative of local coordinates
d_global_coords
Returns
MoFEMErrorCode

Definition at line 195 of file Tools.cpp.

197  {
199  std::complex<double>>(
200  elem_coords, glob_coords, nb_nodes, local_coords);
201 }

◆ getLocalCoordinatesOnReferenceTriNodeTri()

static DEPRECATED MoFEMErrorCode MoFEM::Tools::getLocalCoordinatesOnReferenceTriNodeTri ( const double elem_coords,
const double glob_coords,
const int  nb_nodes,
double local_coords 
)
inlinestatic
Deprecated:
use getLocalCoordinatesOnReferenceThreeNodeTri

Definition at line 398 of file Tools.hpp.

400  {
401  return getLocalCoordinatesOnReferenceThreeNodeTri(elem_coords, glob_coords,
402  nb_nodes, local_coords);
403  }

◆ getTetsWithQuality()

MoFEMErrorCode MoFEM::Tools::getTetsWithQuality ( Range out_tets,
const Range tets,
Tag  th = nullptr,
boost::function< bool(double)>  f = [](double q) -> bool { if (q <= 0) return true; else return false; } 
)

Get the Tets With Quality.

Parameters
out_tets
tets
th
f
Returns
MoFEMErrorCode

Definition at line 244 of file Tools.cpp.

246  {
247  MoFEM::Interface &m_field = cOre;
248  moab::Interface &moab(m_field.get_moab());
250  Range to_write;
251  const EntityHandle *conn;
252  int num_nodes;
253  double coords[12];
254  for (auto tet : tets) {
255  CHKERR m_field.get_moab().get_connectivity(tet, conn, num_nodes, true);
256  if (th) {
257  CHKERR moab.tag_get_data(th, conn, num_nodes, coords);
258  } else {
259  CHKERR moab.get_coords(conn, num_nodes, coords);
260  }
261  double q = Tools::volumeLengthQuality(coords);
262  if (f(q)) {
263  out_tets.insert(tet);
264  }
265  }
267 }

◆ getTriArea()

double MoFEM::Tools::getTriArea ( const EntityHandle  tri) const

Get triangle area.

Parameters
tri
Returns
double

Definition at line 408 of file Tools.cpp.

408  {
411  CHK_THROW_MESSAGE(getTriNormal(tri, &t_normal(0)), "calculate area");
412  return sqrt(t_normal(i) * t_normal(i)) * 0.5;
413 }

◆ getTriNormal() [1/2]

MoFEMErrorCode MoFEM::Tools::getTriNormal ( const double coords,
double normal,
double d_normal = nullptr 
)
static

Get the Tri Normal objectGet triangle normal.

Parameters
coords
normal
d_normalderbiative, if pointer is null, derbiative is not calculated
Returns
MoFEMErrorCode

Definition at line 353 of file Tools.cpp.

354  {
365  auto diff_ptr = Tools::diffShapeFunMBTRI.data();
366  auto t_diff_tensor = getFTensor2FromPtr<3, 2>(const_cast<double *>(diff_ptr));
367  auto t_coords = getFTensor2FromPtr<3, 3>(const_cast<double *>(coords));
369  t_tangent(i, J) = t_coords(n, i) * t_diff_tensor(n, J);
370  auto t_normal = getFTensor1FromPtr<3>(normal);
371  t_normal(j) =
372  FTensor::levi_civita(i, j, k) * t_tangent(k, N0) * t_tangent(i, N1);
373  if (d_normal) {
374  constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
376  t_d_coords(i, j, k, n) = t_kd(i, k) * t_kd(j, n);
378  t_d_tangent(i, k, l, J) = t_d_coords(n, i, k, l) * t_diff_tensor(n, J);
379  auto t_d_normal = getFTensor3FromPtr<3, 3, 3>(d_normal);
380  t_d_normal(j, m, n) = (FTensor::levi_civita(i, j, k) * t_tangent(i, N1)) *
381  t_d_tangent(k, m, n, N0)
382 
383  +
384 
385  (FTensor::levi_civita(i, j, k) * t_tangent(k, N0)) *
386  t_d_tangent(i, m, n, N1);
387  }
389 }

◆ getTriNormal() [2/2]

MoFEMErrorCode MoFEM::Tools::getTriNormal ( const EntityHandle  tri,
double normal 
) const

Get triangle normal.

Parameters
tri
normal
Returns
MoFEMErrorCode

Definition at line 391 of file Tools.cpp.

392  {
393  MoFEM::Interface &m_field = cOre;
394  moab::Interface &moab(m_field.get_moab());
396  if (type_from_handle(tri) != MBTRI) {
397  SETERRQ(PETSC_COMM_SELF, MOFEM_INVALID_DATA, "Works only for triangle");
398  }
399  const EntityHandle *conn;
400  int num_nodes;
401  double coords[9];
402  CHKERR moab.get_connectivity(tri, conn, num_nodes, true);
403  CHKERR moab.get_coords(conn, num_nodes, coords);
404  CHKERR getTriNormal(coords, normal);
406 }

◆ minDistanceFromSegments()

Tools::SEGMENT_MIN_DISTANCE MoFEM::Tools::minDistanceFromSegments ( const double w_ptr,
const double v_ptr,
const double k_ptr,
const double l_ptr,
double *const  tvw_ptr = nullptr,
double *const  tlk_ptr = nullptr 
)
static

Find points on two segments in closest distance.

Parameters
w_ptr
v_ptr
k_ptr
l_ptr
tvw_ptr
tlk_ptr
Returns
SEGMENT_MIN_DISTANCE
Note
If tvwk or tlk are outside bound [0,-1], it means that points are on the lines beyond segments, respectively for segment vw and lk.

Definition at line 469 of file Tools.cpp.

471  {
472 
474  FTensor::Tensor1<const double *, 3> t_w(&w_ptr[0], &w_ptr[1], &w_ptr[2]);
475  FTensor::Tensor1<const double *, 3> t_v(&v_ptr[0], &v_ptr[1], &v_ptr[2]);
476  FTensor::Tensor1<const double *, 3> t_k(&k_ptr[0], &k_ptr[1], &k_ptr[2]);
477  FTensor::Tensor1<const double *, 3> t_l(&l_ptr[0], &l_ptr[1], &l_ptr[2]);
478 
479  // First segnent is a point
481  t_vw(i) = t_v(i) - t_w(i);
482  double dot_vw = t_vw(i) * t_vw(i);
483  if (std::abs(dot_vw) < std::numeric_limits<double>::epsilon()) {
484  if (tvw_ptr)
485  *tvw_ptr = 0;
486  if (minDistancePointFromOnSegment(k_ptr, l_ptr, w_ptr, tlk_ptr) ==
489  else
490  return SEGMENT_ONE_IS_POINT;
491  }
492 
493  // Second segment is a point
495  t_lk(i) = t_l(i) - t_k(i);
496  double dot_lk = t_lk(i) * t_lk(i);
497  if (std::abs(dot_lk) < std::numeric_limits<double>::epsilon()) {
498  if (tlk_ptr)
499  *tlk_ptr = 0;
500  if (minDistancePointFromOnSegment(w_ptr, v_ptr, k_ptr, tvw_ptr) ==
503  else
504  return SEGMENT_TWO_IS_POINT;
505  }
506 
507  const double a = t_vw(i) * t_vw(i);
508  const double b = -t_vw(i) * t_lk(i);
509  const double c = t_lk(i) * t_lk(i);
510 
511  const double det = a * c - b * b;
512  if (std::abs(det) < std::numeric_limits<double>::epsilon()) {
513 
514  return NO_SOLUTION;
515 
516  } else {
517 
519  t_wk(i) = t_w(i) - t_k(i);
520 
521  const double ft0 = t_vw(i) * t_wk(i);
522  const double ft1 = -t_lk(i) * t_wk(i);
523  const double t0 = (ft1 * b - ft0 * c) / det;
524  const double t1 = (ft0 * b - ft1 * a) / det;
525 
526  if (tvw_ptr)
527  *tvw_ptr = t0;
528  if (tlk_ptr)
529  *tlk_ptr = t1;
530 
531  return SOLUTION_EXIST;
532  }
533 }

◆ minDistancePointFromOnSegment()

Tools::SEGMENT_MIN_DISTANCE MoFEM::Tools::minDistancePointFromOnSegment ( const double w_ptr,
const double v_ptr,
const double p_ptr,
double *const  t_ptr = nullptr 
)
static

Find closet point on the segment from the point.

Parameters
w_ptrsegment first vertex coordinate
v_ptrsegment second vertex coordinate
p_ptrcoordinate of point
t_ptrdistance on the segment
Note
If t is outside bounds [ 0,-1 ] point is on the line point beyond segment.
double w[] = {-1, 0, 0};
double v[] = {1, 0, 0};
double p[] = {0, 1, 0};
double t;
CHKERR Toolas::minDistancePointFromOnSegment(w, v, p, &t);
double point_on_segment[3];
for (int i = 0; i != 3; ++i)
point_on_segment[i] = w[i] + t * (v[i] - w[i]);
Returns
SEGMENT_MIN_DISTANCE

Definition at line 446 of file Tools.cpp.

447  {
449  FTensor::Tensor1<const double *, 3> t_w(&w_ptr[0], &w_ptr[1], &w_ptr[2]);
450  FTensor::Tensor1<const double *, 3> t_v(&v_ptr[0], &v_ptr[1], &v_ptr[2]);
451  FTensor::Tensor1<const double *, 3> t_p(&p_ptr[0], &p_ptr[1], &p_ptr[2]);
453  t_vw(i) = t_v(i) - t_w(i);
454  const double dot_vw = t_vw(i) * t_vw(i);
455  if (std::abs(dot_vw) < std::numeric_limits<double>::epsilon()) {
456  if (t_ptr)
457  *t_ptr = 0;
458  return SEGMENT_ONE_IS_POINT;
459  }
461  t_pw(i) = t_p(i) - t_w(i);
462  const double t = t_pw(i) * t_vw(i) / dot_vw;
463  if (t_ptr)
464  *t_ptr = t;
465  return SOLUTION_EXIST;
466 }

◆ minTetsQuality()

MoFEMErrorCode MoFEM::Tools::minTetsQuality ( const Range tets,
double min_quality,
Tag  th = nullptr,
boost::function< double(double, double)>  f = [](double adouble b) -> double { return std::min(a, b); } 
)

calculate minimal quality of tetrahedra in range

Parameters
tetsrange
min_qualityminimal quality
Returns
error code

Definition at line 49 of file Tools.cpp.

50  {
51  MoFEM::Interface &m_field = cOre;
52  moab::Interface &moab(m_field.get_moab());
54  const EntityHandle *conn;
55  int num_nodes;
56  double coords[12];
57  for (auto tet : tets) {
58  CHKERR m_field.get_moab().get_connectivity(tet, conn, num_nodes, true);
59  if (th) {
60  CHKERR moab.tag_get_data(th, conn, num_nodes, coords);
61  } else {
62  CHKERR moab.get_coords(conn, num_nodes, coords);
63  }
64  double q = Tools::volumeLengthQuality(coords);
65  if (!std::isnormal(q))
66  q = -2;
67  min_quality = f(q, min_quality);
68  }
70 }

◆ outerProductOfEdgeIntegrationPtsForHex()

MoFEMErrorCode MoFEM::Tools::outerProductOfEdgeIntegrationPtsForHex ( MatrixDouble pts,
const int  edge0,
const int  edge1,
const int  edge2 
)
static
Examples
gauss_points_on_outer_product.cpp.

Definition at line 659 of file Tools.cpp.

661  {
663 
664  auto check_rule_edge = [](int rule) {
666  if (rule < 0) {
667  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
668  "Wrong integration rule: %d", rule);
669  }
670  if (rule > QUAD_1D_TABLE_SIZE) {
671  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
672  "rule > quadrature order %d < %d", rule, QUAD_1D_TABLE_SIZE);
673  }
674  if (QUAD_1D_TABLE[rule]->dim != 1) {
675  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "wrong dimension");
676  }
677  if (QUAD_1D_TABLE[rule]->order < rule) {
678  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
679  "wrong order %d != %d", QUAD_1D_TABLE[rule]->order, rule);
680  }
682  };
683 
684  CHKERR check_rule_edge(rule_ksi);
685  CHKERR check_rule_edge(rule_eta);
686  CHKERR check_rule_edge(rule_zeta);
687 
688  const int nb_gauss_pts_ksi = QUAD_1D_TABLE[rule_ksi]->npoints;
689  const int nb_gauss_pts_eta = QUAD_1D_TABLE[rule_eta]->npoints;
690  const int nb_gauss_pts_zeta = QUAD_1D_TABLE[rule_zeta]->npoints;
691  gauss_pts.resize(4, nb_gauss_pts_ksi * nb_gauss_pts_eta * nb_gauss_pts_zeta,
692  false);
693 
694  int gg = 0;
695  for (size_t i = 0; i != nb_gauss_pts_ksi; ++i) {
696  const double wi = QUAD_1D_TABLE[rule_ksi]->weights[i];
697  const double ksi = QUAD_1D_TABLE[rule_ksi]->points[2 * i + 1];
698  for (size_t j = 0; j != nb_gauss_pts_eta; ++j) {
699  const double wj = wi * QUAD_1D_TABLE[rule_eta]->weights[j];
700  const double eta = QUAD_1D_TABLE[rule_eta]->points[2 * j + 1];
701  for (size_t k = 0; k != nb_gauss_pts_zeta; ++k, ++gg) {
702  const double wk = wj * QUAD_1D_TABLE[rule_zeta]->weights[k];
703  const double zeta = QUAD_1D_TABLE[rule_zeta]->points[2 * k + 1];
704  gauss_pts(0, gg) = ksi;
705  gauss_pts(1, gg) = eta;
706  gauss_pts(2, gg) = zeta;
707  gauss_pts(3, gg) = wk;
708  }
709  }
710  }
711 
712  if (gg != gauss_pts.size2())
713  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Wrong size of matrix");
714 
716 }

◆ outerProductOfEdgeIntegrationPtsForQuad()

MoFEMErrorCode MoFEM::Tools::outerProductOfEdgeIntegrationPtsForQuad ( MatrixDouble pts,
const int  edge0,
const int  edge1 
)
static
Examples
gauss_points_on_outer_product.cpp.

Definition at line 610 of file Tools.cpp.

611  {
613 
614  auto check_rule_edge = [](int rule) {
616  if (rule < 0) {
617  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
618  "Wrong integration rule: %d", rule);
619  }
620  if (rule > QUAD_1D_TABLE_SIZE) {
621  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
622  "rule > quadrature order %d < %d", rule, QUAD_1D_TABLE_SIZE);
623  }
624  if (QUAD_1D_TABLE[rule]->dim != 1) {
625  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "wrong dimension");
626  }
627  if (QUAD_1D_TABLE[rule]->order < rule) {
628  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
629  "wrong order %d != %d", QUAD_1D_TABLE[rule]->order, rule);
630  }
632  };
633 
634  CHKERR check_rule_edge(rule_ksi);
635  CHKERR check_rule_edge(rule_eta);
636 
637  const int nb_gauss_pts_ksi = QUAD_1D_TABLE[rule_ksi]->npoints;
638  const int nb_gauss_pts_eta = QUAD_1D_TABLE[rule_eta]->npoints;
639  gauss_pts.resize(3, nb_gauss_pts_ksi * nb_gauss_pts_eta, false);
640 
641  int gg = 0;
642  for (size_t i = 0; i != nb_gauss_pts_ksi; ++i) {
643  const double wi = QUAD_1D_TABLE[rule_ksi]->weights[i];
644  const double ksi = (QUAD_1D_TABLE[rule_ksi]->points[2 * i + 1]);
645  for (size_t j = 0; j != nb_gauss_pts_eta; ++j, ++gg) {
646  const double wk = wi * QUAD_1D_TABLE[rule_eta]->weights[j];
647  const double eta = QUAD_1D_TABLE[rule_eta]->points[2 * j + 1];
648  gauss_pts(0, gg) = ksi;
649  gauss_pts(1, gg) = eta;
650  gauss_pts(2, gg) = wk;
651  }
652  }
653  if (gg != gauss_pts.size2())
654  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Wrong size of matrix");
655 
657 }

◆ query_interface()

MoFEMErrorCode MoFEM::Tools::query_interface ( boost::typeindex::type_index  type_index,
UnknownInterface **  iface 
) const
virtual

Implements MoFEM::UnknownInterface.

Definition at line 9 of file Tools.cpp.

10  {
11  *iface = const_cast<Tools *>(this);
12  return 0;
13 }

◆ refineTriangle()

std::tuple< std::vector< double >, std::vector< int >, std::vector< int > > MoFEM::Tools::refineTriangle ( int  nb_levels)
static

create uniform triangle mesh of refined elements

Parameters
nb_levels
Returns
RefineTrianglesReturn
Examples
gauss_points_on_outer_product.cpp.

Definition at line 721 of file Tools.cpp.

721  {
722 
723  std::vector<int> triangles{0, 1, 2, 3, 4, 5};
724  std::vector<double> nodes{
725 
726  0., 0., // 0
727  1., 0., // 1
728  0., 1., // 2
729  0.5, 0., // 3
730  0.5, 0.5, // 4
731  0., 0.5 // 5
732 
733  };
734  std::map<std::pair<int, int>, int> edges{
735  {{0, 1}, 3}, {{1, 2}, 4}, {{0, 2}, 5}};
736 
737  auto add_edge = [&](auto a, auto b) {
738  if (a > b) {
739  std::swap(a, b);
740  }
741  auto it = edges.find(std::make_pair(a, b));
742  if (it == edges.end()) {
743  int e = 3 + edges.size();
744  edges[std::make_pair(a, b)] = e;
745  for (auto n : {0, 1}) {
746  nodes.push_back((nodes[2 * a + n] + nodes[2 * b + n]) / 2);
747  }
748 #ifndef NDEBUG
749  if (e != nodes.size() / 2 - 1)
750  CHK_THROW_MESSAGE(MOFEM_DATA_INCONSISTENCY, "wrong node/edge index");
751 #endif
752  return e;
753  }
754  return it->second;
755  };
756 
757  auto add_triangle = [&](auto t) {
758  for (auto tt : {0, 1, 2, 3}) {
759  auto last = triangles.size() / 6;
760  for (auto n : {0, 1, 2}) {
761  // add triangle nodes
762  triangles.push_back(
763  triangles[6 * t + uniformTriangleRefineTriangles[3 * tt + n]]);
764  }
765  // add triangle edges
766  auto cycle = std::array<int, 4>{0, 1, 2, 0};
767  for (auto e : {0, 1, 2}) {
768  triangles.push_back(add_edge(triangles[6 * last + cycle[e]],
769  triangles[6 * last + cycle[e + 1]]));
770  }
771  }
772  };
773 
774  std::vector<int> level_index{0, 1};
775  auto l = 0;
776  for (; l != nb_levels; ++l) {
777  auto first_tet = level_index[l];
778  auto nb_last_level_test = level_index.back() - level_index[l];
779  for (auto t = first_tet; t != (first_tet + nb_last_level_test); ++t) {
780  add_triangle(t);
781  }
782  level_index.push_back(triangles.size() / 6);
783  }
784 
785  return std::make_tuple(nodes, triangles, level_index);
786 }

◆ refineTriangleIntegrationPts() [1/2]

MatrixDouble MoFEM::Tools::refineTriangleIntegrationPts ( int  rule,
RefineTrianglesReturn  refined 
)
static

generate integration points for refined triangle mesh for last level

Parameters
ruleGauss integration rule
refined
Returns
MatrixDouble

Definition at line 853 of file Tools.cpp.

853  {
854 
855  MatrixDouble gauss_pts;
856 
857  const size_t nb_gauss_pts = QUAD_2D_TABLE[rule]->npoints;
858  gauss_pts.resize(3, nb_gauss_pts, false);
859  cblas_dcopy(nb_gauss_pts, &QUAD_2D_TABLE[rule]->points[1], 3,
860  &gauss_pts(0, 0), 1);
861  cblas_dcopy(nb_gauss_pts, &QUAD_2D_TABLE[rule]->points[2], 3,
862  &gauss_pts(1, 0), 1);
863  cblas_dcopy(nb_gauss_pts, QUAD_2D_TABLE[rule]->weights, 1, &gauss_pts(2, 0),
864  1);
865 
866  return Tools::refineTriangleIntegrationPts(gauss_pts, refined);
867 }

◆ refineTriangleIntegrationPts() [2/2]

static MatrixDouble MoFEM::Tools::refineTriangleIntegrationPts ( MatrixDouble  pts,
RefineTrianglesReturn  refined 
)
static

generate integration points for refined triangle mesh for last level

Parameters
pts
refined
Returns
MatrixDouble
Examples
gauss_points_on_outer_product.cpp.

◆ shapeFunMBEDGE()

template<int LDB>
MoFEMErrorCode MoFEM::Tools::shapeFunMBEDGE ( double shape,
const double ksi,
const int  nb 
)
static

Calculate shape functions on edge.

Note
Template parameter is leading dimension of point coordinate arrays, such that \(ksi_{n+1} = ksi[n + LDB]\)
Template Parameters
1
Parameters
shapeshape functions
ksipointer to first local coordinates
nbnumber of points
Returns
MoFEMErrorCode

Definition at line 682 of file Tools.hpp.

683  {
685  for (int n = 0; n != nb; ++n) {
686  shape[0] = shapeFunMBEDGE0(*ksi);
687  shape[1] = shapeFunMBEDGE1(*ksi);
688  shape += 2;
689  ksi += LDB;
690  }
692 }

◆ shapeFunMBEDGE0()

double MoFEM::Tools::shapeFunMBEDGE0 ( const double  x)
inlinestatic

Definition at line 673 of file Tools.hpp.

673  {
674  return N_MBEDGE0(x);
675 }

◆ shapeFunMBEDGE1()

double MoFEM::Tools::shapeFunMBEDGE1 ( const double  x)
inlinestatic

Definition at line 677 of file Tools.hpp.

677  {
678  return N_MBEDGE1(x);
679 }

◆ shapeFunMBTET()

template<int LDB>
MoFEMErrorCode MoFEM::Tools::shapeFunMBTET ( double shape,
const double ksi,
const double eta,
const double zeta,
const double  nb 
)
static

Calculate shape functions on tetrahedron.

Note
Template parameter is leading dimension of point coordinate arrays, such that \(ksi_{n+1} = ksi[n + LDB]\)
Template Parameters
1
Parameters
shapeshape functions
ksipointer to first local coordinates
etapointer to second local coordinates
zetapointer to first third coordinates
nbnumber of points
Returns
MoFEMErrorCode

Definition at line 738 of file Tools.hpp.

740  {
742  for (int n = 0; n != nb; ++n) {
743  shape[0] = shapeFunMBTET0(*ksi, *eta, *zeta);
744  shape[1] = shapeFunMBTET1(*ksi, *eta, *zeta);
745  shape[2] = shapeFunMBTET2(*ksi, *eta, *zeta);
746  shape[3] = shapeFunMBTET3(*ksi, *eta, *zeta);
747  shape += 4;
748  ksi += LDB;
749  eta += LDB;
750  zeta += LDB;
751  }
753 }

◆ shapeFunMBTET0()

double MoFEM::Tools::shapeFunMBTET0 ( const double  x,
const double  y,
const double  z 
)
inlinestatic

Definition at line 721 of file Tools.hpp.

721  {
722  return N_MBTET0(x, y, z);
723 }

◆ shapeFunMBTET1()

double MoFEM::Tools::shapeFunMBTET1 ( const double  x,
const double  y,
const double  z 
)
inlinestatic

Definition at line 725 of file Tools.hpp.

725  {
726  return N_MBTET1(x, y, z);
727 }

◆ shapeFunMBTET2()

double MoFEM::Tools::shapeFunMBTET2 ( const double  x,
const double  y,
const double  z 
)
inlinestatic

Definition at line 729 of file Tools.hpp.

729  {
730  return N_MBTET2(x, y, z);
731 }

◆ shapeFunMBTET3()

double MoFEM::Tools::shapeFunMBTET3 ( const double  x,
const double  y,
const double  z 
)
inlinestatic

Definition at line 733 of file Tools.hpp.

733  {
734  return N_MBTET3(x, y, z);
735 };

◆ shapeFunMBTRI()

template<int LDB>
MoFEMErrorCode MoFEM::Tools::shapeFunMBTRI ( double shape,
const double ksi,
const double eta,
const int  nb 
)
static

Calculate shape functions on triangle.

Note
Template parameter is leading dimension of point coordinate arrays, such that \(ksi_{n+1} = ksi[n + LDB]\)
Template Parameters
1
Parameters
shapeshape functions
ksipointer to first local coordinates
etapointer to second local coordinates
nbnumber of points
Returns
MoFEMErrorCode

Definition at line 707 of file Tools.hpp.

708  {
710  for (int n = 0; n != nb; ++n) {
711  shape[0] = shapeFunMBTRI0(*ksi, *eta);
712  shape[1] = shapeFunMBTRI1(*ksi, *eta);
713  shape[2] = shapeFunMBTRI2(*ksi, *eta);
714  shape += 3;
715  ksi += LDB;
716  eta += LDB;
717  }
719 }

◆ shapeFunMBTRI0()

double MoFEM::Tools::shapeFunMBTRI0 ( const double  x,
const double  y 
)
inlinestatic

Definition at line 694 of file Tools.hpp.

694  {
695  return N_MBTRI0(x, y);
696 }

◆ shapeFunMBTRI1()

double MoFEM::Tools::shapeFunMBTRI1 ( const double  x,
const double  y 
)
inlinestatic

Definition at line 698 of file Tools.hpp.

698  {
699  return N_MBTRI1(x, y);
700 }

◆ shapeFunMBTRI2()

double MoFEM::Tools::shapeFunMBTRI2 ( const double  x,
const double  y 
)
inlinestatic

Definition at line 702 of file Tools.hpp.

702  {
703  return N_MBTRI2(x, y);
704 }

◆ tetVolume()

double MoFEM::Tools::tetVolume ( const double coords)
static

Calculate volume of tetrahedron.

Parameters
coords
Returns
double volume
Examples
EshelbianPlasticity.cpp.

Definition at line 30 of file Tools.cpp.

30  {
31  double diff_n[12];
32  ShapeDiffMBTET(diff_n);
33  FTensor::Tensor1<double *, 3> t_diff_n(&diff_n[0], &diff_n[1], &diff_n[2], 3);
34  FTensor::Tensor1<const double *, 3> t_coords(&coords[0], &coords[1],
35  &coords[2], 3);
39  jac(i, j) = 0;
40  for (int nn = 0; nn != 4; nn++) {
41  jac(i, j) += t_coords(i) * t_diff_n(j);
42  ++t_coords;
43  ++t_diff_n;
44  }
45  return determinantTensor3by3(jac) / 6.;
46 }

◆ volumeLengthQuality()

double MoFEM::Tools::volumeLengthQuality ( const double coords)
static

Calculate tetrahedron volume length quality.

Parameters
coordstet coordinates
Returns
Volume-length quality
Examples
mesh_smoothing.cpp.

Definition at line 15 of file Tools.cpp.

15  {
16  double lrms = 0;
17  for (int dd = 0; dd != 3; dd++) {
18  lrms += pow(coords[0 * 3 + dd] - coords[1 * 3 + dd], 2) +
19  pow(coords[0 * 3 + dd] - coords[2 * 3 + dd], 2) +
20  pow(coords[0 * 3 + dd] - coords[3 * 3 + dd], 2) +
21  pow(coords[1 * 3 + dd] - coords[2 * 3 + dd], 2) +
22  pow(coords[1 * 3 + dd] - coords[3 * 3 + dd], 2) +
23  pow(coords[2 * 3 + dd] - coords[3 * 3 + dd], 2);
24  }
25  lrms = sqrt((1. / 6.) * lrms);
26  double volume = tetVolume(coords);
27  return 6. * sqrt(2.) * volume / pow(lrms, 3);
28 }

◆ writeTetsWithQuality()

MoFEMErrorCode MoFEM::Tools::writeTetsWithQuality ( const char *  file_name,
const char *  file_type,
const char *  options,
const Range tets,
Tag  th = nullptr,
boost::function< bool(double)>  f = [](double q) -> bool { if (q <= 0) return true; else return false; } 
)

Write file with tetrahedral of given quality.

Parameters
file_name
file_type
options
tets
th
f
Returns
MoFEMErrorCode

Definition at line 269 of file Tools.cpp.

273  {
274  MoFEM::Interface &m_field = cOre;
275  moab::Interface &moab(m_field.get_moab());
277  Range out_tets;
278  CHKERR getTetsWithQuality(out_tets, tets, th, f);
279  EntityHandle meshset;
280  CHKERR moab.create_meshset(MESHSET_SET, meshset);
281  CHKERR moab.add_entities(meshset, out_tets);
282  CHKERR moab.write_file(file_name, file_type, options, &meshset, 1);
283  CHKERR moab.delete_entities(&meshset, 1);
285 }

Member Data Documentation

◆ cOre

MoFEM::Core& MoFEM::Tools::cOre

Definition at line 24 of file Tools.hpp.

◆ diffN_MBEDGE0x

constexpr double MoFEM::Tools::diffN_MBEDGE0x = diffN_MBEDGE0
staticconstexpr

Definition at line 65 of file Tools.hpp.

◆ diffN_MBEDGE1x

constexpr double MoFEM::Tools::diffN_MBEDGE1x = diffN_MBEDGE1
staticconstexpr

Definition at line 66 of file Tools.hpp.

◆ diffShapeFunMBEDGE

constexpr std::array< double, 2 > MoFEM::Tools::diffShapeFunMBEDGE
staticconstexpr
Initial value:
Examples
bernstein_bezier_generate_base.cpp.

Definition at line 68 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter

constexpr std::array< double, 24 > MoFEM::Tools::diffShapeFunMBHEXAtCenter
staticconstexpr

◆ diffShapeFunMBHEXAtCenter0x

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter0x
staticconstexpr
Initial value:
=
diffN_MBHEX0x(0.5, 0.5)

derivative of HEX shape function

Definition at line 163 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter0y

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter0y
staticconstexpr
Initial value:
=
diffN_MBHEX0y(0.5, 0.5)

derivative of HEX shape function

Definition at line 165 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter0z

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter0z
staticconstexpr
Initial value:
=
diffN_MBHEX0z(0.5, 0.5)

derivative of HEX shape function

Definition at line 167 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter1x

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter1x
staticconstexpr
Initial value:
=
diffN_MBHEX1x(0.5, 0.5)

derivative of HEX shape function

Definition at line 169 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter1y

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter1y
staticconstexpr
Initial value:
=
diffN_MBHEX1y(0.5, 0.5)

derivative of HEX shape function

Definition at line 171 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter1z

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter1z
staticconstexpr
Initial value:
=
diffN_MBHEX1z(0.5, 0.5)

derivative of HEX shape function

Definition at line 173 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter2x

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter2x
staticconstexpr
Initial value:
=
diffN_MBHEX2x(0.5, 0.5)

derivative of HEX shape function

Definition at line 175 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter2y

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter2y
staticconstexpr
Initial value:
=
diffN_MBHEX2y(0.5, 0.5)

derivative of HEX shape function

Definition at line 177 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter2z

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter2z
staticconstexpr
Initial value:
=
diffN_MBHEX2z(0.5, 0.5)

derivative of HEX shape function

Definition at line 179 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter3x

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter3x
staticconstexpr
Initial value:
=
diffN_MBHEX3x(0.5, 0.5)

derivative of HEX shape function

Definition at line 181 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter3y

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter3y
staticconstexpr
Initial value:
=
diffN_MBHEX3y(0.5, 0.5)

derivative of quad shape function

Definition at line 183 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter3z

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter3z
staticconstexpr
Initial value:
=
diffN_MBHEX3z(0.5, 0.5)

derivative of quad shape function

Definition at line 185 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter4x

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter4x
staticconstexpr
Initial value:
=
diffN_MBHEX4x(0.5, 0.5)

derivative of HEX shape function

Definition at line 187 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter4y

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter4y
staticconstexpr
Initial value:
=
diffN_MBHEX4y(0.5, 0.5)

derivative of quad shape function

Definition at line 189 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter4z

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter4z
staticconstexpr
Initial value:
=
diffN_MBHEX4z(0.5, 0.5)

derivative of quad shape function

Definition at line 191 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter5x

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter5x
staticconstexpr
Initial value:
=
diffN_MBHEX5x(0.5, 0.5)

derivative of HEX shape function

Definition at line 193 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter5y

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter5y
staticconstexpr
Initial value:
=
diffN_MBHEX5y(0.5, 0.5)

derivative of quad shape function

Definition at line 195 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter5z

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter5z
staticconstexpr
Initial value:
=
diffN_MBHEX5z(0.5, 0.5)

derivative of quad shape function

Definition at line 197 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter6x

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter6x
staticconstexpr
Initial value:
=
diffN_MBHEX6x(0.5, 0.5)

derivative of HEX shape function

Definition at line 199 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter6y

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter6y
staticconstexpr
Initial value:
=
diffN_MBHEX6y(0.5, 0.5)

derivative of quad shape function

Definition at line 201 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter6z

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter6z
staticconstexpr
Initial value:
=
diffN_MBHEX6z(0.5, 0.5)

derivative of quad shape function

Definition at line 203 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter7x

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter7x
staticconstexpr
Initial value:
=
diffN_MBHEX7x(0.5, 0.5)

derivative of HEX shape function

Definition at line 205 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter7y

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter7y
staticconstexpr
Initial value:
=
diffN_MBHEX7y(0.5, 0.5)

derivative of quad shape function

Definition at line 207 of file Tools.hpp.

◆ diffShapeFunMBHEXAtCenter7z

constexpr double MoFEM::Tools::diffShapeFunMBHEXAtCenter7z
staticconstexpr
Initial value:
=
diffN_MBHEX7z(0.5, 0.5)

derivative of quad shape function

Definition at line 209 of file Tools.hpp.

◆ diffShapeFunMBQUADAtCenter

constexpr std::array< double, 8 > MoFEM::Tools::diffShapeFunMBQUADAtCenter
staticconstexpr

◆ diffShapeFunMBQUADAtCenter0x

constexpr double MoFEM::Tools::diffShapeFunMBQUADAtCenter0x
staticconstexpr
Initial value:

derivative of quad shape function

Definition at line 146 of file Tools.hpp.

◆ diffShapeFunMBQUADAtCenter0y

constexpr double MoFEM::Tools::diffShapeFunMBQUADAtCenter0y
staticconstexpr
Initial value:

derivative of quad shape function

Definition at line 148 of file Tools.hpp.

◆ diffShapeFunMBQUADAtCenter1x

constexpr double MoFEM::Tools::diffShapeFunMBQUADAtCenter1x
staticconstexpr
Initial value:

derivative of quad shape function

Definition at line 150 of file Tools.hpp.

◆ diffShapeFunMBQUADAtCenter1y

constexpr double MoFEM::Tools::diffShapeFunMBQUADAtCenter1y
staticconstexpr
Initial value:

derivative of quad shape function

Definition at line 152 of file Tools.hpp.

◆ diffShapeFunMBQUADAtCenter2x

constexpr double MoFEM::Tools::diffShapeFunMBQUADAtCenter2x
staticconstexpr
Initial value:

derivative of quad shape function

Definition at line 154 of file Tools.hpp.

◆ diffShapeFunMBQUADAtCenter2y

constexpr double MoFEM::Tools::diffShapeFunMBQUADAtCenter2y
staticconstexpr
Initial value:

derivative of quad shape function

Definition at line 156 of file Tools.hpp.

◆ diffShapeFunMBQUADAtCenter3x

constexpr double MoFEM::Tools::diffShapeFunMBQUADAtCenter3x
staticconstexpr
Initial value:

derivative of quad shape function

Definition at line 158 of file Tools.hpp.

◆ diffShapeFunMBQUADAtCenter3y

constexpr double MoFEM::Tools::diffShapeFunMBQUADAtCenter3y
staticconstexpr
Initial value:

derivative of quad shape function

Definition at line 160 of file Tools.hpp.

◆ diffShapeFunMBTET

constexpr std::array< double, 12 > MoFEM::Tools::diffShapeFunMBTET
staticconstexpr

◆ diffShapeFunMBTET0x

constexpr double MoFEM::Tools::diffShapeFunMBTET0x
staticconstexpr
Initial value:

derivative of tetrahedral shape function

Definition at line 246 of file Tools.hpp.

◆ diffShapeFunMBTET0y

constexpr double MoFEM::Tools::diffShapeFunMBTET0y
staticconstexpr
Initial value:

derivative of tetrahedral shape function

Definition at line 248 of file Tools.hpp.

◆ diffShapeFunMBTET0z

constexpr double MoFEM::Tools::diffShapeFunMBTET0z
staticconstexpr
Initial value:

derivative of tetrahedral shape function

Definition at line 250 of file Tools.hpp.

◆ diffShapeFunMBTET1x

constexpr double MoFEM::Tools::diffShapeFunMBTET1x
staticconstexpr
Initial value:

derivative of tetrahedral shape function

Definition at line 252 of file Tools.hpp.

◆ diffShapeFunMBTET1y

constexpr double MoFEM::Tools::diffShapeFunMBTET1y
staticconstexpr
Initial value:

derivative of tetrahedral shape function

Definition at line 254 of file Tools.hpp.

◆ diffShapeFunMBTET1z

constexpr double MoFEM::Tools::diffShapeFunMBTET1z
staticconstexpr
Initial value:

derivative of tetrahedral shape function

Definition at line 256 of file Tools.hpp.

◆ diffShapeFunMBTET2x

constexpr double MoFEM::Tools::diffShapeFunMBTET2x
staticconstexpr
Initial value:

derivative of tetrahedral shape function

Definition at line 258 of file Tools.hpp.

◆ diffShapeFunMBTET2y

constexpr double MoFEM::Tools::diffShapeFunMBTET2y
staticconstexpr
Initial value:

derivative of tetrahedral shape function

Definition at line 260 of file Tools.hpp.

◆ diffShapeFunMBTET2z

constexpr double MoFEM::Tools::diffShapeFunMBTET2z
staticconstexpr
Initial value:

derivative of tetrahedral shape function

Definition at line 262 of file Tools.hpp.

◆ diffShapeFunMBTET3x

constexpr double MoFEM::Tools::diffShapeFunMBTET3x
staticconstexpr
Initial value:

derivative of tetrahedral shape function

Definition at line 264 of file Tools.hpp.

◆ diffShapeFunMBTET3y

constexpr double MoFEM::Tools::diffShapeFunMBTET3y
staticconstexpr
Initial value:

derivative of tetrahedral shape function

Definition at line 266 of file Tools.hpp.

◆ diffShapeFunMBTET3z

constexpr double MoFEM::Tools::diffShapeFunMBTET3z
staticconstexpr
Initial value:

derivative of tetrahedral shape function

Definition at line 268 of file Tools.hpp.

◆ diffShapeFunMBTRI

constexpr std::array< double, 6 > MoFEM::Tools::diffShapeFunMBTRI
staticconstexpr

◆ diffShapeFunMBTRI0x

constexpr double MoFEM::Tools::diffShapeFunMBTRI0x
staticconstexpr
Initial value:

derivative of triangle shape function

Definition at line 91 of file Tools.hpp.

◆ diffShapeFunMBTRI0y

constexpr double MoFEM::Tools::diffShapeFunMBTRI0y
staticconstexpr
Initial value:

derivative of triangle shape function

Definition at line 93 of file Tools.hpp.

◆ diffShapeFunMBTRI1x

constexpr double MoFEM::Tools::diffShapeFunMBTRI1x
staticconstexpr
Initial value:

derivative of triangle shape function

Definition at line 95 of file Tools.hpp.

◆ diffShapeFunMBTRI1y

constexpr double MoFEM::Tools::diffShapeFunMBTRI1y
staticconstexpr
Initial value:

derivative of triangle shape function

Definition at line 97 of file Tools.hpp.

◆ diffShapeFunMBTRI2x

constexpr double MoFEM::Tools::diffShapeFunMBTRI2x
staticconstexpr
Initial value:

derivative of triangle shape function

Definition at line 99 of file Tools.hpp.

◆ diffShapeFunMBTRI2y

constexpr double MoFEM::Tools::diffShapeFunMBTRI2y
staticconstexpr
Initial value:

derivative of triangle shape function

Definition at line 101 of file Tools.hpp.

◆ shapeFunMBEDGE0At00

constexpr double MoFEM::Tools::shapeFunMBEDGE0At00 = N_MBEDGE0(0)
staticconstexpr

Definition at line 55 of file Tools.hpp.

◆ shapeFunMBEDGE1At00

constexpr double MoFEM::Tools::shapeFunMBEDGE1At00 = N_MBEDGE1(0)
staticconstexpr

Definition at line 56 of file Tools.hpp.

◆ shapeFunMBEDGEAt00

constexpr std::array< double, 2 > MoFEM::Tools::shapeFunMBEDGEAt00
staticconstexpr
Initial value:

Array of shape function at zero local point on reference element.

Definition at line 62 of file Tools.hpp.

◆ shapeFunMBTET0At000

constexpr double MoFEM::Tools::shapeFunMBTET0At000 = N_MBTET0(0, 0, 0)
staticconstexpr

Definition at line 293 of file Tools.hpp.

◆ shapeFunMBTET0AtOneThird

constexpr double MoFEM::Tools::shapeFunMBTET0AtOneThird
staticconstexpr
Initial value:
=
N_MBTET0(1. / 3., 1. / 3., 1. / 3.)

Definition at line 298 of file Tools.hpp.

◆ shapeFunMBTET1At000

constexpr double MoFEM::Tools::shapeFunMBTET1At000 = N_MBTET1(0, 0, 0)
staticconstexpr

Definition at line 294 of file Tools.hpp.

◆ shapeFunMBTET1AtOneThird

constexpr double MoFEM::Tools::shapeFunMBTET1AtOneThird
staticconstexpr
Initial value:
=
N_MBTET1(1. / 3., 1. / 3., 1. / 3.)

Definition at line 300 of file Tools.hpp.

◆ shapeFunMBTET2At000

constexpr double MoFEM::Tools::shapeFunMBTET2At000 = N_MBTET2(0, 0, 0)
staticconstexpr

Definition at line 295 of file Tools.hpp.

◆ shapeFunMBTET2AtOneThird

constexpr double MoFEM::Tools::shapeFunMBTET2AtOneThird
staticconstexpr
Initial value:
=
N_MBTET2(1. / 3., 1. / 3., 1. / 3.)

Definition at line 302 of file Tools.hpp.

◆ shapeFunMBTET3At000

constexpr double MoFEM::Tools::shapeFunMBTET3At000 = N_MBTET3(0, 0, 0)
staticconstexpr

Definition at line 296 of file Tools.hpp.

◆ shapeFunMBTET3AtOneThird

constexpr double MoFEM::Tools::shapeFunMBTET3AtOneThird
staticconstexpr
Initial value:
=
N_MBTET3(1. / 3., 1. / 3., 1. / 3.)

Definition at line 304 of file Tools.hpp.

◆ shapeFunMBTETAt000

constexpr std::array< double, 4 > MoFEM::Tools::shapeFunMBTETAt000
staticconstexpr
Initial value:

Array of shape function at zero local point on reference element.

Definition at line 330 of file Tools.hpp.

◆ shapeFunMBTETAtOneThird

constexpr std::array<double, 4> MoFEM::Tools::shapeFunMBTETAtOneThird
staticconstexpr
Initial value:

Array of shape function at center on reference element.

Definition at line 338 of file Tools.hpp.

◆ shapeFunMBTRI0At00

constexpr double MoFEM::Tools::shapeFunMBTRI0At00 = N_MBTRI0(0, 0)
staticconstexpr

Definition at line 112 of file Tools.hpp.

◆ shapeFunMBTRI1At00

constexpr double MoFEM::Tools::shapeFunMBTRI1At00 = N_MBTRI1(0, 0)
staticconstexpr

Definition at line 113 of file Tools.hpp.

◆ shapeFunMBTRI2At00

constexpr double MoFEM::Tools::shapeFunMBTRI2At00 = N_MBTRI2(0, 0)
staticconstexpr

Definition at line 114 of file Tools.hpp.

◆ shapeFunMBTRIAt00

constexpr std::array< double, 3 > MoFEM::Tools::shapeFunMBTRIAt00
staticconstexpr
Initial value:

Array of shape function at zero local point on reference element.

Definition at line 120 of file Tools.hpp.

◆ uniformTriangleRefineTriangles

constexpr std::array< int, 12 > MoFEM::Tools::uniformTriangleRefineTriangles
staticconstexpr
Initial value:
= {
0, 3, 5,
3, 1, 4,
5, 4, 2,
5, 3, 4
}

Definition at line 629 of file Tools.hpp.


The documentation for this struct was generated from the following files:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
MoFEM::Types::VectorDouble6
VectorBoundedArray< double, 6 > VectorDouble6
Definition: Types.hpp:95
MoFEM::Tools::diffShapeFunMBTET0z
static constexpr double diffShapeFunMBTET0z
derivative of tetrahedral shape function
Definition: Tools.hpp:250
MoFEM::Tools::shapeFunMBTET1At000
static constexpr double shapeFunMBTET1At000
Definition: Tools.hpp:294
MoFEM::Tools::diffShapeFunMBHEXAtCenter0y
static constexpr double diffShapeFunMBHEXAtCenter0y
derivative of HEX shape function
Definition: Tools.hpp:165
MoFEM::Tools::cOre
MoFEM::Core & cOre
Definition: Tools.hpp:24
diffN_MBTET3z
#define diffN_MBTET3z
derivative of tetrahedral shape function
Definition: fem_tools.h:43
MoFEM::Tools::diffShapeFunMBEDGE
static constexpr std::array< double, 2 > diffShapeFunMBEDGE
Definition: Tools.hpp:68
diffN_MBTRI0y
#define diffN_MBTRI0y
derivative of triangle shape function
Definition: fem_tools.h:50
diffN_MBHEX0y
#define diffN_MBHEX0y(x, z)
Definition: fem_tools.h:87
MoFEM::Tools::diffShapeFunMBQUADAtCenter1y
static constexpr double diffShapeFunMBQUADAtCenter1y
derivative of quad shape function
Definition: Tools.hpp:152
MoFEM::Tools::minDistancePointFromOnSegment
static SEGMENT_MIN_DISTANCE minDistancePointFromOnSegment(const double *w_ptr, const double *v_ptr, const double *p_ptr, double *const t_ptr=nullptr)
Find closet point on the segment from the point.
Definition: Tools.cpp:446
MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:82
MoFEM::Tools::diffShapeFunMBTRI0x
static constexpr double diffShapeFunMBTRI0x
derivative of triangle shape function
Definition: Tools.hpp:91
MoFEM::Tools::diffShapeFunMBHEXAtCenter0z
static constexpr double diffShapeFunMBHEXAtCenter0z
derivative of HEX shape function
Definition: Tools.hpp:167
diffN_MBQUAD1x
#define diffN_MBQUAD1x(y)
Definition: fem_tools.h:63
MoFEM::Tools::diffN_MBEDGE0x
static constexpr double diffN_MBEDGE0x
Definition: Tools.hpp:65
diffN_MBTRI2y
#define diffN_MBTRI2y
derivative of triangle shape function
Definition: fem_tools.h:54
FTensor::Tensor1< double, 3 >
MoFEM::Tools::shapeFunMBTET3AtOneThird
static constexpr double shapeFunMBTET3AtOneThird
Definition: Tools.hpp:304
MoFEM::Tools::diffShapeFunMBHEXAtCenter7y
static constexpr double diffShapeFunMBHEXAtCenter7y
derivative of quad shape function
Definition: Tools.hpp:207
EntityHandle
MoFEM::Tools::NO_SOLUTION
@ NO_SOLUTION
Definition: Tools.hpp:530
MoFEM::Tools::shapeFunMBEDGE0At00
static constexpr double shapeFunMBEDGE0At00
Definition: Tools.hpp:55
ShapeMBTET_inverse
PetscErrorCode ShapeMBTET_inverse(double *N, double *diffN, const double *elem_coords, const double *glob_coords, double *loc_coords)
calculate local coordinates for given global coordinates
Definition: fem_tools.c:335
diffN_MBHEX1z
#define diffN_MBHEX1z(x, y)
Definition: fem_tools.h:96
MoFEM::Tools::diffN_MBEDGE1x
static constexpr double diffN_MBEDGE1x
Definition: Tools.hpp:66
MoFEM::Tools::diffShapeFunMBQUADAtCenter3y
static constexpr double diffShapeFunMBQUADAtCenter3y
derivative of quad shape function
Definition: Tools.hpp:160
MoFEM::Tools::shapeFunMBTET2
static double shapeFunMBTET2(const double x, const double y, const double z)
Definition: Tools.hpp:729
MoFEM::Tools::diffShapeFunMBHEXAtCenter3x
static constexpr double diffShapeFunMBHEXAtCenter3x
derivative of HEX shape function
Definition: Tools.hpp:181
MoFEM::Tools::diffShapeFunMBQUADAtCenter1x
static constexpr double diffShapeFunMBQUADAtCenter1x
derivative of quad shape function
Definition: Tools.hpp:150
CHK_THROW_MESSAGE
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
Definition: definitions.h:609
MoFEM::Tools::diffShapeFunMBTET2x
static constexpr double diffShapeFunMBTET2x
derivative of tetrahedral shape function
Definition: Tools.hpp:258
diffN_MBHEX3x
#define diffN_MBHEX3x(y, z)
Definition: fem_tools.h:82
MoFEM::Tools::diffShapeFunMBTET2z
static constexpr double diffShapeFunMBTET2z
derivative of tetrahedral shape function
Definition: Tools.hpp:262
diffN_MBQUAD1y
#define diffN_MBQUAD1y(x)
Definition: fem_tools.h:64
QUAD_2D_TABLE
static QUAD *const QUAD_2D_TABLE[]
Definition: quad.h:175
MoFEM::Tools::diffShapeFunMBTET3x
static constexpr double diffShapeFunMBTET3x
derivative of tetrahedral shape function
Definition: Tools.hpp:264
MoFEM::Tools::getTetsWithQuality
MoFEMErrorCode getTetsWithQuality(Range &out_tets, const Range &tets, Tag th=nullptr, boost::function< bool(double)> f=[](double q) -> bool { if(q<=0) return true;else return false;})
Get the Tets With Quality.
Definition: Tools.cpp:244
lapack_dgesv
static __CLPK_integer lapack_dgesv(__CLPK_integer n, __CLPK_integer nrhs, __CLPK_doublereal *a, __CLPK_integer lda, __CLPK_integer *ipiv, __CLPK_doublereal *b, __CLPK_integer ldb)
Definition: lapack_wrap.h:176
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
MoFEM::Tools::diffShapeFunMBHEXAtCenter5z
static constexpr double diffShapeFunMBHEXAtCenter5z
derivative of quad shape function
Definition: Tools.hpp:197
MoFEM::Tools::shapeFunMBTET3
static double shapeFunMBTET3(const double x, const double y, const double z)
Definition: Tools.hpp:733
diffN_MBTET2z
#define diffN_MBTET2z
derivative of tetrahedral shape function
Definition: fem_tools.h:40
nb_levels
constexpr int nb_levels
Definition: level_set.cpp:58
MoFEM::Tools::shapeFunMBTRI1At00
static constexpr double shapeFunMBTRI1At00
Definition: Tools.hpp:113
MoFEM::Tools::diffShapeFunMBTET0y
static constexpr double diffShapeFunMBTET0y
derivative of tetrahedral shape function
Definition: Tools.hpp:248
MoFEM::th
Tag th
Definition: Projection10NodeCoordsOnField.cpp:122
diffN_MBQUAD2x
#define diffN_MBQUAD2x(y)
Definition: fem_tools.h:65
MoFEM::getLocalCoordinatesOnReferenceThreeNodeTriImpl
MoFEMErrorCode getLocalCoordinatesOnReferenceThreeNodeTriImpl(const T1 *elem_coords, const T2 *global_coords, const int nb_nodes, typename FTensor::promote< T1, T2 >::V *local_coords)
Definition: Tools.cpp:141
diffN_MBTET2y
#define diffN_MBTET2y
derivative of tetrahedral shape function
Definition: fem_tools.h:39
FTensor::Kronecker_Delta
Kronecker Delta class.
Definition: Kronecker_Delta.hpp:15
MoFEM::Tools::diffShapeFunMBTET
static constexpr std::array< double, 12 > diffShapeFunMBTET
Definition: Tools.hpp:271
MoFEM::Tools::shapeFunMBEDGEAt00
static constexpr std::array< double, 2 > shapeFunMBEDGEAt00
Array of shape function at zero local point on reference element.
Definition: Tools.hpp:62
N_MBEDGE0
#define N_MBEDGE0(x)
edge shape function
Definition: fem_tools.h:105
MoFEM::Tools::diffShapeFunMBQUADAtCenter0y
static constexpr double diffShapeFunMBQUADAtCenter0y
derivative of quad shape function
Definition: Tools.hpp:148
MoFEM::Tools::diffShapeFunMBHEXAtCenter0x
static constexpr double diffShapeFunMBHEXAtCenter0x
derivative of HEX shape function
Definition: Tools.hpp:163
MoFEM::Tools::diffShapeFunMBTET2y
static constexpr double diffShapeFunMBTET2y
derivative of tetrahedral shape function
Definition: Tools.hpp:260
J
FTensor::Index< 'J', DIM1 > J
Definition: level_set.cpp:30
MoFEM::Tools::diffShapeFunMBTET1y
static constexpr double diffShapeFunMBTET1y
derivative of tetrahedral shape function
Definition: Tools.hpp:254
MoFEM::Tools::shapeFunMBTRI0
static double shapeFunMBTRI0(const double x, const double y)
Definition: Tools.hpp:694
MoFEM::Tools::shapeFunMBEDGE1
static double shapeFunMBEDGE1(const double x)
Definition: Tools.hpp:677
FTensor::levi_civita
constexpr std::enable_if<(Dim0<=2 &&Dim1<=2), Tensor2_Expr< Levi_Civita< T >, T, Dim0, Dim1, i, j > >::type levi_civita(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
levi_civita functions to make for easy adhoc use
Definition: Levi_Civita.hpp:617
diffN_MBHEX5x
#define diffN_MBHEX5x(y, z)
Definition: fem_tools.h:84
MoFEM::Tools::diffShapeFunMBHEXAtCenter2z
static constexpr double diffShapeFunMBHEXAtCenter2z
derivative of HEX shape function
Definition: Tools.hpp:179
MoFEM::Tools::shapeFunMBEDGE0
static double shapeFunMBEDGE0(const double x)
Definition: Tools.hpp:673
MoFEM::Tools::diffShapeFunMBHEXAtCenter4y
static constexpr double diffShapeFunMBHEXAtCenter4y
derivative of quad shape function
Definition: Tools.hpp:189
diffN_MBHEX2y
#define diffN_MBHEX2y(x, z)
Definition: fem_tools.h:89
N_MBTET0
#define N_MBTET0(x, y, z)
tetrahedral shape function
Definition: fem_tools.h:28
MoFEM::Tools::diffShapeFunMBHEXAtCenter7z
static constexpr double diffShapeFunMBHEXAtCenter7z
derivative of quad shape function
Definition: Tools.hpp:209
zeta
double zeta
Viscous hardening.
Definition: plastic.cpp:126
FTensor::Tensor2
Definition: Tensor2_value.hpp:16
order
constexpr int order
Definition: dg_projection.cpp:18
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
MoFEM::Tools::getLocalCoordinatesOnReferenceEdgeNodeEdge
static MoFEMErrorCode getLocalCoordinatesOnReferenceEdgeNodeEdge(const double *elem_coords, const double *glob_coords, const int nb_nodes, double *local_coords)
Get the local coordinates on reference four node tet object.
Definition: Tools.cpp:203
ROW
@ ROW
Definition: definitions.h:136
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:2010
MoFEM::Tools::refineTriangleIntegrationPts
static MatrixDouble refineTriangleIntegrationPts(MatrixDouble pts, RefineTrianglesReturn refined)
generate integration points for refined triangle mesh for last level
MoFEM::Tools::diffShapeFunMBHEXAtCenter2y
static constexpr double diffShapeFunMBHEXAtCenter2y
derivative of HEX shape function
Definition: Tools.hpp:177
diffN_MBHEX5y
#define diffN_MBHEX5y(x, z)
Definition: fem_tools.h:92
MoFEM::Tools::diffShapeFunMBQUADAtCenter2x
static constexpr double diffShapeFunMBQUADAtCenter2x
derivative of quad shape function
Definition: Tools.hpp:154
c
const double c
speed of light (cm/ns)
Definition: initial_diffusion.cpp:39
QUAD_1D_TABLE
static QUAD *const QUAD_1D_TABLE[]
Definition: quad.h:164
MoFEM::Tools::getLocalCoordinatesOnReferenceThreeNodeTri
static MoFEMErrorCode getLocalCoordinatesOnReferenceThreeNodeTri(const double *elem_coords, const double *glob_coords, const int nb_nodes, double *local_coords)
Get the local coordinates on reference three node tri object.
Definition: Tools.cpp:188
MoFEM::Tools::diffShapeFunMBQUADAtCenter3x
static constexpr double diffShapeFunMBQUADAtCenter3x
derivative of quad shape function
Definition: Tools.hpp:158
N_MBTET3
#define N_MBTET3(x, y, z)
tetrahedral shape function
Definition: fem_tools.h:31
MoFEM::Tools::shapeFunMBTET1
static double shapeFunMBTET1(const double x, const double y, const double z)
Definition: Tools.hpp:725
FTensor::Number< 0 >
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
N_MBTET2
#define N_MBTET2(x, y, z)
tetrahedral shape function
Definition: fem_tools.h:30
diffN_MBTET2x
#define diffN_MBTET2x
derivative of tetrahedral shape function
Definition: fem_tools.h:38
MoFEM::CoreInterface::get_moab
virtual moab::Interface & get_moab()=0
MoFEM::Tools::uniformTriangleRefineTriangles
static constexpr std::array< int, 12 > uniformTriangleRefineTriangles
Definition: Tools.hpp:629
diffN_MBHEX1x
#define diffN_MBHEX1x(y, z)
Definition: fem_tools.h:80
N_MBEDGE1
#define N_MBEDGE1(x)
edge shape function
Definition: fem_tools.h:106
diffN_MBQUAD3x
#define diffN_MBQUAD3x(y)
Definition: fem_tools.h:67
a
constexpr double a
Definition: approx_sphere.cpp:30
diffN_MBHEX4z
#define diffN_MBHEX4z(x, y)
Definition: fem_tools.h:99
MoFEM::Tools::diffShapeFunMBQUADAtCenter2y
static constexpr double diffShapeFunMBQUADAtCenter2y
derivative of quad shape function
Definition: Tools.hpp:156
diffN_MBHEX2x
#define diffN_MBHEX2x(y, z)
Definition: fem_tools.h:81
double
diffN_MBTRI0x
#define diffN_MBTRI0x
derivative of triangle shape function
Definition: fem_tools.h:49
MoFEM::Tools::SEGMENT_ONE_IS_POINT
@ SEGMENT_ONE_IS_POINT
Definition: Tools.hpp:527
MoFEM::Tools::diffShapeFunMBHEXAtCenter5y
static constexpr double diffShapeFunMBHEXAtCenter5y
derivative of quad shape function
Definition: Tools.hpp:195
COL
@ COL
Definition: definitions.h:136
MoFEM::Tools::diffShapeFunMBTRI0y
static constexpr double diffShapeFunMBTRI0y
derivative of triangle shape function
Definition: Tools.hpp:93
diffN_MBHEX3z
#define diffN_MBHEX3z(x, y)
Definition: fem_tools.h:98
MoFEM::Tools::diffShapeFunMBQUADAtCenter0x
static constexpr double diffShapeFunMBQUADAtCenter0x
derivative of quad shape function
Definition: Tools.hpp:146
eta
double eta
Definition: free_surface.cpp:170
MoFEM::Tools::diffShapeFunMBTET0x
static constexpr double diffShapeFunMBTET0x
derivative of tetrahedral shape function
Definition: Tools.hpp:246
diffN_MBHEX2z
#define diffN_MBHEX2z(x, y)
Definition: fem_tools.h:97
QUAD_::npoints
int npoints
Definition: quad.h:29
MoFEM::Tools::diffShapeFunMBHEXAtCenter4z
static constexpr double diffShapeFunMBHEXAtCenter4z
derivative of quad shape function
Definition: Tools.hpp:191
diffN_MBHEX7x
#define diffN_MBHEX7x(y, z)
Definition: fem_tools.h:86
MoFEM::Tools::diffShapeFunMBTET3y
static constexpr double diffShapeFunMBTET3y
derivative of tetrahedral shape function
Definition: Tools.hpp:266
diffN_MBTRI2x
#define diffN_MBTRI2x
derivative of triangle shape function
Definition: fem_tools.h:53
MoFEM::Tools::diffShapeFunMBTRI1x
static constexpr double diffShapeFunMBTRI1x
derivative of triangle shape function
Definition: Tools.hpp:95
diffN_MBQUAD2y
#define diffN_MBQUAD2y(x)
Definition: fem_tools.h:66
diffN_MBTET3y
#define diffN_MBTET3y
derivative of tetrahedral shape function
Definition: fem_tools.h:42
diffN_MBHEX7y
#define diffN_MBHEX7y(x, z)
Definition: fem_tools.h:94
MoFEM::Tools::diffShapeFunMBTRI
static constexpr std::array< double, 6 > diffShapeFunMBTRI
Definition: Tools.hpp:104
QUAD_::points
double * points
Definition: quad.h:30
MoFEM::Tools::diffShapeFunMBTRI2y
static constexpr double diffShapeFunMBTRI2y
derivative of triangle shape function
Definition: Tools.hpp:101
MoFEM::type_from_handle
auto type_from_handle(const EntityHandle h)
get type from entity handle
Definition: Templates.hpp:1898
diffN_MBHEX5z
#define diffN_MBHEX5z(x, y)
Definition: fem_tools.h:100
MoFEM::Tools::shapeFunMBTRI0At00
static constexpr double shapeFunMBTRI0At00
Definition: Tools.hpp:112
MoFEM::Tools::diffShapeFunMBHEXAtCenter1x
static constexpr double diffShapeFunMBHEXAtCenter1x
derivative of HEX shape function
Definition: Tools.hpp:169
FTensor::Tensor4
Definition: Tensor4_value.hpp:18
MoFEM::Tools::getLocalCoordinatesOnReferenceFourNodeTet
static MoFEMErrorCode getLocalCoordinatesOnReferenceFourNodeTet(const double *elem_coords, const double *glob_coords, const int nb_nodes, double *local_coords)
Get the local coordinates on reference four node tet object.
Definition: Tools.cpp:88
diffN_MBHEX3y
#define diffN_MBHEX3y(x, z)
Definition: fem_tools.h:90
MoFEM::Tools::shapeFunMBTET2At000
static constexpr double shapeFunMBTET2At000
Definition: Tools.hpp:295
t
constexpr double t
plate stiffness
Definition: plate.cpp:58
MoFEM::Tools::SEGMENT_TWO_IS_POINT
@ SEGMENT_TWO_IS_POINT
Definition: Tools.hpp:528
diffN_MBQUAD0x
#define diffN_MBQUAD0x(y)
Definition: fem_tools.h:61
diffN_MBHEX1y
#define diffN_MBHEX1y(x, z)
Definition: fem_tools.h:88
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
t_kd
constexpr auto t_kd
Definition: free_surface.cpp:137
diffN_MBTET1z
#define diffN_MBTET1z
derivative of tetrahedral shape function
Definition: fem_tools.h:37
diffN_MBQUAD0y
#define diffN_MBQUAD0y(x)
Definition: fem_tools.h:62
diffN_MBTET0x
#define diffN_MBTET0x
derivative of tetrahedral shape function
Definition: fem_tools.h:32
FTensor::Index< 'i', 3 >
diffN_MBQUAD3y
#define diffN_MBQUAD3y(x)
Definition: fem_tools.h:68
MoFEM::Tools::shapeFunMBTET2AtOneThird
static constexpr double shapeFunMBTET2AtOneThird
Definition: Tools.hpp:302
MoFEM::Tools::shapeFunMBTET0AtOneThird
static constexpr double shapeFunMBTET0AtOneThird
Definition: Tools.hpp:298
convert.n
n
Definition: convert.py:82
MoFEM::Tools::diffShapeFunMBHEXAtCenter7x
static constexpr double diffShapeFunMBHEXAtCenter7x
derivative of HEX shape function
Definition: Tools.hpp:205
MoFEM::Tools::diffShapeFunMBHEXAtCenter5x
static constexpr double diffShapeFunMBHEXAtCenter5x
derivative of HEX shape function
Definition: Tools.hpp:193
N_MBTRI0
#define N_MBTRI0(x, y)
triangle shape function
Definition: fem_tools.h:46
diffN_MBHEX4y
#define diffN_MBHEX4y(x, z)
Definition: fem_tools.h:91
MoFEM::Tools::diffShapeFunMBTET1x
static constexpr double diffShapeFunMBTET1x
derivative of tetrahedral shape function
Definition: Tools.hpp:252
N
const int N
Definition: speed_test.cpp:3
diffN_MBTET0y
#define diffN_MBTET0y
derivative of tetrahedral shape function
Definition: fem_tools.h:33
diffN_MBHEX6x
#define diffN_MBHEX6x(y, z)
Definition: fem_tools.h:85
MoFEM::Tools::SEGMENT_TWO_AND_TWO_ARE_POINT
@ SEGMENT_TWO_AND_TWO_ARE_POINT
Definition: Tools.hpp:529
edge_coords
static const double edge_coords[6][6]
Definition: forces_and_sources_h1_continuity_check.cpp:18
MoFEM::determinantTensor3by3
static auto determinantTensor3by3(T &t)
Calculate the determinant of a 3x3 matrix or a tensor of rank 2.
Definition: Templates.hpp:1540
MoFEM::Tools::diffShapeFunMBHEXAtCenter6y
static constexpr double diffShapeFunMBHEXAtCenter6y
derivative of quad shape function
Definition: Tools.hpp:201
MoFEM::Tools::shapeFunMBTRI2
static double shapeFunMBTRI2(const double x, const double y)
Definition: Tools.hpp:702
v
const double v
phase velocity of light in medium (cm/ns)
Definition: initial_diffusion.cpp:40
diffN_MBHEX4x
#define diffN_MBHEX4x(y, z)
Definition: fem_tools.h:83
MoFEM::Tools::tetVolume
static double tetVolume(const double *coords)
Calculate volume of tetrahedron.
Definition: Tools.cpp:30
Range
QUAD_1D_TABLE_SIZE
#define QUAD_1D_TABLE_SIZE
Definition: quad.h:163
diffN_MBTET1x
#define diffN_MBTET1x
derivative of tetrahedral shape function
Definition: fem_tools.h:35
MoFEM::Tools::shapeFunMBTRI1
static double shapeFunMBTRI1(const double x, const double y)
Definition: Tools.hpp:698
FTensor::dd
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: ddTensor0.hpp:33
MoFEM::Tools::diffShapeFunMBTRI2x
static constexpr double diffShapeFunMBTRI2x
derivative of triangle shape function
Definition: Tools.hpp:99
MoFEM::Tools::shapeFunMBTET0
static double shapeFunMBTET0(const double x, const double y, const double z)
Definition: Tools.hpp:721
MoFEM::Tools::Tools
Tools(const MoFEM::Core &core)
Definition: Tools.hpp:25
diffN_MBTRI1y
#define diffN_MBTRI1y
derivative of triangle shape function
Definition: fem_tools.h:52
MoFEM::Tools::diffShapeFunMBHEXAtCenter1z
static constexpr double diffShapeFunMBHEXAtCenter1z
derivative of HEX shape function
Definition: Tools.hpp:173
N_MBTET1
#define N_MBTET1(x, y, z)
tetrahedral shape function
Definition: fem_tools.h:29
diffN_MBHEX6y
#define diffN_MBHEX6y(x, z)
Definition: fem_tools.h:93
FTensor::Tensor0
Definition: Tensor0.hpp:16
diffN_MBTET1y
#define diffN_MBTET1y
derivative of tetrahedral shape function
Definition: fem_tools.h:36
HenckyOps::f
auto f
Definition: HenckyOps.hpp:15
N_MBTRI1
#define N_MBTRI1(x, y)
triangle shape function
Definition: fem_tools.h:47
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
QUAD_::weights
double * weights
Definition: quad.h:31
MoFEM::Tools::diffShapeFunMBTET1z
static constexpr double diffShapeFunMBTET1z
derivative of tetrahedral shape function
Definition: Tools.hpp:256
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
ShapeDiffMBTET
PetscErrorCode ShapeDiffMBTET(double *diffN)
calculate derivatives of shape functions
Definition: fem_tools.c:319
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
diffN_MBHEX0z
#define diffN_MBHEX0z(x, y)
Definition: fem_tools.h:95
MoFEM::Tools::diffShapeFunMBHEXAtCenter3y
static constexpr double diffShapeFunMBHEXAtCenter3y
derivative of quad shape function
Definition: Tools.hpp:183
MoFEM::Tools::shapeFunMBEDGE1At00
static constexpr double shapeFunMBEDGE1At00
Definition: Tools.hpp:56
MoFEM::Types::MatrixDouble3by3
MatrixBoundedArray< double, 9 > MatrixDouble3by3
Definition: Types.hpp:105
diffN_MBTRI1x
#define diffN_MBTRI1x
derivative of triangle shape function
Definition: fem_tools.h:51
MoFEM::Tools::volumeLengthQuality
static double volumeLengthQuality(const double *coords)
Calculate tetrahedron volume length quality.
Definition: Tools.cpp:15
MoFEM::Tools::getEdgeLength
static double getEdgeLength(const double *edge_coords)
Get edge length.
Definition: Tools.cpp:415
diffN_MBHEX6z
#define diffN_MBHEX6z(x, y)
Definition: fem_tools.h:101
MoFEM::Tools::diffShapeFunMBTRI1y
static constexpr double diffShapeFunMBTRI1y
derivative of triangle shape function
Definition: Tools.hpp:97
sdf_wavy_2d.w
int w
Definition: sdf_wavy_2d.py:6
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
MoFEM::Tools::diffShapeFunMBTET3z
static constexpr double diffShapeFunMBTET3z
derivative of tetrahedral shape function
Definition: Tools.hpp:268
MoFEM::Tools::diffShapeFunMBHEXAtCenter6x
static constexpr double diffShapeFunMBHEXAtCenter6x
derivative of HEX shape function
Definition: Tools.hpp:199
MoFEM::Tools::diffShapeFunMBHEXAtCenter1y
static constexpr double diffShapeFunMBHEXAtCenter1y
derivative of HEX shape function
Definition: Tools.hpp:171
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
MoFEM::Tools::shapeFunMBTRI2At00
static constexpr double shapeFunMBTRI2At00
Definition: Tools.hpp:114
diffN_MBTET0z
#define diffN_MBTET0z
derivative of tetrahedral shape function
Definition: fem_tools.h:34
MoFEM::Tools::shapeFunMBTETAt000
static constexpr std::array< double, 4 > shapeFunMBTETAt000
Array of shape function at zero local point on reference element.
Definition: Tools.hpp:330
MoFEM::Tools::diffShapeFunMBHEXAtCenter6z
static constexpr double diffShapeFunMBHEXAtCenter6z
derivative of quad shape function
Definition: Tools.hpp:203
MoFEM::Tools::diffShapeFunMBHEXAtCenter2x
static constexpr double diffShapeFunMBHEXAtCenter2x
derivative of HEX shape function
Definition: Tools.hpp:175
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
MoFEM::Tools::shapeFunMBTET3At000
static constexpr double shapeFunMBTET3At000
Definition: Tools.hpp:296
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEM::Tools::getTriNormal
static MoFEMErrorCode getTriNormal(const double *coords, double *normal, double *d_normal=nullptr)
Get the Tri Normal objectGet triangle normal.
Definition: Tools.cpp:353
diffN_MBHEX7z
#define diffN_MBHEX7z(x, y)
Definition: fem_tools.h:102
MoFEM::Tools::SOLUTION_EXIST
@ SOLUTION_EXIST
Definition: Tools.hpp:526
MoFEM::Tools::diffShapeFunMBHEXAtCenter3z
static constexpr double diffShapeFunMBHEXAtCenter3z
derivative of quad shape function
Definition: Tools.hpp:185
MoFEM::Tools::diffShapeFunMBHEXAtCenter4x
static constexpr double diffShapeFunMBHEXAtCenter4x
derivative of HEX shape function
Definition: Tools.hpp:187
MoFEM::getFTensor3FromPtr< 3, 3, 3 >
FTensor::Tensor3< FTensor::PackPtr< double *, 27 >, 3, 3, 3 > getFTensor3FromPtr< 3, 3, 3 >(double *ptr)
Definition: Templates.hpp:1003
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
diffN_MBHEX0x
#define diffN_MBHEX0x(y, z)
Definition: fem_tools.h:79
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21
MOFEM_INVALID_DATA
@ MOFEM_INVALID_DATA
Definition: definitions.h:36
N_MBTRI2
#define N_MBTRI2(x, y)
triangle shape function
Definition: fem_tools.h:48
diffN_MBTET3x
#define diffN_MBTET3x
derivative of tetrahedral shape function
Definition: fem_tools.h:41
tol
double tol
Definition: mesh_smoothing.cpp:26
ShapeMBTET
PetscErrorCode ShapeMBTET(double *N, const double *G_X, const double *G_Y, const double *G_Z, int DIM)
calculate shape functions
Definition: fem_tools.c:306
MoFEM::Tools::shapeFunMBTET0At000
static constexpr double shapeFunMBTET0At000
Definition: Tools.hpp:293
MoFEM::Tools::shapeFunMBTET1AtOneThird
static constexpr double shapeFunMBTET1AtOneThird
Definition: Tools.hpp:300