|
| v0.14.0
|
Go to the documentation of this file.
5 namespace bio = boost::iostreams;
11 static char help[] =
"...\n\n";
13 int main(
int argc,
char *argv[]) {
22 MPI_Comm_rank(PETSC_COMM_WORLD, &rank);
24 PetscBool flg = PETSC_TRUE;
26 #if PETSC_VERSION_GE(3, 6, 4)
33 if (flg != PETSC_TRUE) {
35 "*** ERROR -my_file (MESH FILE NEEDED)");
50 CHKERR moab.create_meshset(MESHSET_SET, meshset_level0);
63 const double coords[] = {0, 0, 0};
66 Range range_no_field_vertex;
67 range_no_field_vertex.insert(no_field_vertex);
71 CHKERR m_field.
get_moab().add_entities(meshset, range_no_field_vertex);
84 "MESH_NODE_POSITIONS");
91 "MESH_NODE_POSITIONS");
110 "MESH_NODE_POSITIONS");
163 typedef tee_device<std::ostream, std::ofstream>
TeeDevice;
166 std::ofstream ofs(
"forces_and_sources_testing_volume_element.txt");
176 my_split(_my_split) {}
181 my_split <<
"NH1" << std::endl;
182 my_split <<
"side: " << side <<
" type: " <<
type << std::endl;
183 my_split << data << std::endl;
184 my_split << std::setprecision(3) << getVolume() << std::endl;
185 my_split << std::setprecision(3) << getCoords() << std::endl;
186 my_split << std::setprecision(3) << getCoordsAtGaussPts() << std::endl;
190 MoFEMErrorCode doWork(
int row_side,
int col_side, EntityType row_type,
195 my_split <<
"NH1NH1" << std::endl;
196 my_split <<
"row side: " << row_side <<
" row_type: " << row_type
198 my_split << row_data << std::endl;
199 my_split <<
"NH1NH1" << std::endl;
200 my_split <<
"col side: " << col_side <<
" col_type: " << col_type
202 my_split << col_data << std::endl;
205 CHKERR getProblemRowIndices(
"FIELD1", row_type, row_side, row_indices);
206 CHKERR getProblemColIndices(
"FIELD2", col_type, col_side, col_indices);
208 if (row_indices.size() != row_data.
getIndices().size()) {
209 std::cerr << row_indices << std::endl;
210 std::cerr << row_data.
getIndices() << std::endl;
212 "row inconsistency %d != %d", row_indices.size(),
216 if (col_indices.size() != col_data.
getIndices().size()) {
218 "row inconsistency %d != %d", col_indices.size(),
222 for (
unsigned int rr = 0; rr < row_indices.size(); rr++) {
223 if (row_indices[rr] != row_data.
getIndices()[rr]) {
224 std::cerr << row_indices << std::endl;
225 std::cerr << row_data.
getIndices() << std::endl;
227 "row inconsistency");
231 for (
unsigned int cc = 0; cc < col_indices.size(); cc++) {
232 if (col_indices[cc] != col_data.
getIndices()[cc]) {
233 std::cerr << col_indices << std::endl;
234 std::cerr << col_data.
getIndices() << std::endl;
236 "row inconsistency");
250 my_split(_my_split) {
258 if (
type != MBENTITYSET)
261 my_split <<
"NOFIELD" << std::endl;
262 my_split <<
"side: " << side <<
" type: " <<
type << std::endl;
263 my_split << data << std::endl;
267 MoFEMErrorCode doWork(
int row_side,
int col_side, EntityType row_type,
275 if (row_type != MBENTITYSET)
278 my_split <<
"NOFILEDH1" << std::endl;
279 my_split <<
"row side: " << row_side <<
" row_type: " << row_type
281 my_split << row_data << std::endl;
282 my_split <<
"col side: " << col_side <<
" col_type: " << col_type
284 my_split << col_data << std::endl;
#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.
Data on single entity (This is passed as argument to DataOperator::doWork)
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.
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
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
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 EntityHandle get_field_meshset(const std::string name) const =0
get field meshset
@ OPROWCOL
operator doWork is executed on FE rows &columns
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
virtual moab::Interface & get_moab()=0
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.
friend class UserDataOperator
const VectorInt & getIndices() const
Get global indices of dofs on entity.
int main(int argc, char *argv[])
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string name_field)=0
set finite element field data
Volume finite element base.
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
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
UBlasVector< int > VectorInt
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
boost::ptr_deque< UserDataOperator > & getOpPtrVector()
Use to push back operator for row operator.
@ MOFEM_DATA_INCONSISTENCY
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
#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.
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.
@ NOFIELD
scalar or vector of scalars describe (no true field)
@ OPROW
operator doWork function is executed on FE rows