6#ifndef __PROBLEMSMULTIINDICES_HPP__
7#define __PROBLEMSMULTIINDICES_HPP__
58 mutable boost::shared_ptr<NumeredDofEntity_multiIndex>
60 mutable boost::shared_ptr<NumeredDofEntity_multiIndex>
62 mutable boost::shared_ptr<NumeredEntFiniteElement_multiIndex>
85 struct SubProblemData;
97 inline boost::shared_ptr<SubProblemData> &
getSubData()
const {
127 const int field_bit_number,
const EntityHandle ent,
const int ent_dof_idx,
129 boost::shared_ptr<NumeredDofEntity> &dof_ptr)
const;
142#define _IT_NUMEREDDOF_ROW_FOR_LOOP_(PROBLEMPTR, IT) \
143 NumeredDofEntity_multiIndex::iterator IT = \
144 PROBLEMPTR->getNumeredRowDofsBegin(); \
145 IT != PROBLEMPTR->getNumeredRowDofsEnd(); \
159#define _IT_NUMEREDDOF_COL_FOR_LOOP_(PROBLEMPTR, IT) \
160 NumeredDofEntity_multiIndex::iterator IT = \
161 PROBLEMPTR->getNumeredColDofsBegin(); \
162 IT != PROBLEMPTR->getNumeredColDofsEnd(); \
200#define _IT_NUMEREDDOF_ROW_BY_LOCIDX_FOR_LOOP_(PROBLEMPTR, IT) \
201 NumeredDofEntityByLocalIdx::iterator IT = \
202 PROBLEMPTR->getNumeredRowDofsByLocIdxBegin(0); \
203 IT != PROBLEMPTR->getNumeredRowDofsByLocIdxEnd( \
204 PROBLEMPTR->getNbLocalDofsRow() - 1); \
217#define _IT_NUMEREDDOF_COL_BY_LOCIDX_FOR_LOOP_(PROBLEMPTR, IT) \
218 NumeredDofEntityByUId::iterator IT = \
219 PROBLEMPTR->getNumeredColDofsByLocIdxBegin(0); \
220 IT != PROBLEMPTR->getNumeredColDofsByLocIdxEnd( \
221 PROBLEMPTR->getNbLocalDofsRow() - 1); \
259#define _IT_NUMEREDDOF_ROW_BY_ENT_FOR_LOOP_(PROBLEMPTR, ENT, IT) \
260 auto IT = PROBLEMPTR->getNumeredRowDofsByEntBegin(ENT); \
261 IT != PROBLEMPTR->getNumeredRowDofsByEntEnd(ENT); \
275#define _IT_NUMEREDDOF_COL_BY_ENT_FOR_LOOP_(PROBLEMPTR, ENT, IT) \
276 auto IT = PROBLEMPTR->getNumeredColDofsByEntBegin(ENT); \
277 IT != PROBLEMPTR->getNumeredColDofsByEntEnd(ENT); \
316#define _IT_NUMEREDDOF_ROW_BY_BITNUMBER_FOR_LOOP_(PROBLEMPTR, \
317 FIELD_BIT_NUMBER, IT) \
318 auto IT = PROBLEMPTR->numeredRowDofsPtr->lower_bound( \
319 FieldEntity::getLoBitNumberUId(FIELD_BIT_NUMBER)); \
320 IT != PROBLEMPTR->numeredRowDofsPtr->upper_bound( \
321 FieldEntity::getHiBitNumberUId(FIELD_BIT_NUMBER)); \
336#define _IT_NUMEREDDOF_COL_BY_BITNUMBER_FOR_LOOP_(PROBLEMPTR, \
337 FIELD_BIT_NUMBER, IT) \
338 auto IT = PROBLEMPTR->numeredColDofsPtr->lower_bound( \
339 FieldEntity::getLoBitNumberUId(FIELD_BIT_NUMBER)); \
340 IT != PROBLEMPTR->numeredColDofsPtr->upper_bound( \
341 FieldEntity::getHiBitNumberUId(FIELD_BIT_NUMBER)); \
398 boost::weak_ptr<NumeredDofEntity>
407 boost::weak_ptr<NumeredDofEntity>
438 const std::string name,
439 PetscLayout *layout)
const;
464 PetscLayout *layout)
const;
466 typedef multi_index_container<boost::weak_ptr<std::vector<NumeredDofEntity>>,
467 indexed_by<sequenced<>>>
568 PetscObjectReference((PetscObject)
rowIs);
580 PetscObjectReference((PetscObject)
colIs);
592 PetscObjectReference((PetscObject)
rowMap);
604 PetscObjectReference((PetscObject)
colMap);
620typedef multi_index_container<
623 ordered_unique<tag<Meshset_mi_tag>,
624 member<Problem, EntityHandle, &Problem::meshset>>,
625 hashed_unique<tag<BitProblemId_mi_tag>,
626 const_mem_fun<Problem, BitProblemId, &Problem::getId>,
628 hashed_unique<tag<Problem_mi_tag>,
629 const_mem_fun<Problem, std::string, &Problem::getName>>>>
724 PetscObjectReference((PetscObject)
rowIs[pp]);
725 if (pp <=
rowIs.size()) {
736 PetscObjectReference((PetscObject)
colIs[pp]);
737 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 getNumeredColDofsByLocIdxBegin(const DofIdx locidx) const
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)
intrusive_ptr for managing petsc objects