7static char help[] =
"...\n\n";
15 fract = modf(
n, &intp);
18 if (std::abs(intp) == 0) {
19 if (std::abs(fract) <=
RND_EPS) {
27int main(
int argc,
char *argv[]) {
33 moab::Core mb_instance;
34 moab::Interface &moab = mb_instance;
36 MPI_Comm_rank(PETSC_COMM_WORLD, &rank);
42 PetscBool flg = PETSC_TRUE;
44#if PETSC_VERSION_GE(3, 6, 4)
51 if (flg != PETSC_TRUE) {
52 SETERRQ(PETSC_COMM_SELF, 1,
"*** ERROR -my_file (MESH FILE NEEDED)");
69 "MESH_NODE_POSITIONS");
71 "MESH_NODE_POSITIONS");
73 "MESH_NODE_POSITIONS");
87 CHKERR moab.get_entities_by_type(0, MBTET, tets,
true);
89 CHKERR moab.get_entities_by_type(0, MBEDGE, edges,
true);
127 std::ofstream myfile;
128 myfile.open(
"10node_sphere.txt");
131 std::cout <<
"<<<< Dofs (X-Translation, Y-Translation, Z-Translation) >>>>>"
133 myfile <<
"<<<< Dofs (X-Translation, Y-Translation, Z-Translation) >>>>>"
140 dofs_view.insert(*dof_ptr);
142 for (DofEntity_multiIndex_uid_view::iterator dit = dofs_view.begin();
143 dit != dofs_view.end(); dit++) {
146 if ((*dit)->getDofCoeffIdx() == 0) {
148 double fval = (*dit)->getFieldData();
149 std::cout << boost::format(
"%.3lf") %
roundn(fval) <<
" ";
150 myfile << boost::format(
"%.3lf") %
roundn(fval) <<
" ";
152 if ((*dit)->getDofCoeffIdx() == 1) {
154 double fval = (*dit)->getFieldData();
155 std::cout << boost::format(
"%.3lf") %
roundn(fval) <<
" ";
156 myfile << boost::format(
"%.3lf") %
roundn(fval) <<
" ";
158 if ((*dit)->getDofCoeffIdx() == 2) {
160 double fval = (*dit)->getFieldData();
161 std::cout << boost::format(
"%.3lf") %
roundn(fval) << std::endl;
162 myfile << boost::format(
"%.3lf") %
roundn(fval) << std::endl;
#define CATCH_ERRORS
Catch errors.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
#define CHKERR
Inline error check.
FTensor::Index< 'n', SPACE_DIM > n
multi_index_container< boost::shared_ptr< DofEntity >, indexed_by< ordered_unique< const_mem_fun< DofEntity, UId, &DofEntity::getLocalUniqueId > > > > DofEntity_multiIndex_uid_view
multi-index view on DofEntity by uid
virtual const DofEntity_multiIndex * get_dofs() const =0
Get the dofs object.
#define _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD, NAME, IT)
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 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 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_row(const std::string &fe_name, const std::string name_row)=0
set field row 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.
MoFEMErrorCode partitionGhostDofs(const std::string name, int verb=VERBOSE)
determine ghost nodes
MoFEMErrorCode buildProblem(const std::string name, const bool square_matrix, int verb=VERBOSE)
build problem data structures
MoFEMErrorCode partitionProblem(const std::string name, int verb=VERBOSE)
partition problem dofs (collective)
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 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
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.
implementation of Data Operators for Forces and Sources
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
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.
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.
Problem manager is used to build and partition problems.
Projection of edge entities with one mid-node on hierarchical basis.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.