static char help[] =
"testing mesh cut test\n\n";
int main(
int argc,
char *argv[]) {
try {
auto test_tet = [&]() {
elem_coords(0, 0) = -1;
elem_coords(0, 1) = -1;
elem_coords(0, 2) = -1;
elem_coords(1, 0) = 2;
elem_coords(1, 1) = 0;
elem_coords(1, 2) = 0;
elem_coords(2, 0) = 0;
elem_coords(2, 1) = 1;
elem_coords(2, 2) = 0;
elem_coords(3, 0) = 0;
elem_coords(3, 1) = 0;
elem_coords(3, 2) = 1;
init_local_coords(0, 0) = 0;
init_local_coords(0, 1) = 0;
init_local_coords(0, 2) = 0;
init_local_coords(1, 0) = 0.5;
init_local_coords(1, 1) = 0;
init_local_coords(1, 2) = 0;
init_local_coords(2, 0) = 0;
init_local_coords(2, 1) = 0.5;
init_local_coords(2, 2) = 0;
init_local_coords(3, 0) = 0;
init_local_coords(3, 1) = 0;
init_local_coords(3, 2) = 0.5;
init_local_coords(4, 0) = 1. / 3.;
init_local_coords(4, 1) = 1. / 3.;
init_local_coords(4, 2) = 1. / 3.;
CHKERR Tools::shapeFunMBTET<3>(&shape(0, 0), &init_local_coords(0, 0),
&init_local_coords(0, 1),
&init_local_coords(0, 2), 5);
CHKERR Tools::getLocalCoordinatesOnReferenceFourNodeTet(
&elem_coords(0, 0), &global_coords(0, 0), init_local_coords.size1(),
&local_coords(0, 0));
for (
auto v : residual.data())
"Should be zer, but is v = %3.4e",
v);
};
auto test_tri = [&]() {
elem_coords(0, 0) = -1;
elem_coords(0, 1) = -1;
elem_coords(0, 2) = -1;
elem_coords(1, 0) = 2;
elem_coords(1, 1) = 0;
elem_coords(1, 2) = 0;
elem_coords(2, 0) = 0;
elem_coords(2, 1) = 1;
elem_coords(2, 2) = 0;
init_local_coords(0, 0) = 0;
init_local_coords(0, 1) = 0;
init_local_coords(1, 0) = 1;
init_local_coords(1, 1) = 0;
init_local_coords(2, 0) = 0;
init_local_coords(2, 1) = 1;
init_local_coords(3, 0) = 1. / 3.;
init_local_coords(3, 1) = 1. / 3.;
CHKERR Tools::shapeFunMBTRI<2>(&shape(0, 0), &init_local_coords(0, 0),
&init_local_coords(0, 1),
init_local_coords.size1());
MOFEM_LOG(
"SELF", Sev::verbose) <<
"tri shape " << shape;
MOFEM_LOG(
"SELF", Sev::verbose) <<
"tri global_coords " << global_coords;
CHKERR Tools::getLocalCoordinatesOnReferenceThreeNodeTri(
&elem_coords(0, 0), &global_coords(0, 0), init_local_coords.size1(),
&local_coords(0, 0));
for (
auto v : residual.data())
"Should be zer, but is v = %3.4e",
v);
};
auto test_edge = [&]() {
elem_coords(0, 0) = -1;
elem_coords(0, 1) = -1;
elem_coords(0, 2) = -1;
elem_coords(1, 0) = 2;
elem_coords(1, 1) = 0;
elem_coords(1, 2) = 0;
init_local_coords[0] = 0;
init_local_coords[1] = 1;
init_local_coords[2] = 0.5;
init_local_coords[4] = 0.25;
init_local_coords[5] = 0.75;
CHKERR Tools::shapeFunMBEDGE<1>(&shape(0, 0), &init_local_coords[0],
init_local_coords.size());
MOFEM_LOG(
"SELF", Sev::verbose) <<
"edge shape " << shape;
MOFEM_LOG(
"SELF", Sev::verbose) <<
"edge global_coords " << global_coords;
CHKERR Tools::getLocalCoordinatesOnReferenceEdgeNodeEdge(
&elem_coords(0, 0), &global_coords(0, 0), init_local_coords.size(),
&local_coords[0]);
for (
auto v : residual.data())
"Should be zer, but is v = %3.4e",
v);
};
}
return 0;
}
#define CATCH_ERRORS
Catch errors.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_ATOM_TEST_INVALID
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MOFEM_LOG(channel, severity)
Log.
const double v
phase velocity of light in medium (cm/ns)
UBlasMatrix< double > MatrixDouble
UBlasVector< double > VectorDouble
implementation of Data Operators for Forces and Sources
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.