Primarily this is used for testing if the code can handle user base. It is also, an example of how to build and use user approximation base. This is a test, so we used RT base by Demkowicz recipe.
Note that triple defines approximation element; element entity type, approximation space and approximation base. Entity type determines the integration method; approximation space determines the adjacency of the matrix and approximation base determines together with space the regularity of approximation.
namespace bio = boost::iostreams;
using bio::stream;
using bio::tee_device;
static PetscBool
quiet = PETSC_FALSE;
static char help[] =
"...\n\n";
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
}
boost::shared_ptr<BaseFunctionCtx> ctx_ptr) {
int nb_gauss_pts = pts.size2();
if (!nb_gauss_pts) {
}
if (pts.size1() < 3) {
"Wrong dimension of pts, should be at least 3 rows with "
"coordinates");
}
switch (cTx->sPace) {
CHKERR getValueHdivForCGGBubble(pts);
break;
default:
}
}
private:
"Wrong base, should be USER_BASE");
}
int nb_gauss_pts = pts.size2();
shapeFun.resize(nb_gauss_pts, 4, false);
&pts(2, 0), nb_gauss_pts);
double diff_shape_fun[12];
int p_f[4];
double *phi_f[4];
double *diff_phi_f[4];
for (int ff = 0; ff != 4; ff++) {
int order = volume_order > face_order ? volume_order : face_order;
phi_f[ff] = &*data.
dataOnEntities[MBTRI][ff].getN(base).data().begin();
diff_phi_f[ff] =
continue;
diff_shape_fun, phi_f[ff], diff_phi_f[ff], nb_gauss_pts, 4);
}
double *phi_v = &*data.
dataOnEntities[MBTET][0].getN(base).data().begin();
double *diff_phi_v =
volume_order, &*shapeFun.data().begin(), diff_shape_fun, p_f, phi_f,
diff_phi_f, phi_v, diff_phi_v, nb_gauss_pts);
}
for (int ff = 0; ff != 4; ff++) {
}
}
};
int main(
int argc,
char *argv[]) {
try {
PetscBool flg = PETSC_TRUE;
#if PETSC_VERSION_GE(3, 6, 4)
255, &flg);
#else
#endif
if (flg != PETSC_TRUE) {
"*** ERROR -my_file (MESH FILE NEEDED)");
}
const char *option;
option = "";
auto field_order_table =
const_cast<Field *
>(field_ptr)->getFieldOrderTable();
auto get_cgg_bubble_order_zero = [](int p) { return 0; };
auto get_cgg_bubble_order_face = [](int p) {
};
auto get_cgg_bubble_order_tet = [](int p) {
};
field_order_table[MBVERTEX] = get_cgg_bubble_order_zero;
field_order_table[MBEDGE] = get_cgg_bubble_order_zero;
field_order_table[MBTRI] = get_cgg_bubble_order_face;
field_order_table[MBTET] = get_cgg_bubble_order_tet;
const_cast<Field *
>(field_ptr)->rebuildDofsOrderMap();
for(
auto d = 0;
d!=10; ++
d) {
MOFEM_LOG(
"WORLD", Sev::noisy) <<
"dof " << dof_order_map[
d];
}
true);
"PROBLEM");
"PROBLEM");
"PROBLEM");
typedef tee_device<std::ostream, std::ofstream>
TeeDevice;
std::ofstream ofs("forces_and_sources_testing_users_base.txt");
MyOp1(const std::string &row_field, const std::string &col_field,
row_field, col_field,
type),
my_split(_my_split) {
sYmm = false;
}
}
my_split << rowFieldName << endl;
my_split <<
"side: " << side <<
" type: " <<
type << std::endl;
my_split << data << endl;
my_split << data.
getN() << endl;
my_split << endl;
}
}
MoFEMErrorCode doWork(
int row_side,
int col_side, EntityType row_type,
EntityType col_type,
my_split << rowFieldName << " : " << colFieldName << endl;
my_split << "row side: " << row_side << " row_type: " << row_type
<< std::endl;
my_split << "col side: " << col_side << " col_type: " << col_type
<< std::endl;
my_split << endl;
}
}
};
fe1.getUserPolynomialBase() =
fe1.getOpPtrVector().push_back(
new MyOp1("FILED_CGG", "FILED_CGG", my_split,
fe1.getOpPtrVector().push_back(
new MyOp1("FILED_CGG", "FILED_RT", my_split,
PETSC_NULL);
&fe1)) {
&fe1);
}
if (!TetPolynomialBase::switchCacheBaseInterior<HDIV>(
&fe1);
}
}
&fe1)) {
}
&fe1)) {
};
}
}
return 0;
}