Testing edge elements nodesets.
namespace bio = boost::iostreams;
using bio::stream;
using bio::tee_device;
static char help[] =
"...\n\n";
int main(
int argc,
char *argv[]) {
try {
int rank;
MPI_Comm_rank(PETSC_COMM_WORLD, &rank);
PetscBool flg = PETSC_TRUE;
#if PETSC_VERSION_GE(3, 6, 4)
255, &flg);
#else
#endif
if (flg != PETSC_TRUE) {
SETERRQ(PETSC_COMM_SELF, 1, "*** ERROR -my_file (MESH FILE NEEDED)");
}
ParallelComm *pcomm = ParallelComm::get_pcomm(&moab,
MYPCOMM_INDEX);
if (pcomm == NULL)
pcomm = new ParallelComm(&moab, PETSC_COMM_WORLD);
const char *option;
option = "";
bit_level0.set(0);
0, 3, bit_level0);
enum bases { AINSWORTH, BERNSTEIN_BEZIER, LASBASETOP };
const char *list_bases[] = {"ainsworth", "bernstein_bezier"};
PetscInt choice_base_value = AINSWORTH;
LASBASETOP, &choice_base_value, &flg);
if (choice_base_value == AINSWORTH)
else if (choice_base_value == BERNSTEIN_BEZIER)
3);
auto add_field_to_fe = [&m_field](const std::string field_name) {
field_name);
};
CHKERR add_field_to_fe(
"FIELD1");
"MESH_NODE_POSITIONS");
EntityHandle root_set = moab.get_root_set();
"MESH_NODE_POSITIONS");
1);
Range tets;
CHKERR moab.get_entities_by_type(0, MBTET, tets,
false);
Range tets_skin;
CHKERR skin.find_skin(0, tets,
false, tets_skin);
Range tets_skin_edges;
CHKERR moab.get_adjacencies(tets_skin, 1,
false, tets_skin_edges,
moab::Interface::UNION);
"TEST_FE");
Projection10NodeCoordsOnField ent_method(m_field, "FIELD1");
}
{
Projection10NodeCoordsOnField ent_method(m_field, "MESH_NODE_POSITIONS");
}
ProblemsManager *prb_mng_ptr;
CHKERR prb_mng_ptr->buildProblem(
"TEST_PROBLEM",
true);
CHKERR prb_mng_ptr->partitionSimpleProblem(
"TEST_PROBLEM");
CHKERR prb_mng_ptr->partitionFiniteElements(
"TEST_PROBLEM");
CHKERR prb_mng_ptr->partitionGhostDofs(
"TEST_PROBLEM");
typedef tee_device<std::ostream, std::ofstream>
TeeDevice;
std::ofstream ofs(
(std ::string("forces_and_sources_testing_edge_element_") +
.c_str());
my_split(_my_split) {}
my_split << "NH1" << std::endl;
my_split <<
"side: " << side <<
" type: " <<
type << std::endl;
my_split << "data: " << data << std::endl;
my_split << "coords: " << std::setprecision(3) << getCoords()
<< std::endl;
my_split << "getCoordsAtGaussPts: " << std::setprecision(3)
<< getCoordsAtGaussPts() << std::endl;
my_split << "length: " << std::setprecision(3) << getLength()
<< std::endl;
my_split << "direction: " << std::setprecision(3) << getDirection()
<< std::endl;
int nb_gauss_pts = data.getN().size1();
for (int gg = 0; gg < nb_gauss_pts; gg++) {
my_split << "tangent " << gg << " " << getTangetAtGaussPts()
<< std::endl;
}
}
MoFEMErrorCode doWork(
int row_side,
int col_side, EntityType row_type,
EntityType col_type,
my_split << "ROW NH1NH1" << std::endl;
my_split << "row side: " << row_side << " row_type: " << row_type
<< std::endl;
my_split << row_data << std::endl;
my_split << "COL NH1NH1" << std::endl;
my_split << "col side: " << col_side << " col_type: " << col_type
<< std::endl;
my_split << col_data << std::endl;
}
};
fe1.getOpPtrVector().push_back(
fe1.getOpPtrVector().push_back(
}
return 0;
}
#define CATCH_ERRORS
Catch errors.
FieldApproximationBase
approximation base
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
@ AINSWORTH_BERNSTEIN_BEZIER_BASE
#define MYPCOMM_INDEX
default communicator number PCOMM
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
static const char *const ApproximationBaseNames[]
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
int main(int argc, char *argv[])
virtual MoFEMErrorCode modify_finite_element_add_field_row(const std::string &fe_name, const std::string &name_row)=0
set field row which finite element use
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
virtual MoFEMErrorCode build_finite_elements(int verb=DEFAULT_VERBOSITY)=0
Build finite elements.
virtual MoFEMErrorCode add_ents_to_finite_element_by_type(const EntityHandle entities, const EntityType type, const std::string &name, const bool recursive=true)=0
add entities to finite element
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string &name_filed)=0
set finite element field data
virtual MoFEMErrorCode modify_finite_element_add_field_col(const std::string &fe_name, const std::string &name_row)=0
set field col which finite element use
virtual MoFEMErrorCode build_fields(int verb=DEFAULT_VERBOSITY)=0
virtual MoFEMErrorCode set_field_order(const EntityHandle meshset, const EntityType type, const std::string &name, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)=0
Set order approximation of the entities in the field.
virtual MoFEMErrorCode add_ents_to_field_by_type(const Range &ents, const EntityType type, const std::string &name, int verb=DEFAULT_VERBOSITY)=0
Add entities to field meshset.
virtual MoFEMErrorCode loop_dofs(const Problem *problem_ptr, const std::string &field_name, RowColData rc, DofMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY)=0
Make a loop over dofs.
virtual MoFEMErrorCode modify_problem_add_finite_element(const std::string &name_problem, const std::string &fe_name)=0
add finite element to problem, this add entities assigned to finite element to a particular problem
virtual MoFEMErrorCode add_problem(const std::string &name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add problem.
virtual MoFEMErrorCode modify_problem_ref_level_add_bit(const std::string &name_problem, const BitRefLevel &bit)=0
add ref level to problem
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
implementation of Data Operators for Forces and Sources
PetscErrorCode PetscOptionsGetEList(PetscOptions *, const char pre[], const char name[], const char *const *list, PetscInt next, PetscInt *value, PetscBool *set)
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
DeprecatedCoreInterface Interface
DataForcesAndSourcesCore::EntData EntData
virtual MoFEMErrorCode build_adjacencies(const Range &ents, int verb=DEFAULT_VERBOSITY)=0
build adjacencies
virtual MoFEMErrorCode add_field(const std::string &name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add field.
virtual moab::Interface & get_moab()=0
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.
Deprecated interface functions.
DEPRECATED MoFEMErrorCode loop_finite_elements(const Problem *problem_ptr, const std::string &fe_name, FEMethod &method, int lower_rank, int upper_rank, MoFEMTypes bh, int verb=DEFAULT_VERBOSITY)
friend class UserDataOperator
MoFEMErrorCode getInterface(const MOFEMuuid &uuid, IFACE *&iface) const
Get interface by uuid and return reference to pointer of interface.