 |
| v0.14.0
|
Go to the documentation of this file.
9 #ifndef __COMMINTERFACE_HPP__
10 #define __COMMINTERFACE_HPP__
23 inline static bool debug =
false;
24 inline static Sev sev = Sev::verbose;
66 const std::string &fe_name,
93 const std::string &fe_name,
110 const int num_entities,
111 const int owner_proc = 0,
125 const int owner_proc = 0,
139 const int owner_proc = 0,
185 std::map<int, Range> *received_ents,
248 const int adj_dim,
const int n_parts,
249 Tag *th_vertex_weights =
nullptr,
250 Tag *th_edge_weights =
nullptr,
251 Tag *th_part_weights =
nullptr,
261 using LoadFileFun = std::function<std::array<Range, 4>(
262 std::array<Range, 4> &&, std::vector<const CubitMeshSets *> &&)>;
264 static std::array<Range, 4>
266 std::vector<const CubitMeshSets *> &&vec_ptr) {
267 return proc_ents_skin;
283 const char *options =
"PARALLEL=BCAST;PARTITION=");
312 const int nb_coeffs,
Sev sev = Sev::verbose,
321 CHKERR VecGhostUpdateBegin(
v, ADD_VALUES, SCATTER_REVERSE);
322 CHKERR VecGhostUpdateEnd(
v, ADD_VALUES, SCATTER_REVERSE);
323 CHKERR VecGhostUpdateBegin(
v, INSERT_VALUES, SCATTER_FORWARD);
324 CHKERR VecGhostUpdateEnd(
v, INSERT_VALUES, SCATTER_FORWARD);
344 #endif //__COMMINTERFACE_HPP__
std::function< MoFEMErrorCode(Vec vec)> UpdateGhosts
std::function< std::array< Range, 4 >(std::array< Range, 4 > &&, std::vector< const CubitMeshSets * > &&)> LoadFileFun
static MoFEMErrorCode defaultUpdateGhosts(Vec v)
~CommInterface()=default
Destructor.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
static MoFEMErrorCode updateEntitiesPetscVector(moab::Interface &moab, EntitiesPetscVector &vec, Tag tag, UpdateGhosts update_gosts=defaultUpdateGhosts)
Exchange data between vector and data.
MoFEMErrorCode partitionMesh(const Range &ents, const int dim, const int adj_dim, const int n_parts, Tag *th_vertex_weights=nullptr, Tag *th_edge_weights=nullptr, Tag *th_part_weights=nullptr, int verb=VERBOSE, const bool debug=false)
Set partition tag to each finite element in the problem.
MoFEMErrorCode resolveParentEntities(const Range &ent, int verb=DEFAULT_VERBOSITY)
Synchronise parent entities.
DeprecatedCoreInterface Interface
static std::array< Range, 4 > defaultProcSkinFun(std::array< Range, 4 > &&proc_ents_skin, std::vector< const CubitMeshSets * > &&vec_ptr)
MoFEMErrorCode makeFieldEntitiesMultishared(const std::string field_name, const int owner_proc=0, int verb=DEFAULT_VERBOSITY)
make field entities multi shared
#define CHKERR
Inline error check.
implementation of Data Operators for Forces and Sources
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
MoFEMErrorCode resolveSharedFiniteElements(const Problem *problem_ptr, const std::string &fe_name, int verb=DEFAULT_VERBOSITY)
resolve shared entities for finite elements in the problem
MoFEMErrorCode synchroniseFieldEntities(const std::string name, int verb=DEFAULT_VERBOSITY)
std::pair< std::pair< Range, Range >, SmartPetscObj< Vec > > EntitiesPetscVector
static MoFEMErrorCode loadFileRootProcAllRestDistributed(moab::Interface &moab, const char *file_name, int dim, LoadFileFun proc_skin_fun=defaultProcSkinFun, const char *options="PARALLEL=BCAST;PARTITION=")
Root proc has whole mesh, other procs only part of it.
SeverityLevel
Severity levels.
constexpr auto field_name
MoFEMErrorCode synchroniseEntities(Range &ent, std::map< int, Range > *received_ents, int verb=DEFAULT_VERBOSITY)
synchronize entity range on processors (collective)
base class for all interface classes
const double v
phase velocity of light in medium (cm/ns)
static Range getPartEntities(moab::Interface &moab, int part)
CommInterface(const MoFEM::Core &core)
const FTensor::Tensor2< T, Dim, Dim > Vec
MoFEMErrorCode makeEntitiesMultishared(const EntityHandle *entities, const int num_entities, const int owner_proc=0, int verb=DEFAULT_VERBOSITY)
make entities from proc 0 shared on all proc
static EntitiesPetscVector createEntitiesPetscVector(MPI_Comm comm, moab::Interface &moab, int dim, const int nb_coeffs, Sev sev=Sev::verbose, int root_rank=0)
Create a ghost vector for exchanging data.
keeps basic data about problem
MoFEMErrorCode exchangeFieldData(const std::string field_name, int verb=DEFAULT_VERBOSITY)
Exchange field data.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...