![]() |
v0.15.0 |
Auxiliary tools. More...
#include "src/interfaces/Tools.hpp"
Public Member Functions | |
MoFEMErrorCode | query_interface (boost::typeindex::type_index type_index, UnknownInterface **iface) const |
Tools (const MoFEM::Core &core) | |
![]() | |
template<class IFACE > | |
MoFEMErrorCode | registerInterface (bool error_if_registration_failed=true) |
Register interface. | |
template<class IFACE > | |
MoFEMErrorCode | getInterface (IFACE *&iface) const |
Get interface reference to pointer of interface. | |
template<class IFACE > | |
MoFEMErrorCode | getInterface (IFACE **const iface) const |
Get interface pointer to pointer of interface. | |
template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0> | |
IFACE | getInterface () const |
Get interface pointer to pointer of interface. | |
template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0> | |
IFACE | getInterface () const |
Get reference to interface. | |
template<class IFACE > | |
IFACE * | getInterface () const |
Function returning pointer to interface. | |
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 MoFEMErrorCode | getLibVersion (Version &version) |
Get library version. | |
static MoFEMErrorCode | getFileVersion (moab::Interface &moab, Version &version) |
Get database major version. | |
static MoFEMErrorCode | setFileVersion (moab::Interface &moab, Version version=Version(MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD)) |
Get database major version. | |
static MoFEMErrorCode | getInterfaceVersion (Version &version) |
Get database major version. | |
Public Attributes | |
MoFEM::Core & | cOre |
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. | |
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 | |
static constexpr double | diffShapeFunMBTRI0y |
derivative of triangle shape function | |
static constexpr double | diffShapeFunMBTRI1x |
derivative of triangle shape function | |
static constexpr double | diffShapeFunMBTRI1y |
derivative of triangle shape function | |
static constexpr double | diffShapeFunMBTRI2x |
derivative of triangle shape function | |
static constexpr double | diffShapeFunMBTRI2y |
derivative of triangle shape function | |
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. | |
static constexpr double | diffShapeFunMBQUADAtCenter0x |
derivative of quad shape function | |
static constexpr double | diffShapeFunMBQUADAtCenter0y |
derivative of quad shape function | |
static constexpr double | diffShapeFunMBQUADAtCenter1x |
derivative of quad shape function | |
static constexpr double | diffShapeFunMBQUADAtCenter1y |
derivative of quad shape function | |
static constexpr double | diffShapeFunMBQUADAtCenter2x |
derivative of quad shape function | |
static constexpr double | diffShapeFunMBQUADAtCenter2y |
derivative of quad shape function | |
static constexpr double | diffShapeFunMBQUADAtCenter3x |
derivative of quad shape function | |
static constexpr double | diffShapeFunMBQUADAtCenter3y |
derivative of quad shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter0x |
derivative of HEX shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter0y |
derivative of HEX shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter0z |
derivative of HEX shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter1x |
derivative of HEX shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter1y |
derivative of HEX shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter1z |
derivative of HEX shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter2x |
derivative of HEX shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter2y |
derivative of HEX shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter2z |
derivative of HEX shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter3x |
derivative of HEX shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter3y |
derivative of quad shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter3z |
derivative of quad shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter4x |
derivative of HEX shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter4y |
derivative of quad shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter4z |
derivative of quad shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter5x |
derivative of HEX shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter5y |
derivative of quad shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter5z |
derivative of quad shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter6x |
derivative of HEX shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter6y |
derivative of quad shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter6z |
derivative of quad shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter7x |
derivative of HEX shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter7y |
derivative of quad shape function | |
static constexpr double | diffShapeFunMBHEXAtCenter7z |
derivative of quad shape function | |
static constexpr std::array< double, 8 > | diffShapeFunMBQUADAtCenter |
static constexpr std::array< double, 24 > | diffShapeFunMBHEXAtCenter |
static constexpr double | diffShapeFunMBTET0x |
derivative of tetrahedral shape function | |
static constexpr double | diffShapeFunMBTET0y |
derivative of tetrahedral shape function | |
static constexpr double | diffShapeFunMBTET0z |
derivative of tetrahedral shape function | |
static constexpr double | diffShapeFunMBTET1x |
derivative of tetrahedral shape function | |
static constexpr double | diffShapeFunMBTET1y |
derivative of tetrahedral shape function | |
static constexpr double | diffShapeFunMBTET1z |
derivative of tetrahedral shape function | |
static constexpr double | diffShapeFunMBTET2x |
derivative of tetrahedral shape function | |
static constexpr double | diffShapeFunMBTET2y |
derivative of tetrahedral shape function | |
static constexpr double | diffShapeFunMBTET2z |
derivative of tetrahedral shape function | |
static constexpr double | diffShapeFunMBTET3x |
derivative of tetrahedral shape function | |
static constexpr double | diffShapeFunMBTET3y |
derivative of tetrahedral shape function | |
static constexpr double | diffShapeFunMBTET3z |
derivative of tetrahedral shape function | |
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. | |
static constexpr std::array< double, 4 > | shapeFunMBTETAtOneThird |
Array of shape function at center on reference element. | |
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 | |
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. | |
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. | |
MoFEMErrorCode | getTriNormal (const EntityHandle tri, double *normal) const |
Get triangle normal. | |
double | getTriArea (const EntityHandle tri) const |
Get triangle area. | |
double | getEdgeLength (const EntityHandle edge) |
Get edge length. | |
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. | |
static double | volumeLengthQuality (const double *coords) |
Calculate tetrahedron volume length quality. | |
static double | tetVolume (const double *coords) |
Calculate volume of tetrahedron. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
static MoFEMErrorCode | checkIfPointIsInTet (const double tet_coords[], const double global_coord[], const double tol, bool &result) |
Check of point is in tetrahedral. | |
static MoFEMErrorCode | getTriNormal (const double *coords, double *normal, double *d_normal=nullptr) |
Get the Tri Normal objectGet triangle normal. | |
static double | getEdgeLength (const double *edge_coords) |
Get edge length. | |
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. | |
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. | |
Mesh refinement | |
using | RefineTrianglesReturn |
static constexpr std::array< int, 12 > | uniformTriangleRefineTriangles |
static RefineTrianglesReturn | refineTriangle (int nb_levels) |
create uniform triangle mesh of refined elements | |
static MatrixDouble | refineTriangleIntegrationPts (MatrixDouble pts, RefineTrianglesReturn refined) |
generate integration points for refined triangle mesh for last level | |
static MatrixDouble | refineTriangleIntegrationPts (int rule, RefineTrianglesReturn refined) |
generate integration points for refined triangle mesh for last level | |
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. | |
Enumerator | |
---|---|
SOLUTION_EXIST | |
SEGMENT_ONE_IS_POINT | |
SEGMENT_TWO_IS_POINT | |
SEGMENT_TWO_AND_TWO_ARE_POINT | |
NO_SOLUTION |
Definition at line 534 of file Tools.hpp.
|
inline |
|
static |
Check of point is in tetrahedral.
tet_coords | |
global_coord | |
tol | |
result |
Definition at line 287 of file Tools.cpp.
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.
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.
v_ptr | point coordinates |
nb | nb points |
edges | range of edges |
min_dist_ptr | on return minimal distance, on input starting distance |
o_ptr | coordinates of the point on edge |
o_segments | closest segments |
Definition at line 538 of file Tools.cpp.
Get edge length.
edge_coords |
double MoFEM::Tools::getEdgeLength | ( | const EntityHandle | edge | ) |
Get edge length.
edge |
Definition at line 428 of file Tools.cpp.
|
static |
Get the local coordinates on reference four node tet object.
elem_coords | Global element node coordinates |
glob_coords | Global coordinates |
nb_nodes | Number of points |
local_coords | Result |
Definition at line 203 of file Tools.cpp.
|
static |
Get the local coordinates on reference four node tet object.
elem_coords | Global element node coordinates |
glob_coords | Global coordinates |
nb_nodes | Number of points |
local_coords | Result |
Definition at line 88 of file Tools.cpp.
|
static |
Get the local coordinates on reference three node tri object.
elem_coords | Global element node coordinates |
glob_coords | Global coordinates |
nb_nodes | Number of points |
local_coords | Result |
d_elem_coords | Derivative of local coordinates |
d_global_coords |
Definition at line 188 of file Tools.cpp.
|
static |
Get the local coordinates on reference three node tri object.
elem_coords | Global element node coordinates |
glob_coords | Global coordinates |
nb_nodes | Number of points |
local_coords | Result |
d_elem_coords | Derivative of local coordinates |
d_global_coords |
Definition at line 195 of file Tools.cpp.
|
inlinestatic |
Definition at line 398 of file Tools.hpp.
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.
out_tets | |
tets | |
th | |
f |
Definition at line 244 of file Tools.cpp.
double MoFEM::Tools::getTriArea | ( | const EntityHandle | tri | ) | const |
Get triangle area.
tri |
Definition at line 408 of file Tools.cpp.
|
static |
Get the Tri Normal objectGet triangle normal.
coords | |
normal | |
d_normal | derivative, if pointer is null, derivative is not calculated |
In d_normal, format is 3rd rank tensor, first index is normal direction, second is node number, third is coordinate.
This is relation between tensor and pointer
Definition at line 353 of file Tools.cpp.
MoFEMErrorCode MoFEM::Tools::getTriNormal | ( | const EntityHandle | tri, |
double * | normal ) const |
Get triangle normal.
tri | |
normal |
Definition at line 391 of file Tools.cpp.
|
static |
Find points on two segments in closest distance.
w_ptr | |
v_ptr | |
k_ptr | |
l_ptr | |
tvw_ptr | |
tlk_ptr |
Definition at line 472 of file Tools.cpp.
|
static |
Find closet point on the segment from the point.
w_ptr | segment first vertex coordinate |
v_ptr | segment second vertex coordinate |
p_ptr | coordinate of point |
t_ptr | distance on the segment |
Definition at line 449 of file Tools.cpp.
MoFEMErrorCode MoFEM::Tools::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
tets | range |
min_quality | minimal quality |
Definition at line 49 of file Tools.cpp.
|
static |
Definition at line 662 of file Tools.cpp.
|
static |
Definition at line 613 of file Tools.cpp.
|
virtual |
|
static |
create uniform triangle mesh of refined elements
nb_levels |
Definition at line 724 of file Tools.cpp.
|
static |
generate integration points for refined triangle mesh for last level
rule | Gauss integration rule |
refined |
Definition at line 856 of file Tools.cpp.
|
static |
generate integration points for refined triangle mesh for last level
pts | |
refined |
Definition at line 791 of file Tools.cpp.
|
static |
Calculate shape functions on edge.
1 |
shape | shape functions |
ksi | pointer to first local coordinates |
nb | number of points |
Definition at line 691 of file Tools.hpp.
|
static |
Calculate shape functions on tetrahedron.
1 |
shape | shape functions |
ksi | pointer to first local coordinates |
eta | pointer to second local coordinates |
zeta | pointer to first third coordinates |
nb | number of points |
Definition at line 747 of file Tools.hpp.
|
static |
Calculate shape functions on triangle.
1 |
shape | shape functions |
ksi | pointer to first local coordinates |
eta | pointer to second local coordinates |
nb | number of points |
Definition at line 716 of file Tools.hpp.
Calculate volume of tetrahedron.
coords |
Definition at line 30 of file Tools.cpp.
Calculate tetrahedron volume length quality.
coords | tet coordinates |
Definition at line 15 of file Tools.cpp.
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.
file_name | |
file_type | |
options | |
tets | |
th | |
f |
Definition at line 269 of file Tools.cpp.
MoFEM::Core& MoFEM::Tools::cOre |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
Definition at line 68 of file Tools.hpp.
|
staticconstexpr |
Definition at line 218 of file Tools.hpp.
|
staticconstexpr |
derivative of HEX shape function
|
staticconstexpr |
derivative of HEX shape function
|
staticconstexpr |
derivative of HEX shape function
|
staticconstexpr |
derivative of HEX shape function
|
staticconstexpr |
derivative of HEX shape function
|
staticconstexpr |
derivative of HEX shape function
|
staticconstexpr |
derivative of HEX shape function
|
staticconstexpr |
derivative of HEX shape function
|
staticconstexpr |
derivative of HEX shape function
|
staticconstexpr |
derivative of HEX shape function
|
staticconstexpr |
derivative of quad shape function
|
staticconstexpr |
derivative of quad shape function
|
staticconstexpr |
derivative of HEX shape function
|
staticconstexpr |
derivative of quad shape function
|
staticconstexpr |
derivative of quad shape function
|
staticconstexpr |
derivative of HEX shape function
|
staticconstexpr |
derivative of quad shape function
|
staticconstexpr |
derivative of quad shape function
|
staticconstexpr |
derivative of HEX shape function
|
staticconstexpr |
derivative of quad shape function
|
staticconstexpr |
derivative of quad shape function
|
staticconstexpr |
derivative of HEX shape function
|
staticconstexpr |
derivative of quad shape function
|
staticconstexpr |
derivative of quad shape function
|
staticconstexpr |
|
staticconstexpr |
derivative of quad shape function
|
staticconstexpr |
derivative of quad shape function
|
staticconstexpr |
derivative of quad shape function
|
staticconstexpr |
derivative of quad shape function
|
staticconstexpr |
derivative of quad shape function
|
staticconstexpr |
derivative of quad shape function
|
staticconstexpr |
derivative of quad shape function
|
staticconstexpr |
derivative of quad shape function
|
staticconstexpr |
Definition at line 271 of file Tools.hpp.
|
staticconstexpr |
derivative of tetrahedral shape function
|
staticconstexpr |
derivative of tetrahedral shape function
|
staticconstexpr |
derivative of tetrahedral shape function
|
staticconstexpr |
derivative of tetrahedral shape function
|
staticconstexpr |
derivative of tetrahedral shape function
|
staticconstexpr |
derivative of tetrahedral shape function
|
staticconstexpr |
derivative of tetrahedral shape function
|
staticconstexpr |
derivative of tetrahedral shape function
|
staticconstexpr |
derivative of tetrahedral shape function
|
staticconstexpr |
derivative of tetrahedral shape function
|
staticconstexpr |
derivative of tetrahedral shape function
|
staticconstexpr |
derivative of tetrahedral shape function
|
staticconstexpr |
Definition at line 104 of file Tools.hpp.
|
staticconstexpr |
derivative of triangle shape function
|
staticconstexpr |
derivative of triangle shape function
|
staticconstexpr |
derivative of triangle shape function
|
staticconstexpr |
derivative of triangle shape function
|
staticconstexpr |
derivative of triangle shape function
|
staticconstexpr |
derivative of triangle shape function
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
Array of shape function at zero local point on reference element.
|
staticconstexpr |
Array of shape function at center on reference element.
|
staticconstexpr |
|
staticconstexpr |