Construct the DMs and matrices without running validation or test fills.
212 {
231 1);
236 }
244 if (!update || refresh_registration) {
245 Range new_field_entities;
247
248
249 for (
const auto &
name : {
"BROKEN",
"U",
"HYBRID"}) {
252 registered);
253 const auto &keep = std::string(
name) ==
"HYBRID" ? skeleton : entities;
254 const auto removed = subtract(registered, keep);
257 registered = intersect(registered, keep);
258 const int dim = std::string(
name) ==
"HYBRID" ? 2 : 3;
259 const auto added = subtract(keep.subset_by_dimension(dim), registered);
261 CHKERR comm_ptr->synchroniseFieldEntities(
name, 0);
264 current);
265
266
267 const auto new_entities =
268 update ? subtract(current, registered) : current;
269 if (!new_entities.empty())
273 new_field_entities.merge(new_entities);
274 }
275 for (
const auto &[
name, keep] :
280 continue;
284 const auto removed = subtract(registered, keep);
287 }
288 if (!update)
292
293
296 }
297 if (!update)
299 if (update) {
303 const auto from_fields = problems_ptr->buildProblemFromFields;
304 problems_ptr->buildProblemFromFields = PETSC_TRUE;
307 problems_ptr->buildProblemFromFields = from_fields;
309 } else
316 if (reuse)
318 else {
321 }
323 if (reuse)
326 else
329 {nullptr, nullptr}, true);
333 }
std::vector< int > removed
@ L2
field with C-1 continuity
@ HDIV
field with continuous normal traction
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
PetscErrorCode DMMoFEMRebuildProblem(DM dm, const MoFEM::BitRefLevel target_bit, const MoFEM::BitRefLevel target_mask, IS *old_row_indices=PETSC_NULLPTR, IS *new_row_indices=PETSC_NULLPTR)
Rebuild the DM's parent problem in place on a new bit ref level.
virtual EntityHandle get_finite_element_meshset(const std::string name) const =0
virtual MoFEMErrorCode build_fields(int verb=DEFAULT_VERBOSITY)=0
virtual MoFEMErrorCode add_ents_to_field_by_dim(const Range &ents, const int dim, const std::string &name, int verb=DEFAULT_VERBOSITY)=0
Add entities to field meshset.
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 remove_ents_from_field(const std::string name, const EntityHandle meshset, const EntityType type, int verb=DEFAULT_VERBOSITY)=0
remove entities from field
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
std::pair< SmartPetscObj< Mat >, boost::shared_ptr< NestSchurData > > createSchurNestedMatrix(boost::shared_ptr< NestSchurData > schur_net_data_ptr)
Create a Mat Diag Blocks object.
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
auto createDMHybridisedL2Matrix(DM dm)
Get smart hybridised L2 matrix from DM.
boost::shared_ptr< BlockStructure > createBlockMatStructure(DM dm, SchurFEOpsFEandFields schur_fe_op_vec)
Create block matrix structure.
boost::shared_ptr< NestSchurData > createSchurNestedMatrixStruture(std::pair< SmartPetscObj< DM >, SmartPetscObj< DM > > dms, boost::shared_ptr< BlockStructure > block_mat_data_ptr, std::vector< std::string > fields_names, std::vector< boost::shared_ptr< Range > > field_ents, bool add_preconditioner_block)
Create structure of nested matrix [A11 A10; A01 A00].
MoFEMErrorCode rebuildSchurNestedMatrixStruture(std::pair< SmartPetscObj< DM >, SmartPetscObj< DM > > dms, boost::shared_ptr< NestSchurData > nest_data_ptr)
Rebuild a nested Schur structure after rebuildBlockMatStructure.
MoFEMErrorCode rebuildBlockMatStructure(DM dm, SchurFEOpsFEandFields schur_fe_op_vec, boost::shared_ptr< BlockStructure > data_ptr)
Rebuild a block matrix structure after its problem changed.
SchurShellMatData createBlockMat(DM dm, boost::shared_ptr< BlockStructure > data)
Create a Schur Mat object.
MoFEMErrorCode buildSubProblem(const char *name, const std::vector< std::string > &fields, SmartPetscObj< DM > &dm)
Rebuild subproblem numbering while keeping its DM and field selection.
boost::shared_ptr< NestSchurData > nestedDataPtr
PetscBool checkRebuiltStructures
SmartPetscObj< Mat > blockMatPtr
SmartPetscObj< DM > blockDMPtr
MoFEMErrorCode prepareUpdate()
Release numeric objects and cached vectors before topology edits.
SmartPetscObj< Mat > nestedMatPtr
boost::shared_ptr< BlockStructure > blockDataPtr
PetscBool rebuildStructures
SchurFEOpsFEandFields getBlockOperations() const
Couplings used by both construction and the optional fresh-build oracle.
SmartPetscObj< DM > schurDMPtr
SmartPetscObj< Mat > hybridMatPtr
virtual moab::Interface & get_moab()=0
virtual EntityHandle get_field_meshset(const std::string name) const =0
get field meshset
virtual bool check_finite_element(const std::string &name) const =0
Check if finite element is in database.
virtual MoFEMErrorCode build_adjacencies(const Range &ents, int verb=DEFAULT_VERBOSITY)=0
build adjacencies
virtual MoFEMErrorCode remove_ents_from_finite_element(const std::string name, const EntityHandle meshset, const EntityType type, int verb=DEFAULT_VERBOSITY)=0
remove entities from given refinement level to finite element database
MoFEMErrorCode buildProblem()
Build problem.
MoFEMErrorCode addDomainField(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_ZERO, int verb=-1)
Add field on domain.
bool & getAddBoundaryFE()
Get the addBoundaryFE flag.
MoFEMErrorCode defineFiniteElements()
Define finite elements.
EntityHandle & getMeshset()
Get the MeshSet object.
auto & getBitAdjParent()
Get bit ref level for parent.
MoFEMErrorCode buildFiniteElements()
Build finite elements.
const std::string getSkeletonFEName() const
Get the Skeleton FE Name.
EntityHandle & getSkeletonMeshSet()
Get the SkeletonMeshSet object.
void setDim(int dim)
Set the problem dimension.
MoFEMErrorCode getDM(DM *dm)
Get DM.
auto & getBitAdjEnt()
Get bit ref level for entities.
MoFEMErrorCode setFieldOrder(const std::string field_name, const int order, const Range *ents=NULL)
Set field order.
MoFEMErrorCode defineProblem(const PetscBool is_partitioned=PETSC_TRUE)
define problem
BitRefLevel & getBitRefLevelMask()
Get the BitRefLevelMask.
const std::string getDomainFEName() const
Get the Domain FE Name.
MoFEMErrorCode setSkeletonAdjacency(int dim=-1, std::string fe_name="")
Set the skeleton adjacency object.
BitRefLevel & getBitRefLevel()
Get the BitRefLevel.
MoFEMErrorCode addDomainBrokenField(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_ZERO, int verb=-1)
Add broken field on domain.
MoFEMErrorCode addSkeletonField(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_ZERO, int verb=-1)
Add field on skeleton.