20#ifndef __PROBLEMSMULTIINDICES_HPP__
21#define __PROBLEMSMULTIINDICES_HPP__
72 mutable boost::shared_ptr<NumeredDofEntity_multiIndex>
74 mutable boost::shared_ptr<NumeredDofEntity_multiIndex>
76 mutable boost::shared_ptr<NumeredEntFiniteElement_multiIndex>
99 struct SubProblemData;
111 inline boost::shared_ptr<SubProblemData> &
getSubData()
const {
141 const int field_bit_number,
const EntityHandle ent,
const int ent_dof_idx,
143 boost::shared_ptr<NumeredDofEntity> &dof_ptr)
const;
154#define _IT_NUMEREDFE_BY_NAME_FOR_LOOP_(PROBLEMPTR, NAME, IT) \
155 auto IT = PROBLEMPTR->getNumeredFEsBegin(NAME); \
156 IT != PROBLEMPTR->getNumeredFEsEnd(NAME); \
161 .lower_bound(fe_name);
166 .upper_bound(fe_name);
180#define _IT_NUMEREDDOF_ROW_FOR_LOOP_(PROBLEMPTR, IT) \
181 NumeredDofEntity_multiIndex::iterator IT = \
182 PROBLEMPTR->getNumeredRowDofsBegin(); \
183 IT != PROBLEMPTR->getNumeredRowDofsEnd(); \
197#define _IT_NUMEREDDOF_COL_FOR_LOOP_(PROBLEMPTR, IT) \
198 NumeredDofEntity_multiIndex::iterator IT = \
199 PROBLEMPTR->getNumeredColDofsBegin(); \
200 IT != PROBLEMPTR->getNumeredColDofsEnd(); \
238#define _IT_NUMEREDDOF_ROW_BY_LOCIDX_FOR_LOOP_(PROBLEMPTR, IT) \
239 NumeredDofEntityByLocalIdx::iterator IT = \
240 PROBLEMPTR->getNumeredRowDofsByLocIdxBegin(0); \
241 IT != PROBLEMPTR->getNumeredRowDofsByLocIdxEnd( \
242 PROBLEMPTR->getNbLocalDofsRow() - 1); \
255#define _IT_NUMEREDDOF_COL_BY_LOCIDX_FOR_LOOP_(PROBLEMPTR, IT) \
256 NumeredDofEntityByUId::iterator IT = \
257 PROBLEMPTR->getNumeredColDofsByLocIdxBegin(0); \
258 IT != PROBLEMPTR->getNumeredColDofsByLocIdxEnd( \
259 PROBLEMPTR->getNbLocalDofsRow() - 1); \
297#define _IT_NUMEREDDOF_ROW_BY_ENT_FOR_LOOP_(PROBLEMPTR, ENT, IT) \
298 auto IT = PROBLEMPTR->getNumeredRowDofsByEntBegin(ENT); \
299 IT != PROBLEMPTR->getNumeredRowDofsByEntEnd(ENT); \
313#define _IT_NUMEREDDOF_COL_BY_ENT_FOR_LOOP_(PROBLEMPTR, ENT, IT) \
314 auto IT = PROBLEMPTR->getNumeredColDofsByEntBegin(ENT); \
315 IT != PROBLEMPTR->getNumeredColDofsByEntEnd(ENT); \
354#define _IT_NUMEREDDOF_ROW_BY_BITNUMBER_FOR_LOOP_(PROBLEMPTR, \
355 FIELD_BIT_NUMBER, IT) \
356 auto IT = PROBLEMPTR->numeredRowDofsPtr->lower_bound( \
357 FieldEntity::getLoBitNumberUId(FIELD_BIT_NUMBER)); \
358 IT != PROBLEMPTR->numeredRowDofsPtr->upper_bound( \
359 FieldEntity::getHiBitNumberUId(FIELD_BIT_NUMBER)); \
374#define _IT_NUMEREDDOF_COL_BY_BITNUMBER_FOR_LOOP_(PROBLEMPTR, \
375 FIELD_BIT_NUMBER, IT) \
376 auto IT = PROBLEMPTR->numeredColDofsPtr->lower_bound( \
377 FieldEntity::getLoBitNumberUId(FIELD_BIT_NUMBER)); \
378 IT != PROBLEMPTR->numeredColDofsPtr->upper_bound( \
379 FieldEntity::getHiBitNumberUId(FIELD_BIT_NUMBER)); \
436 boost::weak_ptr<NumeredDofEntity>
445 boost::weak_ptr<NumeredDofEntity>
476 const std::string name,
477 PetscLayout *layout)
const;
502 PetscLayout *layout)
const;
504 typedef multi_index_container<boost::weak_ptr<std::vector<NumeredDofEntity>>,
505 indexed_by<sequenced<>>>
606 PetscObjectReference((PetscObject)
rowIs);
618 PetscObjectReference((PetscObject)
colIs);
630 PetscObjectReference((PetscObject)
rowMap);
642 PetscObjectReference((PetscObject)
colMap);
658typedef multi_index_container<
661 ordered_unique<tag<Meshset_mi_tag>,
662 member<Problem, EntityHandle, &Problem::meshset>>,
663 hashed_unique<tag<BitProblemId_mi_tag>,
664 const_mem_fun<Problem, BitProblemId, &Problem::getId>,
666 hashed_unique<tag<Problem_mi_tag>,
667 const_mem_fun<Problem, std::string, &Problem::getName>>>>
762 PetscObjectReference((PetscObject)
rowIs[pp]);
763 if (pp <=
rowIs.size()) {
774 PetscObjectReference((PetscObject)
colIs[pp]);
775 if (pp <=
colIs.size()) {
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
multi_index_container< Problem, indexed_by< ordered_unique< tag< Meshset_mi_tag >, member< Problem, EntityHandle, &Problem::meshset > >, hashed_unique< tag< BitProblemId_mi_tag >, const_mem_fun< Problem, BitProblemId, &Problem::getId >, HashBit< BitProblemId >, EqBit< BitProblemId > >, hashed_unique< tag< Problem_mi_tag >, const_mem_fun< Problem, std::string, &Problem::getName > > > > Problem_multiIndex
MultiIndex for entities for Problem.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
std::bitset< BITFEID_SIZE > BitFEId
Finite element Id.
std::bitset< BITPROBLEMID_SIZE > BitProblemId
Problem Id.
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
Problem::EmptyFieldBlocks EmptyFieldBlocks
DeprecatedCoreInterface Interface
std::vector< const Problem * > rowProblemsAdd
MoFEMErrorCode getRowIs(IS *is, const unsigned int pp) const
virtual ~ComposedProblemsData()
MoFEMErrorCode getColIs(IS *is, const unsigned int pp) const
std::vector< const Problem * > colProblemsAdd
keeps information about indexed dofs for the problem
MoFEMErrorCode getRowMap(AO *ao)
SmartPetscObj< AO > rowMap
mapping form main problem indices to sub-problem indices
virtual ~SubProblemData()=default
SmartPetscObj< IS > rowIs
indices of main problem of which sub problem is this
MoFEMErrorCode getColMap(AO *ao)
SmartPetscObj< AO > colMap
mapping form main problem indices to sub-problem indices
MoFEMErrorCode getRowIs(IS *is)
MoFEMErrorCode getColIs(IS *is)
SmartPetscObj< IS > colIs
indices of main problem of which sub problem is this
void operator()(Problem &p)
ProblemChangeRefLevelBitAdd(const BitRefLevel _bit)
set prof dof bit ref mask
void operator()(Problem &p)
ProblemChangeRefLevelBitDofMaskAdd(const BitRefLevel _bit)
set prof dof bit ref mask
void operator()(Problem &p)
ProblemChangeRefLevelBitDofMaskSet(const BitRefLevel _bit)
void operator()(Problem &p)
ProblemChangeRefLevelBitSet(const BitRefLevel _bit)
Clear composed problem data structure.
void operator()(Problem &e)
clear problem finite elements
void operator()(Problem &e)
Clear sub-problem data structure.
void operator()(Problem &e)
add finite element to problem
void operator()(Problem &p)
ProblemFiniteElementChangeBitAdd(const BitFEId _f_id)
remove finite element from problem
ProblemFiniteElementChangeBitUnSet(const BitFEId _f_id)
void operator()(Problem &p)
keeps basic data about problem
MoFEMErrorCode getNumberOfElementsByPart(MPI_Comm comm, PetscLayout *layout) const
Get number of finite elements on processors.
auto getNumeredRowDofsByEntBegin(const EntityHandle ent) const
NumeredDofEntity_multiIndex::iterator getNumeredRowDofsBegin() const
auto getNumeredRowDofsByLocIdxBegin(const DofIdx locidx) const
auto getNumeredColDofsByLocIdxEnd(const DofIdx locidx) const
DofIdx getNbLocalDofsRow() const
MoFEMErrorCode getNumberOfElementsByNameAndPart(MPI_Comm comm, const std::string name, PetscLayout *layout) const
Get number of finite elements by name on processors.
DofIdx getNbDofsRow() const
const char * tagName
Problem name.
BitRefLevel getBitRefLevel() const
boost::shared_ptr< SequenceDofContainer > sequenceColDofContainer
BitProblemId * tagId
Unique problem ID.
auto & getColDofsSequence() const
Get reference to sequence data numbered dof container.
std::pair< BitFieldId, BitFieldId > EmptyFieldBlocks
MoFEMErrorCode getDofByNameEntAndEntDofIdx(const int field_bit_number, const EntityHandle ent, const int ent_dof_idx, const RowColData row_or_col, boost::shared_ptr< NumeredDofEntity > &dof_ptr) const
get DOFs from problem
virtual ~Problem()=default
auto getNumeredColDofsByEntEnd(const EntityHandle ent) const
BitRefLevel getBitRefLevelMask() const
auto getNumeredRowDofsByEntEnd(const EntityHandle ent) const
EmptyFieldBlocks & getEmptyFieldBlocks() const
Get the empty field blocks.
boost::shared_ptr< SubProblemData > & getSubData() const
Get main problem of sub-problem is.
DofIdx nbGhostDofsCol
Number of ghost DOFs in col.
boost::shared_ptr< NumeredDofEntity_multiIndex > numeredRowDofsPtr
store DOFs on rows for this problem
EmptyFieldBlocks & addFieldToEmptyFieldBlocks(const EmptyFieldBlocks add_fields) const
Add fields to the empty field blocks.
boost::shared_ptr< NumeredEntFiniteElement_multiIndex > numeredFiniteElementsPtr
store finite elements
NumeredDofEntity_multiIndex::iterator getNumeredRowDofsEnd() const
auto getNumeredFEsEnd(std::string fe_name) const
auto getNumeredColDofsByLocIdxBegin(const DofIdx locidx) const
auto getNumeredFEsBegin(std::string fe_name) const
Problem(Interface &moab, const EntityHandle meshset)
friend std::ostream & operator<<(std::ostream &os, const Problem &e)
boost::shared_ptr< SequenceDofContainer > sequenceRowDofContainer
MoFEMErrorCode getRowDofsByPetscGlobalDofIdx(DofIdx idx, const NumeredDofEntity **dof_ptr, MoFEMTypes bh=MF_EXIST) const
Get the Row Dofs By Petsc Global Dof Idx object.
boost::shared_ptr< ComposedProblemsData > composedProblemsData
const auto & getNumeredFiniteElementsPtr() const
get access to reference for multi-index storing finite elements
DofIdx getNbGhostDofsCol() const
EmptyFieldBlocks emptyFieldBlocks
auto getNumeredColDofsByEntBegin(const EntityHandle ent) const
DofIdx nbLocDofsRow
Local number of DOFs in row.
BitFEId getBitFEId() const
BitProblemId getId() const
DofIdx nbDofsCol
Global number of DOFs in col.
auto & getComposedProblemsData() const
Het composed problems data structure.
DofIdx getNbDofsCol() const
DofIdx getNbLocalDofsCol() const
DofIdx nbGhostDofsRow
Number of ghost DOFs in row.
auto & getNumeredColDofsPtr() const
get access to numeredColDofsPtr storing DOFs on cols
boost::shared_ptr< SubProblemData > subProblemData
DofIdx nbLocDofsCol
Local number of DOFs in colIs.
int tagNameSize
Size of problem name.
MoFEMErrorCode getColDofsByPetscGlobalDofIdx(DofIdx idx, const NumeredDofEntity **dof_ptr, MoFEMTypes bh=MF_EXIST) const
Get the Col Dofs By Petsc Global Dof Idx object.
BitFEId * tagBitFEId
IDs of finite elements in problem.
BitRefLevel * tagBitRefLevelMask
BItRefMask of elements in problem.
NumeredDofEntity_multiIndex::iterator getNumeredColDofsEnd() const
DofIdx nbDofsRow
Global number of DOFs in row.
DofIdx getNbGhostDofsRow() const
multi_index_container< boost::weak_ptr< std::vector< NumeredDofEntity > >, indexed_by< sequenced<> > > SequenceDofContainer
boost::shared_ptr< NumeredDofEntity_multiIndex > numeredColDofsPtr
store DOFs on columns for this problem
BitRefLevel * tagBitRefLevel
BitRef level of finite elements in problem.
NumeredDofEntity_multiIndex::iterator getNumeredColDofsBegin() const
auto getNumeredRowDofsByLocIdxEnd(const DofIdx locidx) const
auto & getNumeredRowDofsPtr() const
get access to numeredRowDofsPtr storing DOFs on rows
auto & getRowDofsSequence() const
Get reference to sequence data numbered dof container.
void operator()(Problem &e)
void operator()(Problem &e)