6#ifndef __PROBLEMSMULTIINDICES_HPP__
7#define __PROBLEMSMULTIINDICES_HPP__
21 std::vector<SmartPetscObj<IS>>
rowIs;
22 std::vector<SmartPetscObj<IS>>
colIs;
72 mutable boost::shared_ptr<NumeredDofEntity_multiIndex>
74 mutable boost::shared_ptr<NumeredDofEntity_multiIndex>
76 mutable boost::shared_ptr<NumeredEntFiniteElement_multiIndex>
107 struct SubProblemData;
119 inline boost::shared_ptr<SubProblemData> &
getSubData()
const {
149 const int field_bit_number,
const EntityHandle ent,
const int ent_dof_idx,
151 boost::shared_ptr<NumeredDofEntity> &dof_ptr)
const;
164#define _IT_NUMEREDDOF_ROW_FOR_LOOP_(PROBLEMPTR, IT) \
165 NumeredDofEntity_multiIndex::iterator IT = \
166 PROBLEMPTR->getNumeredRowDofsBegin(); \
167 IT != PROBLEMPTR->getNumeredRowDofsEnd(); \
181#define _IT_NUMEREDDOF_COL_FOR_LOOP_(PROBLEMPTR, IT) \
182 NumeredDofEntity_multiIndex::iterator IT = \
183 PROBLEMPTR->getNumeredColDofsBegin(); \
184 IT != PROBLEMPTR->getNumeredColDofsEnd(); \
222#define _IT_NUMEREDDOF_ROW_BY_LOCIDX_FOR_LOOP_(PROBLEMPTR, IT) \
223 NumeredDofEntityByLocalIdx::iterator IT = \
224 PROBLEMPTR->getNumeredRowDofsByLocIdxBegin(0); \
225 IT != PROBLEMPTR->getNumeredRowDofsByLocIdxEnd( \
226 PROBLEMPTR->getNbLocalDofsRow() - 1); \
239#define _IT_NUMEREDDOF_COL_BY_LOCIDX_FOR_LOOP_(PROBLEMPTR, IT) \
240 NumeredDofEntityByUId::iterator IT = \
241 PROBLEMPTR->getNumeredColDofsByLocIdxBegin(0); \
242 IT != PROBLEMPTR->getNumeredColDofsByLocIdxEnd( \
243 PROBLEMPTR->getNbLocalDofsRow() - 1); \
281#define _IT_NUMEREDDOF_ROW_BY_ENT_FOR_LOOP_(PROBLEMPTR, ENT, IT) \
282 auto IT = PROBLEMPTR->getNumeredRowDofsByEntBegin(ENT); \
283 IT != PROBLEMPTR->getNumeredRowDofsByEntEnd(ENT); \
297#define _IT_NUMEREDDOF_COL_BY_ENT_FOR_LOOP_(PROBLEMPTR, ENT, IT) \
298 auto IT = PROBLEMPTR->getNumeredColDofsByEntBegin(ENT); \
299 IT != PROBLEMPTR->getNumeredColDofsByEntEnd(ENT); \
338#define _IT_NUMEREDDOF_ROW_BY_BITNUMBER_FOR_LOOP_(PROBLEMPTR, \
339 FIELD_BIT_NUMBER, IT) \
340 auto IT = PROBLEMPTR->numeredRowDofsPtr->lower_bound( \
341 FieldEntity::getLoBitNumberUId(FIELD_BIT_NUMBER)); \
342 IT != PROBLEMPTR->numeredRowDofsPtr->upper_bound( \
343 FieldEntity::getHiBitNumberUId(FIELD_BIT_NUMBER)); \
358#define _IT_NUMEREDDOF_COL_BY_BITNUMBER_FOR_LOOP_(PROBLEMPTR, \
359 FIELD_BIT_NUMBER, IT) \
360 auto IT = PROBLEMPTR->numeredColDofsPtr->lower_bound( \
361 FieldEntity::getLoBitNumberUId(FIELD_BIT_NUMBER)); \
362 IT != PROBLEMPTR->numeredColDofsPtr->upper_bound( \
363 FieldEntity::getHiBitNumberUId(FIELD_BIT_NUMBER)); \
420 boost::weak_ptr<NumeredDofEntity>
429 boost::weak_ptr<NumeredDofEntity>
460 const std::string name,
461 PetscLayout *layout)
const;
486 PetscLayout *layout)
const;
488 typedef multi_index_container<boost::weak_ptr<std::vector<NumeredDofEntity>>,
489 indexed_by<sequenced<>>>
591 PetscObjectReference((PetscObject)(*is));
603 PetscObjectReference((PetscObject)(*is));
615 PetscObjectReference((PetscObject)(*ao));
627 PetscObjectReference((PetscObject)(*ao));
642typedef multi_index_container<
645 ordered_unique<tag<Meshset_mi_tag>,
646 member<Problem, EntityHandle, &Problem::meshset>>,
647 hashed_unique<tag<BitProblemId_mi_tag>,
648 const_mem_fun<Problem, BitProblemId, &Problem::getId>,
650 hashed_unique<tag<Problem_mi_tag>,
651 const_mem_fun<Problem, std::string, &Problem::getName>>>>
746 if (pp <=
rowIs.size()) {
750 *is =
rowIs[pp].get();
751 PetscObjectReference((PetscObject)(*is));
758 if (pp <=
colIs.size()) {
762 *is =
colIs[pp].get();
763 PetscObjectReference((PetscObject)(*is));
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
std::vector< SmartPetscObj< IS > > colIs
virtual ~ComposedProblemsData()=default
MoFEMErrorCode getRowIs(IS *is, const unsigned int pp) const
Get the col sub dm IS.
MoFEMErrorCode getColIs(IS *is, const unsigned int pp) const
Get the Col sub dm IS object.
std::vector< SmartPetscObj< IS > > rowIs
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
MoFEMErrorCode eraseElements(Range entities) const
Erase elements by entities.
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