23 #ifndef __FORCES_AND_SOURCES_CORE__HPP__
24 #define __FORCES_AND_SOURCES_CORE__HPP__
26 using namespace boost::numeric;
40 typedef boost::function<
int(
int order_row,
int order_col,
int order_data)>
118 const bool symm =
true);
121 const bool symm =
true);
124 const std::string &col_field_name,
const char type,
125 const bool symm =
true);
129 inline boost::shared_ptr<const NumeredEntFiniteElement>
130 getNumeredEntFiniteElementPtr()
const;
136 inline EntityHandle getFEEntityHandle()
const;
149 inline boost::weak_ptr<SideNumber> getSideNumberPtr(
const int side_number,
150 const EntityType
type);
184 inline EntityHandle getSideEntity(
const int side_number,
185 const EntityType
type);
192 inline int getNumberOfNodesOnElement();
209 const EntityType
type,
const int side,
227 const EntityType
type,
const int side,
232 inline const FEMethod *getFEMethod()
const;
238 inline int getOpType()
const;
255 inline int getNinTheLoop()
const;
261 inline int getLoopSize()
const;
265 inline const std::string &getFEName()
const;
283 inline Vec getKSPf()
const;
285 inline Mat getKSPA()
const;
287 inline Mat getKSPB()
const;
295 inline Vec getSNESf()
const;
297 inline Vec getSNESx()
const;
299 inline Mat getSNESA()
const;
301 inline Mat getSNESB()
const;
321 inline Vec getTSu()
const;
323 inline Vec getTSu_t()
const;
325 inline Vec getTSu_tt()
const;
327 inline Vec getTSf()
const;
329 inline Mat getTSA()
const;
331 inline Mat getTSB()
const;
333 inline int getTSstep()
const;
335 inline double getTStime()
const;
337 inline double getTSa()
const;
339 inline double getTSaa()
const;
373 inline auto getFTensor0IntegrationWeight();
383 getPorblemRowIndices(
const std::string filed_name,
const EntityType
type,
384 const int side,
VectorInt &indices)
const;
412 const EntityHandle ent_for_side = 0);
470 int getMaxDataOrder()
const;
473 int getMaxRowOrder()
const;
476 int getMaxColOrder()
const;
487 const EntityType
type,
488 const int side)
const {
489 return dataOnElement[space]->dataOnEntities[
type][side];
502 return dataOnElement[space]->dataOnEntities[
type][side];
513 const EntityType
type,
514 boost::ptr_vector<DataForcesAndSourcesCore::EntData> &data)
const;
526 boost::ptr_vector<DataForcesAndSourcesCore::EntData> &data)
const;
535 template <EntityType type>
548 template <EntityType type>
559 template <
typename EXTRACTOR>
561 getNodesIndices(
const std::string &field_name,
563 VectorInt &local_nodes_indices, EXTRACTOR &&extractor)
const;
567 const std::string &field_name)
const;
571 const std::string &field_name)
const;
573 template <
typename EXTRACTOR>
575 const std::string &field_name,
577 const EntityType type_lo,
578 const EntityType type_hi,
579 EXTRACTOR &&extractor)
const;
583 const std::string &field_name,
584 const EntityType type_lo = MBVERTEX,
585 const EntityType type_hi = MBPOLYHEDRON)
const;
589 const std::string &field_name,
590 const EntityType type_lo = MBVERTEX,
591 const EntityType type_hi = MBPOLYHEDRON)
const;
595 getNoFieldIndices(
const std::string &field_name,
596 boost::shared_ptr<FENumeredDofEntity_multiIndex> dofs,
601 const std::string &field_name)
const;
605 const std::string &field_name)
const;
622 const std::string field_name)
const;
631 const std::string &field_name)
const;
635 const std::string &field_name,
636 const EntityType type_lo = MBVERTEX,
637 const EntityType type_hi = MBPOLYHEDRON)
const;
654 MoFEMErrorCode getProblemNodesIndices(
const std::string &field_name,
660 MoFEMErrorCode getProblemTypeIndices(
const std::string &field_name,
662 EntityType
type,
int side_number,
665 MoFEMErrorCode getProblemNodesRowIndices(
const std::string &field_name,
667 MoFEMErrorCode getProblemTypeRowIndices(
const std::string &field_name,
668 EntityType
type,
int side_number,
670 MoFEMErrorCode getProblemNodesColIndices(
const std::string &field_name,
672 MoFEMErrorCode getProblemTypeColIndices(
const std::string &field_name,
673 EntityType
type,
int side_number,
715 virtual int getRule(
int order_row,
int order_col,
int order_data);
784 virtual int getRule(
int order);
796 const std::array<boost::shared_ptr<DataForcesAndSourcesCore>,
LASTSPACE>
803 const std::array<boost::shared_ptr<DataForcesAndSourcesCore>,
LASTSPACE>
865 boost::shared_ptr<const NumeredEntFiniteElement>
866 ForcesAndSourcesCore::UserDataOperator::getNumeredEntFiniteElementPtr()
const {
870 EntityHandle ForcesAndSourcesCore::UserDataOperator::getFEEntityHandle()
const {
871 return getNumeredEntFiniteElementPtr()->getEnt();
874 boost::weak_ptr<SideNumber>
875 ForcesAndSourcesCore::UserDataOperator::getSideNumberPtr(
876 const int side_number,
const EntityType
type) {
877 auto &side_table_by_side_and_type =
878 ptrFE->numeredEntFiniteElementPtr->getSideNumberTable().get<1>();
880 side_table_by_side_and_type.find(boost::make_tuple(
type, side_number));
881 if (side_it != side_table_by_side_and_type.end())
884 return boost::weak_ptr<SideNumber>();
888 ForcesAndSourcesCore::UserDataOperator::getSideEntity(
const int side_number,
889 const EntityType
type) {
890 if (
auto side_ptr = getSideNumberPtr(side_number,
type).lock())
891 return side_ptr->ent;
896 int ForcesAndSourcesCore::UserDataOperator::getNumberOfNodesOnElement() {
898 CHKERR ptrFE->getNumberOfNodes(num_nodes);
902 const FEMethod *ForcesAndSourcesCore::UserDataOperator::getFEMethod()
const {
906 int ForcesAndSourcesCore::UserDataOperator::getOpType()
const {
return opType; }
908 void ForcesAndSourcesCore::UserDataOperator::setOpType(
const OpType type) {
912 void ForcesAndSourcesCore::UserDataOperator::addOpType(
const OpType type) {
916 int ForcesAndSourcesCore::UserDataOperator::getNinTheLoop()
const {
917 return getFEMethod()->getNinTheLoop();
920 int ForcesAndSourcesCore::UserDataOperator::getLoopSize()
const {
921 return getFEMethod()->getLoopSize();
924 const std::string &ForcesAndSourcesCore::UserDataOperator::getFEName()
const {
925 return getFEMethod()->feName;
929 ForcesAndSourcesCore::UserDataOperator::getDataCtx()
const {
930 return getFEMethod()->data_ctx;
934 ForcesAndSourcesCore::UserDataOperator::getKSPCtx()
const {
935 return getFEMethod()->ksp_ctx;
939 ForcesAndSourcesCore::UserDataOperator::getSNESCtx()
const {
940 return getFEMethod()->snes_ctx;
944 ForcesAndSourcesCore::UserDataOperator::getTSCtx()
const {
945 return getFEMethod()->ts_ctx;
948 Vec ForcesAndSourcesCore::UserDataOperator::getKSPf()
const {
949 return getFEMethod()->ksp_f;
952 Mat ForcesAndSourcesCore::UserDataOperator::getKSPA()
const {
953 return getFEMethod()->ksp_A;
956 Mat ForcesAndSourcesCore::UserDataOperator::getKSPB()
const {
957 return getFEMethod()->ksp_B;
960 Vec ForcesAndSourcesCore::UserDataOperator::getSNESf()
const {
961 return getFEMethod()->snes_f;
964 Vec ForcesAndSourcesCore::UserDataOperator::getSNESx()
const {
965 return getFEMethod()->snes_x;
968 Mat ForcesAndSourcesCore::UserDataOperator::getSNESA()
const {
969 return getFEMethod()->snes_A;
972 Mat ForcesAndSourcesCore::UserDataOperator::getSNESB()
const {
973 return getFEMethod()->snes_B;
976 Vec ForcesAndSourcesCore::UserDataOperator::getTSu()
const {
977 return getFEMethod()->ts_u;
980 Vec ForcesAndSourcesCore::UserDataOperator::getTSu_t()
const {
981 return getFEMethod()->ts_u_t;
984 Vec ForcesAndSourcesCore::UserDataOperator::getTSu_tt()
const {
985 return getFEMethod()->ts_u_tt;
988 Vec ForcesAndSourcesCore::UserDataOperator::getTSf()
const {
989 return getFEMethod()->ts_F;
992 Mat ForcesAndSourcesCore::UserDataOperator::getTSA()
const {
993 return getFEMethod()->ts_A;
996 Mat ForcesAndSourcesCore::UserDataOperator::getTSB()
const {
997 return getFEMethod()->ts_B;
1000 int ForcesAndSourcesCore::UserDataOperator::getTSstep()
const {
1001 return getFEMethod()->ts_step;
1004 double ForcesAndSourcesCore::UserDataOperator::getTStime()
const {
1005 return getFEMethod()->ts_t;
1008 double ForcesAndSourcesCore::UserDataOperator::getTSa()
const {
1009 return getFEMethod()->ts_a;
1012 double ForcesAndSourcesCore::UserDataOperator::getTSaa()
const {
1013 return getFEMethod()->ts_aa;
1020 auto ForcesAndSourcesCore::UserDataOperator::getFTensor0IntegrationWeight() {
1022 &(getGaussPts()(getGaussPts().size1() - 1, 0)));
1026 const std::string filed_name,
const EntityType
type,
const int side,
1028 return getProblemRowIndices(filed_name,
type, side, indices);
1036 ForcesAndSourcesCore::UserDataOperator::getSidePtrFE()
const {
ForcesAndSourcesCore::UserDataOperator UserDataOperator
FieldApproximationBase
approximation base
FieldSpace
approximation spaces
@ LASTSPACE
FieldSpace in [ 0, LASTSPACE )
#define CHKERR
Inline error check.
multi_index_container< boost::shared_ptr< NumeredDofEntity >, indexed_by< ordered_unique< tag< Unique_mi_tag >, const_mem_fun< NumeredDofEntity::interface_type_DofEntity, UId, &NumeredDofEntity::getLocalUniqueId > >, ordered_non_unique< tag< Part_mi_tag >, member< NumeredDofEntity, unsigned int, &NumeredDofEntity::pArt > >, ordered_non_unique< tag< Idx_mi_tag >, member< NumeredDofEntity, DofIdx, &NumeredDofEntity::dofIdx > >, ordered_non_unique< tag< PetscGlobalIdx_mi_tag >, member< NumeredDofEntity, DofIdx, &NumeredDofEntity::petscGloablDofIdx > >, ordered_non_unique< tag< PetscLocalIdx_mi_tag >, member< NumeredDofEntity, DofIdx, &NumeredDofEntity::petscLocalDofIdx > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< NumeredDofEntity::interface_type_DofEntity, EntityHandle, &NumeredDofEntity::getEnt > > > > NumeredDofEntity_multiIndex
MultiIndex container keeps NumeredDofEntity.
const FTensor::Tensor2< T, Dim, Dim > Vec
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
ublas::vector< int, IntAllocator > VectorInt
ublas::vector< double, DoubleAllocator > VectorDouble
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
implementation of Data Operators for Forces and Sources
ublas::vector< FieldEntity *, FieldEntAllocator > VectorFieldEntities
DEPRECATED typedef ForcesAndSourcesCore ForcesAndSurcesCore
std::vector< boost::weak_ptr< FieldEntity > > FieldEntity_vector_view
ublas::vector< FEDofEntity *, DofsAllocator > VectorDofs
Data on single entity (This is passed as argument to DataOperator::doWork)
data structure for finite element entity
std::array< boost::ptr_vector< EntData >, MBMAXTYPE > dataOnEntities
base operator to do operations at Gauss Pt. level
Deprecated interface functions.
structure for User Loop Methods on finite elements
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
Base face element used to integrate on skeleton.
Data operator to do calculations at integration points.
DEPRECATED Mat getSnesA() const
DEPRECATED Vec getSnesF() const
DEPRECATED Mat getSnesB() const
ForcesAndSourcesCore * ptrFE
OpType
Controls loop over entities on element.
DEPRECATED Vec getSnesX() const
structure to get information form mofem into DataForcesAndSourcesCore
auto & getUserPolynomialBase()
Get the User Polynomial Base object.
DataForcesAndSourcesCore & dataNoField
const std::array< boost::shared_ptr< DataForcesAndSourcesCore >, LASTSPACE > derivedDataOnElement
Entity data on element entity columns fields.
const std::array< boost::shared_ptr< DataForcesAndSourcesCore >, LASTSPACE > dataOnElement
Entity data on element entity rows fields.
auto & getElementPolynomialBase()
Get the Entity Polynomial Base object.
MoFEMErrorCode getEntitySense(DataForcesAndSourcesCore &data) const
Get the entity sense (orientation)
ForcesAndSourcesCore * sidePtrFE
Element to integrate on the sides.
const DataForcesAndSourcesCore::EntData & getEntData(const FieldSpace space, const EntityType type, const int side) const
Get the entity data.
DataForcesAndSourcesCore & dataH1
DataForcesAndSourcesCore & dataHdiv
DataForcesAndSourcesCore & dataHcurl
MatrixDouble gaussPts
Matrix of integration points.
DataForcesAndSourcesCore::EntData & getEntData(const FieldSpace space, const EntityType type, const int side)
Get the entity data.
MoFEMErrorCode getEntityDataOrder(DataForcesAndSourcesCore &data, const FieldSpace space) const
Get the entity data order for given space.
RuleHookFun setRuleHook
Set function to calculate integration rule.
EntityType lastEvaluatedElementEntityType
Last evaluated type of element entity.
boost::function< int(int order_row, int order_col, int order_data)> RuleHookFun
boost::ptr_vector< UserDataOperator > opPtrVector
Vector of finite element users data operators.
boost::ptr_vector< UserDataOperator > & getOpPtrVector()
Use to push back operator for row operator.
DataForcesAndSourcesCore & dataL2
boost::shared_ptr< BaseFunction > elementPolynomialBasePtr
Pointer to entity polynomial base.
boost::shared_ptr< BaseFunction > userPolynomialBasePtr
Pointer to user polynomail base.
RuleHookFun getRuleHook
Hook to get rule.
KSPContext
pass information about context of KSP/DM for with finite element is computed
std::bitset< 8 > Switches
Base volume element used to integrate on skeleton.