|
| v0.14.0
|
Go to the documentation of this file.
7 static char help[] =
"...\n\n";
15 fract = modf(
n, &intp);
18 if (std::abs(intp) == 0) {
19 if (std::abs(fract) <=
RND_EPS) {
27 int main(
int argc,
char *argv[]) {
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) >>>>>"
139 dofs_view.insert(*dof_ptr);
141 for (DofEntity_multiIndex_uid_view::iterator dit = dofs_view.begin();
142 dit != dofs_view.end(); dit++) {
145 if ((*dit)->getDofCoeffIdx() == 0) {
147 double fval = (*dit)->getFieldData();
148 std::cout << boost::format(
"%.3lf") %
roundn(fval) <<
" ";
149 myfile << boost::format(
"%.3lf") %
roundn(fval) <<
" ";
151 if ((*dit)->getDofCoeffIdx() == 1) {
153 double fval = (*dit)->getFieldData();
154 std::cout << boost::format(
"%.3lf") %
roundn(fval) <<
" ";
155 myfile << boost::format(
"%.3lf") %
roundn(fval) <<
" ";
157 if ((*dit)->getDofCoeffIdx() == 2) {
159 double fval = (*dit)->getFieldData();
160 std::cout << boost::format(
"%.3lf") %
roundn(fval) << std::endl;
161 myfile << boost::format(
"%.3lf") %
roundn(fval) << std::endl;
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
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 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.
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
Projection of edge entities with one mid-node on hierarchical basis.
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.
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
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
int main(int argc, char *argv[])
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.
#define _IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP_(MFIELD, NAME, IT)
@ 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
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
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.
MoFEMErrorCode partitionGhostDofs(const std::string name, int verb=VERBOSE)
determine ghost nodes
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.
MoFEMErrorCode partitionProblem(const std::string name, int verb=VERBOSE)
partition problem dofs (collective)