|
| v0.14.0
|
Go to the documentation of this file.
9 namespace bio = boost::iostreams;
11 using bio::tee_device;
13 using namespace MoFEM;
15 static char help[] =
"...\n\n";
17 int main(
int argc,
char *argv[]) {
26 MPI_Comm_rank(PETSC_COMM_WORLD, &rank);
28 PetscBool flg = PETSC_TRUE;
30 #if PETSC_VERSION_GE(3, 6, 4)
37 if (flg != PETSC_TRUE) {
38 SETERRQ(PETSC_COMM_SELF, 1,
"*** ERROR -my_file (MESH FILE NEEDED)");
53 CHKERR moab.create_meshset(MESHSET_SET, meshset_level0);
123 typedef tee_device<std::ostream, std::ofstream>
TeeDevice;
130 boost::shared_ptr<EntitiesFieldData> dataPtr;
131 boost::shared_ptr<DerivedEntitiesFieldData> derivedDataPtr;
135 ofs(
"forces_and_sources_getting_orders_indices_atom_test.txt"),
136 my_tee(std::cout, ofs), my_split(my_tee),
151 my_split <<
"\n\nNEXT ELEM\n\n";
153 CHKERR getSpacesAndBaseOnEntities(data);
155 CHKERR getEntitySense<MBEDGE>(data);
156 CHKERR getEntitySense<MBTRI>(data);
157 CHKERR getEntityDataOrder<MBEDGE>(data,
H1);
158 CHKERR getEntityDataOrder<MBTRI>(data,
H1);
159 CHKERR getEntityDataOrder<MBTET>(data,
H1);
160 CHKERR getFaceNodes(data);
163 for (
int gg = 0; gg < 4; gg++) {
174 const auto bn1 = mField.get_field_bit_number(
"FIELD1");
175 CHKERR getRowNodesIndices(data, bn1);
176 CHKERR getEntityFieldData(data, bn1, MBEDGE);
177 CHKERR getEntityRowIndices(data, bn1, MBEDGE);
178 CHKERR getNodesFieldData(data, bn1);
181 my_split <<
"FIELD1:\n";
182 my_split << data << std::endl;
186 const auto bn2 = mField.get_field_bit_number(
"FIELD2");
187 CHKERR getColNodesIndices(derived_data, bn2);
188 CHKERR getEntityFieldData(derived_data, bn2, MBEDGE);
189 CHKERR getEntityColIndices(derived_data, bn2, MBEDGE);
190 CHKERR getNodesFieldData(derived_data, bn2);
192 derived_data.
dataOnEntities[MBVERTEX][0].getFieldData().resize(0);
194 my_split <<
"FIELD2:\n";
195 my_split << derived_data << std::endl;
209 ForcesAndSourcesCore_TestFE fe1(m_field);
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
int main(int argc, char *argv[])
virtual MoFEMErrorCode loop_finite_elements(const std::string problem_name, const std::string &fe_name, FEMethod &method, boost::shared_ptr< NumeredEntFiniteElement_multiIndex > fe_ptr=nullptr, MoFEMTypes bh=MF_EXIST, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr(), int verb=DEFAULT_VERBOSITY)=0
Make a loop over finite elements.
MoFEMErrorCode buildProblem(const std::string name, const bool square_matrix, int verb=VERBOSE)
build problem data structures
Problem manager is used to build and partition problems.
Class used to pass element data to calculate base functions on tet,triangle,edge.
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
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
UBlasMatrix< double > MatrixDouble
this class derive data form other data structure
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
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.
Deprecated interface functions.
DeprecatedCoreInterface Interface
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
#define CHKERR
Inline error check.
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
implementation of Data Operators for Forces and Sources
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_finite_elements(int verb=DEFAULT_VERBOSITY)=0
Build finite elements.
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string name_field)=0
set finite element field data
MoFEMErrorCode partitionFiniteElements(const std::string name, bool part_from_moab=false, int low_proc=-1, int hi_proc=-1, int verb=VERBOSE)
partition finite elements
virtual MoFEMErrorCode modify_problem_ref_level_add_bit(const std::string &name_problem, const BitRefLevel &bit)=0
add ref level to problem
structure to get information form mofem into EntitiesFieldData
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
#define CATCH_ERRORS
Catch errors.
MoFEMErrorCode partitionSimpleProblem(const std::string name, int verb=VERBOSE)
partition problem dofs
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
virtual MoFEMErrorCode build_fields(int verb=DEFAULT_VERBOSITY)=0
MoFEMErrorCode getValue(MatrixDouble &pts, boost::shared_ptr< BaseFunctionCtx > ctx_ptr)
std::array< boost::ptr_vector< EntData >, MBMAXTYPE > dataOnEntities
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
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
virtual MoFEMErrorCode build_adjacencies(const Range &ents, int verb=DEFAULT_VERBOSITY)=0
build adjacencies
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
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.
data structure for finite element entity
MoFEMErrorCode partitionGhostDofs(const std::string name, int verb=VERBOSE)
determine ghost nodes
@ CONTINUOUS
Regular field.
virtual MoFEMErrorCode add_problem(const std::string &name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add problem.
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.
Calculate base functions on tetrahedral.