MOAB: Mesh Oriented datABase
(version 5.4.1)
|
Calculate Jacobian matrices given vertex coordinates and MappingFunction. More...
#include <JacobianCalculator.hpp>
Public Member Functions | |
void | get_Jacobian_2D (const MappingFunction2D *mf, NodeSet ho_bits, Sample location, const Vector3D *vertex_coords, size_t num_vertex, MsqMatrix< 3, 2 > &J_out, MsqError &err) |
Calculate Jacobian for surface element. | |
void | get_Jacobian_3D (const MappingFunction3D *mf, NodeSet ho_bits, Sample location, const Vector3D *vertex_coords, size_t num_vertex, MsqMatrix< 3, 3 > &J_out, MsqError &err) |
Calculate Jacobian for volume element. | |
Private Types | |
enum | { MAX_ELEM_NODES = 27 } |
Private Attributes | |
size_t | mIndices [MAX_ELEM_NODES] |
MsqVector< 3 > | mDerivs3D [MAX_ELEM_NODES] |
MsqVector< 2 > | mDerivs2D [MAX_ELEM_NODES] |
Calculate Jacobian matrices given vertex coordinates and MappingFunction.
Definition at line 50 of file JacobianCalculator.hpp.
anonymous enum [private] |
Definition at line 88 of file JacobianCalculator.hpp.
{ MAX_ELEM_NODES = 27 };
void MBMesquite::JacobianCalculator::get_Jacobian_2D | ( | const MappingFunction2D * | mf, |
NodeSet | ho_bits, | ||
Sample | location, | ||
const Vector3D * | vertex_coords, | ||
size_t | num_vertex, | ||
MsqMatrix< 3, 2 > & | J_out, | ||
MsqError & | err | ||
) |
Calculate Jacobian for surface element.
Calculate the Jacobian matrix at a specified location in a surface element.
mf | The mapping function |
ho_bits | bit mask indicating which higher-order nodes are present in the element (zero for a linear element) |
location | Logical position within element at which to evaluate Jacobian |
J_out | The resulting Jacobian matrix. |
Definition at line 41 of file JacobianCalculator.cpp.
References MBMesquite::MappingFunction::convert_connectivity_indices(), MBMesquite::MappingFunction2D::derivatives(), mDerivs2D, mIndices, MSQ_ERRRTN, and MBMesquite::MsqMatrix< R, C >::set_column().
Referenced by LinearMappingFunctionTest::do_ideal_test(), TriLagrangeShapeTest::test_ideal_jacobian(), and QuadLagrangeShapeTest::test_ideal_jacobian().
{ size_t num_vtx = 0; mf->derivatives( location, ho_bits, mIndices, mDerivs2D, num_vtx, err );MSQ_ERRRTN( err ); mf->convert_connectivity_indices( num_type_vert, mIndices, num_vtx, err );MSQ_ERRRTN( err ); const MsqVector< 2 >* d = mDerivs2D; const size_t* const e = mIndices + num_vtx; Vector3D c[2] = { Vector3D( 0, 0, 0 ), Vector3D( 0, 0, 0 ) }; for( const size_t* i = mIndices; i != e; ++i, ++d ) { c[0] += ( *d )[0] * verts[*i]; c[1] += ( *d )[1] * verts[*i]; } J_out.set_column( 0, MsqMatrix< 3, 1 >( c[0].to_array() ) ); J_out.set_column( 1, MsqMatrix< 3, 1 >( c[1].to_array() ) ); }
void MBMesquite::JacobianCalculator::get_Jacobian_3D | ( | const MappingFunction3D * | mf, |
NodeSet | ho_bits, | ||
Sample | location, | ||
const Vector3D * | vertex_coords, | ||
size_t | num_vertex, | ||
MsqMatrix< 3, 3 > & | J_out, | ||
MsqError & | err | ||
) |
Calculate Jacobian for volume element.
Calculate the Jacobian matrix at a specified location in a volume element.
mf | The mapping function |
ho_bits | bit mask indicating which higher-order nodes are present in the element (zero for a linear element) |
location | Logical position within element at which to evaluate Jacobian |
J_out | The resulting Jacobian matrix. |
Definition at line 64 of file JacobianCalculator.cpp.
References MBMesquite::MappingFunction::convert_connectivity_indices(), MBMesquite::MappingFunction3D::derivatives(), mDerivs3D, mIndices, MSQ_ERRRTN, and MBMesquite::MsqMatrix< R, C >::set_column().
Referenced by LinearMappingFunctionTest::do_ideal_test(), and TetLagrangeShapeTest::test_ideal_jacobian().
{ size_t num_vtx = 0; mf->derivatives( location, ho_bits, mIndices, mDerivs3D, num_vtx, err );MSQ_ERRRTN( err ); mf->convert_connectivity_indices( num_type_vert, mIndices, num_vtx, err );MSQ_ERRRTN( err ); const MsqVector< 3 >* d = mDerivs3D; const size_t* const e = mIndices + num_vtx; Vector3D c[3] = { Vector3D( 0, 0, 0 ), Vector3D( 0, 0, 0 ), Vector3D( 0, 0, 0 ) }; for( const size_t* i = mIndices; i != e; ++i, ++d ) { c[0] += ( *d )[0] * verts[*i]; ; c[1] += ( *d )[1] * verts[*i]; ; c[2] += ( *d )[2] * verts[*i]; ; } J_out.set_column( 0, MsqMatrix< 3, 1 >( c[0].to_array() ) ); J_out.set_column( 1, MsqMatrix< 3, 1 >( c[1].to_array() ) ); J_out.set_column( 2, MsqMatrix< 3, 1 >( c[2].to_array() ) ); }
MsqVector< 2 > MBMesquite::JacobianCalculator::mDerivs2D[MAX_ELEM_NODES] [private] |
Definition at line 94 of file JacobianCalculator.hpp.
Referenced by get_Jacobian_2D().
MsqVector< 3 > MBMesquite::JacobianCalculator::mDerivs3D[MAX_ELEM_NODES] [private] |
Definition at line 93 of file JacobianCalculator.hpp.
Referenced by get_Jacobian_3D().
size_t MBMesquite::JacobianCalculator::mIndices[MAX_ELEM_NODES] [private] |
Definition at line 92 of file JacobianCalculator.hpp.
Referenced by get_Jacobian_2D(), and get_Jacobian_3D().