8#ifndef __VOLUME_LENGTH_QUALITY_HPP__
9#define __VOLUME_LENGTH_QUALITY_HPP__
12#error "MoFEM need to be compiled with ADOL-C"
26 "QUALITY",
"BARRIER_AND_QUALITY",
"BARRIER_AND_CHANGE_QUALITY",
27 "BARRIER_AND_CHANGE_QUALITY_SCALED_BY_VOLUME"};
33template <
typename TYPE>
47 const std::string &
field_name =
"MESH_NODE_POSITIONS")
51 CHKERRABORT(PETSC_COMM_WORLD,
ierr);
56 PetscOptionsBegin(PETSC_COMM_WORLD,
"",
57 "Get VolumeLengthQuality material options",
60 "-volume_length_type",
"Volume length quality type",
"",
63 CHKERR PetscOptionsScalar(
"-volume_length_alpha",
64 "volume length alpha parameter",
"",
aLpha,
65 &
aLpha, PETSC_NULLPTR);
66 CHKERR PetscOptionsScalar(
"-volume_length_gamma",
67 "volume length parameter (barrier)",
"",
gAmma,
68 &
gAmma, PETSC_NULLPTR);
89 &coordsEdges[0 * 3 * 2 + 0], 1);
91 &coordsEdges[0 * 3 * 2 + 3], 1);
93 &coordsEdges[1 * 3 * 2 + 0], 1);
95 &coordsEdges[1 * 3 * 2 + 3], 1);
97 &coordsEdges[2 * 3 * 2 + 0], 1);
99 &coordsEdges[2 * 3 * 2 + 3], 1);
101 &coordsEdges[3 * 3 * 2 + 0], 1);
103 &coordsEdges[3 * 3 * 2 + 3], 1);
105 &coordsEdges[4 * 3 * 2 + 0], 1);
107 &coordsEdges[4 * 3 * 2 + 3], 1);
109 &coordsEdges[5 * 3 * 2 + 0], 1);
111 &coordsEdges[5 * 3 * 2 + 3], 1);
140 for (
int ee = 0; ee < 6; ee++) {
141 for (
int dd = 0; dd < 3; dd++) {
145 for (
int ii = 0; ii != 3; ++ii)
146 for (
int jj = 0; jj != 3; ++jj)
149 for (
int dd = 0; dd < 3; dd++) {
153 for (
int ii = 0; ii != 3; ++ii)
154 for (
int jj = 0; jj != 3; ++jj)
176 Q.resize(3, 3,
false);
211 detF = determinantTensor3by3(this->
F);
212 if (this->
invF.size1() != 3)
213 this->
invF.resize(3, 3);
215 CHKERR invertTensor3by3(this->
F, detF, this->
invF);
225 if (this->
P.size1() != 3)
226 this->
P.resize(3, 3);
231 noalias(this->
P) = q *
Q;
236 noalias(this->
P) = tMp *
Q;
241 noalias(this->
P) = tMp *
Q;
248 noalias(this->
P) = tMp *
Q;
static PetscErrorCode ierr
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
constexpr auto field_name
VectorDouble & getCoords()
nodal coordinates
double getVolume() const
element volume (linear geometry)
MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator * opPtr
pointer to finite element tetrahedral operator
CalculatePK1(const std::string field_name)
MatrixBoundedArray< TYPE, 9 > F
MatrixBoundedArray< TYPE, 9 > invF
MatrixBoundedArray< TYPE, 9 > P
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_invF
FTensor::Index< 'k', 3 > k
MoFEMErrorCode calculateQ()
Calculate Q.
ublas::vector< TYPE > deltaX
FTensor::Index< 'j', 3 > j
VolumeLengthQuality(VolumeLengthQualityType type, double alpha, double gamma, const std::string &field_name="MESH_NODE_POSITIONS")
FTensor::Index< 'i', 3 > i
MoFEMErrorCode getEdgesFromElemCoords()
virtual MoFEMErrorCode calculateP_PiolaKirchhoffI()
Volume Length Quality.
MoFEMErrorCode getMaterialOptions()
MoFEMErrorCode calculateLrms()
Calculate mean element edge length.
ublas::matrix< TYPE > dXdChiT
@ LASTOP_VOLUMELENGTHQUALITYTYPE
@ BARRIER_AND_CHANGE_QUALITY_SCALED_BY_VOLUME
@ BARRIER_AND_CHANGE_QUALITY
static const char * VolumeLengthQualityTypeNames[]