v0.14.0
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
MoFEM Namespace Reference

implementation of Data Operators for Forces and Sources More...

Namespaces

 BcManagerImplTools
 
 DemkowiczHexAndQuad
 
 Exceptions
 Exceptions and handling errors data structures.
 
 IntRules
 
 LogKeywords
 
 Types
 Types.
 

Classes

struct  AccelerationCubitBcData
 Definition of the acceleration bc data structure. More...
 
struct  AddEssentialToLhsPipelineImpl
 Function (factory) for setting operators for lhs pipeline. More...
 
struct  AddEssentialToLhsPipelineImpl< OpEssentialLhsImpl< DisplacementCubitBcData, BASE_DIM, FIELD_DIM, A, I, OpBase >, A, I, OpBase >
 
struct  AddEssentialToLhsPipelineImpl< OpEssentialLhsImpl< HeatFluxCubitBcData, BASE_DIM, FIELD_DIM, A, I, OpBase >, A, I, OpBase >
 
struct  AddEssentialToLhsPipelineImpl< OpEssentialLhsImpl< MPCsType, BASE_DIM, FIELD_DIM, A, I, OpBase >, A, I, OpBase >
 
struct  AddEssentialToRhsPipelineImpl
 Function (factory) for setting operators for rhs pipeline. More...
 
struct  AddEssentialToRhsPipelineImpl< OpEssentialRhsImpl< DisplacementCubitBcData, BASE_DIM, FIELD_DIM, A, I, OpBase >, A, I, OpBase >
 
struct  AddEssentialToRhsPipelineImpl< OpEssentialRhsImpl< HeatFluxCubitBcData, BASE_DIM, FIELD_DIM, A, I, OpBase >, A, I, OpBase >
 
struct  AddEssentialToRhsPipelineImpl< OpEssentialRhsImpl< MPCsType, BASE_DIM, FIELD_DIM, A, I, OpBase >, A, I, OpBase >
 
struct  AddFluxToLhsPipelineImpl
 
struct  AddFluxToRhsPipelineImpl
 
struct  AddFluxToRhsPipelineImpl< MoFEM::OpFluxRhsImpl< ThermoElasticOps::SetTargetTemperature, 1, 1, A, I, OpBase >, A, I, OpBase >
 
struct  AddFluxToRhsPipelineImpl< OpFluxRhsImpl< NaturalForceMeshsets, BASE_DIM, FIELD_DIM, A, I, OpBase >, A, I, OpBase >
 
struct  AddFluxToRhsPipelineImpl< OpFluxRhsImpl< NaturalForceMeshsetsScalarAndVectorScaling, BASE_DIM, FIELD_DIM, A, I, OpBase >, A, I, OpBase >
 
struct  AddFluxToRhsPipelineImpl< OpFluxRhsImpl< NaturalMeshsetType< BCTYPE >, BASE_DIM, FIELD_DIM, A, I, OpBase >, A, I, OpBase >
 
struct  AddFluxToRhsPipelineImpl< OpFluxRhsImpl< NaturalMeshsetTypeVectorScaling< BCTYPE >, BASE_DIM, FIELD_DIM, A, I, OpBase >, A, I, OpBase >
 
struct  AddFluxToRhsPipelineImpl< OpFluxRhsImpl< NaturalTemperatureMeshsets, BASE_DIM, FIELD_DIM, A, I, OpBase >, A, I, OpBase >
 
struct  AddHOOps
 Add operators pushing bases from local to physical configuration. More...
 
struct  AddHOOps< 1, 2, 2 >
 
struct  AddHOOps< 1, 3, 3 >
 
struct  AddHOOps< 2, 2, 2 >
 
struct  AddHOOps< 2, 2, 3 >
 
struct  AddHOOps< 2, 3, 3 >
 
struct  AddHOOps< 3, 3, 3 >
 
struct  AinsworthOrderHooks
 Broken base Ainsworth subentries order change hooks. More...
 
struct  AssemblyTypeSelector
 
struct  BaseFunction
 Base class if inherited used to calculate base functions. More...
 
struct  BaseFunctionCtx
 Base class used to exchange data between element data structures and class calculating base functions. More...
 
struct  BaseFunctionUnknownInterface
 
struct  BasicEntityData
 PipelineManager data. like access to moab interface and basic tag handlers. More...
 
struct  BasicMethod
 Data structure to exchange data between mofem and User Loop Methods. More...
 
struct  BasicMethodPtr
 
struct  BcDisplacementMeshsetType
 
struct  BcFluxMeshsetType
 
struct  BcForceMeshsetType
 
struct  BcManager
 Simple interface for fast problem set-up. More...
 
struct  BcMeshsetType
 
struct  BcScalarMeshsetType
 
struct  BernsteinBezier
 Evaluating BB polynomial. More...
 
struct  BitFEId_mi_tag
 
struct  BitFieldId_mi_tag
 
struct  BitFieldId_space_mi_tag
 
struct  BitProblemId_mi_tag
 
struct  BitRefManager
 Managing BitRefLevels. More...
 
struct  Block_BodyForces
 Body force data structure. More...
 
struct  BlockData
 
struct  BlockSetAttributes
 Arbitrary block attributes data structure. More...
 
struct  BlockStructure
 
struct  BrokenBaseSideData
 
struct  CfgCubitBcData
 Definition of the cfd_bc data structure. More...
 
struct  CommInterface
 Managing BitRefLevels. More...
 
struct  ComposedProblemsData
 
struct  Composite_Cubit_msId_And_MeshsetType_mi_tag
 
struct  Composite_Ent_And_EntDofIdx_mi_tag
 
struct  Composite_Ent_and_ShortId_mi_tag
 
struct  Composite_Ent_Order_And_CoeffIdx_mi_tag
 
struct  Composite_EntType_and_ParentEntType_mi_tag
 
struct  Composite_EntType_and_Space_mi_tag
 
struct  Composite_mi_tag
 
struct  Composite_Name_And_Ent_And_EntDofIdx_mi_tag
 
struct  Composite_Name_And_Ent_mi_tag
 
struct  Composite_Name_And_Part_mi_tag
 
struct  Composite_Name_Ent_And_Part_mi_tag
 
struct  Composite_Name_Ent_Order_And_CoeffIdx_mi_tag
 
struct  Composite_ParentEnt_And_BitsOfRefinedEdges_mi_tag
 
struct  Composite_ParentEnt_And_EntType_mi_tag
 
struct  Composite_Part_And_Order_mi_tag
 
struct  Composite_SeriesID_And_Step_mi_tag
 
struct  Composite_SeriesName_And_Step_mi_tag
 
struct  Composite_SeriesName_And_Time_mi_tag
 
struct  Composite_Unique_mi_tag
 
struct  ContactPrismElementForcesAndSourcesCore
 ContactPrism finite element. More...
 
struct  CoreInterface
 Interface. More...
 
struct  CoreTmp
 
struct  CoreTmp< 0 >
 Core (interface) class. More...
 
struct  CoreTmp<-1 >
 
struct  CoreValue
 
struct  CreateRowCompressedADJMatrix
 Create compressed matrix. More...
 
struct  CubitMeshsetMaskedType_mi_tag
 
struct  CubitMeshSets
 this struct keeps basic methods for moab meshset about material and boundary conditions More...
 
struct  CubitMeshSets_change_add_bit_to_cubit_bc_type
 change meshset type More...
 
struct  CubitMeshSets_change_attributes
 
struct  CubitMeshSets_change_attributes_data_structure
 
struct  CubitMeshSets_change_bc_data_structure
 
struct  CubitMeshSets_change_name
 change meshset name More...
 
struct  CubitMeshsets_name
 
struct  CubitMeshsetType_mi_tag
 MultiIndex Tag for field id. More...
 
struct  CutMeshInterface
 Interface to cut meshes. More...
 
struct  DataOperator
 base operator to do operations at Gauss Pt. level More...
 
struct  DefaultElementAdjacency
 default adjacency map More...
 
struct  DeprecatedCoreInterface
 Deprecated interface functions. More...
 
struct  DerivedEntitiesFieldData
 this class derive data form other data structure More...
 
struct  DeterminantTensorImpl
 
struct  DeterminantTensorImpl< T, 2 >
 
struct  DeterminantTensorImpl< T, 3 >
 
struct  DiagBlockIndex
 
struct  DisplacementCubitBcData
 Definition of the displacement bc data structure. More...
 
struct  DisplacementCubitBcDataWithRotation
 A specialized version of DisplacementCubitBcData that includes an additional rotation offset. More...
 
struct  DMCtx
 PETSc Discrete Manager data structure. More...
 
struct  DMCtxImpl
 
struct  DMMGViaApproxOrdersCtx
 Structure for DM for multi-grid via approximation orders. More...
 
struct  DOF_Unique_mi_tag
 
struct  DofEntity
 keeps information about DOF on the entity More...
 
struct  DofEntity_active_change
 
struct  DofMethod
 Data structure to exchange data between mofem and User Loop Methods on entities. More...
 
struct  EdgeElementForcesAndSourcesCore
 Edge finite element. More...
 
struct  EdgeElementForcesAndSourcesCoreOnChildParent
 Base face element used to integrate on skeleton. More...
 
struct  EdgePolynomialBase
 Calculate base functions on tetrahedral. More...
 
struct  Ent_Ent_mi_tag
 
struct  Ent_FiniteElement_mi_tag
 
struct  Ent_mi_tag
 
struct  Ent_Owner_mi_tag
 
struct  Ent_ParallelStatus
 
struct  EntDofIdx_mi_tag
 
struct  EntFiniteElement
 Finite element data for entity. More...
 
struct  EntitiesFieldData
 data structure for finite element entity More...
 
struct  EntityCacheDofs
 
struct  EntityCacheNumeredDofs
 
struct  EntityMethod
 Data structure to exchange data between mofem and User Loop Methods on entities. More...
 
struct  EntityStorage
 
struct  EntPolynomialBaseCtx
 Class used to pass element data to calculate base functions on tet,triangle,edge. More...
 
struct  EntType_mi_tag
 
struct  EqBit
 
struct  EssentialBC
 Essential boundary conditions. More...
 
struct  EssentialBcStorage
 [Storage and set boundary conditions] More...
 
struct  EssentialPostProcLhs
 Class (Function) to enforce essential constrains on the left hand side diagonal. More...
 
struct  EssentialPostProcLhs< DisplacementCubitBcData >
 Specialization for DisplacementCubitBcData. More...
 
struct  EssentialPostProcLhs< MPCsType >
 Specialization for MPCsType. More...
 
struct  EssentialPostProcRhs
 Class (Function) to enforce essential constrains on the right hand side diagonal. More...
 
struct  EssentialPostProcRhs< DisplacementCubitBcData >
 Specialization for DisplacementCubitBcData. More...
 
struct  EssentialPostProcRhs< MPCsType >
 Specialization for DisplacementCubitBcData. More...
 
struct  EssentialPreProc
 Class (Function) to enforce essential constrains. More...
 
struct  EssentialPreProc< DisplacementCubitBcData >
 Specialization for DisplacementCubitBcData. More...
 
struct  EssentialPreProc< MPCsType >
 Type generating multipoint constraints. More...
 
struct  EssentialPreProc< TemperatureCubitBcData >
 Specialization for TemperatureCubitBcData. More...
 
struct  EssentialPreProcReaction
 Class (Function) to calculate residual side diagonal. More...
 
struct  EssentialPreProcReaction< DisplacementCubitBcData >
 Specialization for DisplacementCubitBcData. More...
 
struct  FaceElementForcesAndSourcesCore
 Face finite element. More...
 
struct  FaceElementForcesAndSourcesCoreOnChildParent
 Base face element used to integrate on skeleton. More...
 
struct  FaceElementForcesAndSourcesCoreOnChildParentSwitch
 
struct  FaceElementForcesAndSourcesCoreOnSide
 Base face element used to integrate on skeleton. More...
 
struct  FaceElementForcesAndSourcesCoreOnSideSwitch
 
struct  FatPrismElementForcesAndSourcesCore
 FatPrism finite element. More...
 
struct  FatPrismPolynomialBase
 Calculate base functions on tetrahedral. More...
 
struct  FatPrismPolynomialBaseCtx
 Class used to pass element data to calculate base functions on fat prism. More...
 
struct  FE_Unique_mi_tag
 
struct  FEDofEntity
 keeps information about indexed dofs for the finite element More...
 
struct  FEEnt_mi_tag
 
struct  FEMethod
 structure for User Loop Methods on finite elements More...
 
struct  FENumeredDofEntity
 keeps information about indexed dofs for the finite element More...
 
struct  Field
 Provide data structure for (tensor) field approximation. More...
 
struct  FieldBlas
 Basic algebra on fields. More...
 
struct  FieldEntity
 Struct keeps handle to entity in the field. More...
 
struct  FieldEntity_change_order
 structure to change FieldEntity order More...
 
struct  FieldEntityEntFiniteElementAdjacencyMap
 FieldEntityEntFiniteElementAdjacencyMap of mofem finite element and entities. More...
 
struct  FieldEntityEntFiniteElementAdjacencyMap_change_ByWhat
 
struct  FieldEvaluatorInterface
 Field evaluator interface. More...
 
struct  FieldName_mi_tag
 MultiIndex Tag for field name. More...
 
struct  FieldSeries
 Structure for recording (time) series. More...
 
struct  FieldSeriesStep
 Structure for keeping time and step. More...
 
struct  FiniteElement
 Finite element definition. More...
 
struct  FiniteElement_change_bit_add
 Add field to data. More...
 
struct  FiniteElement_change_bit_off
 Unset field from data. More...
 
struct  FiniteElement_change_bit_reset
 Reset field from data. More...
 
struct  FiniteElement_col_change_bit_add
 Add field to column. More...
 
struct  FiniteElement_col_change_bit_off
 Unset field from column. More...
 
struct  FiniteElement_col_change_bit_reset
 Reset field from column. More...
 
struct  FiniteElement_Meshset_mi_tag
 
struct  FiniteElement_name_mi_tag
 
struct  FiniteElement_row_change_bit_add
 Add field to row. More...
 
struct  FiniteElement_row_change_bit_off
 Unset field from row. More...
 
struct  FiniteElement_row_change_bit_reset
 Reset field from row. More...
 
struct  FlatPrismElementForcesAndSourcesCore
 FlatPrism finite element. More...
 
struct  FlatPrismPolynomialBase
 Calculate base functions on tetrahedral. More...
 
struct  FlatPrismPolynomialBaseCtx
 Class used to pass element data to calculate base functions on flat prism. More...
 
struct  FluxOpType
 Wrapper to generate natural b.c. specialisation based on operator type. More...
 
struct  ForceCubitBcData
 Definition of the force bc data structure. More...
 
struct  ForcesAndSourcesCore
 structure to get information form mofem into EntitiesFieldData More...
 
struct  FormsIntegrators
 Integrator forms. More...
 
struct  GenericAttributeData
 Generic attribute data structure. More...
 
struct  GenericCubitBcData
 Generic bc data structure. More...
 
struct  GetFTensor0FromVecImpl
 
struct  GetFTensor1FromArray
 
struct  GetFTensor1FromArray< 1, S >
 
struct  GetFTensor1FromArray< 2, S >
 
struct  GetFTensor1FromArray< 3, S >
 
struct  GetFTensor1FromArray< 4, S >
 
struct  GetFTensor1FromArray< 6, S >
 
struct  GetFTensor1FromArray< 9, S >
 
struct  GetFTensor1FromMatImpl
 
struct  GetFTensor1FromMatImpl< 1, S, T, ublas::row_major, A >
 
struct  GetFTensor1FromMatImpl< 2, S, T, ublas::row_major, A >
 
struct  GetFTensor1FromMatImpl< 3, S, T, ublas::row_major, A >
 
struct  GetFTensor1FromMatImpl< 4, S, T, ublas::row_major, A >
 
struct  GetFTensor1FromMatImpl< 6, S, T, ublas::row_major, A >
 
struct  GetFTensor1FromMatImpl< 9, S, T, ublas::row_major, A >
 
struct  GetFTensor1FromPtrImpl
 
struct  GetFTensor1FromPtrImpl< 1, S, T >
 
struct  GetFTensor1FromPtrImpl< 2, S, T >
 
struct  GetFTensor1FromPtrImpl< 3, S, T >
 
struct  GetFTensor1FromPtrImpl< 4, S, T >
 
struct  GetFTensor1FromPtrImpl< 6, S, T >
 
struct  GetFTensor2FromArrayImpl
 Get FTensor2 from array. More...
 
struct  GetFTensor2FromArrayImpl< 2, 2, S, T, L, A >
 
struct  GetFTensor2FromArrayImpl< 3, 3, S, T, L, A >
 
struct  GetFTensor2FromArrayRawPtrImpl
 
struct  GetFTensor2FromArrayRawPtrImpl< 2, 2, T, L, A >
 
struct  GetFTensor2FromArrayRawPtrImpl< 3, 3, T, L, A >
 
struct  GetFTensor2FromMatImpl
 
struct  GetFTensor2FromPtr
 
struct  GetFTensor2FromPtr< 1, 1, S, T >
 
struct  GetFTensor2FromPtr< 1, 2, S, T >
 
struct  GetFTensor2FromPtr< 1, 3, S, T >
 
struct  GetFTensor2FromPtr< 2, 2, S, T >
 
struct  GetFTensor2FromPtr< 3, 2, S, T >
 
struct  GetFTensor2FromPtr< 3, 3, S, T >
 
struct  GetFTensor2FromPtr< 6, 6, S, T >
 
struct  GetFTensor2SymmetricFromMatImpl
 
struct  GetFTensor2SymmetricFromMatImpl< 2, S, T, L, A >
 
struct  GetFTensor2SymmetricFromMatImpl< 3, S, T, L, A >
 
struct  GetFTensor3DgFromMatImpl
 
struct  GetFTensor3DgFromMatImpl< 1, 1, S, T, ublas::row_major, A >
 
struct  GetFTensor3DgFromMatImpl< 2, 2, S, T, ublas::row_major, A >
 
struct  GetFTensor3DgFromMatImpl< 3, 3, S, T, ublas::row_major, A >
 
struct  GetFTensor3FromMatImpl
 
struct  GetFTensor3FromMatImpl< 1, 1, 1, S, T, ublas::row_major, A >
 
struct  GetFTensor3FromMatImpl< 2, 2, 2, S, T, ublas::row_major, A >
 
struct  GetFTensor3FromMatImpl< 2, 2, 3, S, T, ublas::row_major, A >
 
struct  GetFTensor3FromMatImpl< 3, 2, 2, S, T, ublas::row_major, A >
 
struct  GetFTensor3FromMatImpl< 3, 3, 3, S, T, ublas::row_major, A >
 
struct  GetFTensor3FromMatImpl< 3, 3, 6, S, T, ublas::row_major, A >
 
struct  GetFTensor3FromMatImpl< 6, 3, 3, S, T, ublas::row_major, A >
 
struct  GetFTensor4DdgFromMatImpl
 
struct  GetFTensor4DdgFromMatImpl< 1, 1, S, T, ublas::row_major, A >
 
struct  GetFTensor4DdgFromMatImpl< 2, 2, S, T, ublas::row_major, A >
 
struct  GetFTensor4DdgFromMatImpl< 3, 3, S, T, ublas::row_major, A >
 
struct  GetFTensor4DdgFromPtrImpl
 
struct  GetFTensor4DdgFromPtrImpl< 3, 3, S, T >
 
struct  GetFTensor4FromMatImpl
 
struct  GetFTensor4FromMatImpl< 1, 1, 1, 1, S, T, ublas::row_major, A >
 
struct  GetFTensor4FromMatImpl< 2, 2, 2, 2, S, T, ublas::row_major, A >
 
struct  GetFTensor4FromMatImpl< 3, 3, 3, 3, S, T, ublas::row_major, A >
 
struct  HashBit
 
struct  HeatFluxCubitBcData
 Definition of the heat flux bc data structure. More...
 
struct  HexPolynomialBase
 Calculate base functions on tetrahedral. More...
 
struct  Idx_mi_tag
 
struct  IdxDataType
 
struct  IdxDataTypePtr
 
struct  IntegratedJacobiPolynomial
 
struct  IntegratedJacobiPolynomialCtx
 
struct  interface_DofEntity
 Interface to DofEntity. More...
 
struct  interface_EntFiniteElement
 interface to EntFiniteElement More...
 
struct  interface_Field
 
struct  interface_Field< T, T >
 
struct  interface_FieldEntity
 Interface to FieldEntity. More...
 
struct  interface_FieldImpl
 Pointer interface for MoFEM::Field. More...
 
struct  interface_FieldSeries
 
struct  interface_FiniteElement
 
struct  interface_FiniteElement< T, T >
 
struct  interface_FiniteElementImpl
 Inetface for FE. More...
 
struct  interface_RefElement
 intrface to RefElement More...
 
struct  interface_RefEntity
 interface to RefEntity More...
 
struct  InvertTensorImpl
 
struct  InvertTensorImpl< T1, T2, T3, 2 >
 
struct  InvertTensorImpl< T1, T2, T3, 3 >
 
struct  ISManager
 Section manager is used to create indexes and sections. More...
 
struct  JacobiPolynomial
 Calculating Legendre base functions. More...
 
struct  JacobiPolynomialCtx
 Class used to give arguments to Legendre base functions. More...
 
struct  KernelLobattoPolynomial
 Calculating Lobatto base functions. More...
 
struct  KernelLobattoPolynomialCtx
 Class used to give arguments to Kernel Lobatto base functions. More...
 
struct  KeyFromKey
 
struct  KspCtx
 Interface for linear (KSP) solver. More...
 
struct  KspMethod
 data structure for ksp (linear solver) context More...
 
struct  LegendrePolynomial
 Calculating Legendre base functions. More...
 
struct  LegendrePolynomialCtx
 Class used to give arguments to Legendre base functions. More...
 
struct  LobattoPolynomial
 Calculating Lobatto base functions. More...
 
struct  LobattoPolynomialCtx
 Class used to give arguments to Lobatto base functions. More...
 
struct  LogManager
 Log manager is used to build and partition problems. More...
 
struct  LtBit
 
struct  Mat_Elastic
 Elastic material data structure. More...
 
struct  Mat_Elastic_EberleinHolzapfel1
 Mat_Elastic with Fibres. More...
 
struct  Mat_Elastic_TransIso
 Transverse Isotropic material data structure. More...
 
struct  Mat_Interf
 Linear interface data structure. More...
 
struct  Mat_Moisture
 moisture transport material data structure More...
 
struct  Mat_Thermal
 Thermal material data structure. More...
 
struct  MatrixManager
 Matrix manager is used to build and partition problems. More...
 
struct  MedInterface
 Interface for load MED files. More...
 
struct  MeshRefinement
 Mesh refinement interface. More...
 
struct  Meshset_mi_tag
 
struct  MeshsetsManager
 Interface for managing meshsets containing materials and boundary conditions. More...
 
struct  Modify_change_nothing
 Do nothing, used to rebuild database. More...
 
struct  MPCsType
 
struct  NaturalBC
 Natural boundary conditions. More...
 
struct  NaturalForceMeshsets
 Type generating specialisation for force meshsets. More...
 
struct  NaturalForceMeshsetsScalarAndVectorScaling
 Type generating specialisation for force meshsets. More...
 
struct  NaturalMeshsetType
 Type generating natural b.c. specialisations for meshsets. More...
 
struct  NaturalMeshsetTypeVectorScaling
 
struct  NaturalTemperatureMeshsets
 Type generating specialisation for temperature meshsets. More...
 
struct  NodeMergerInterface
 Merge node by collapsing edge between them. More...
 
struct  NumeredDofEntity
 keeps information about indexed dofs for the problem More...
 
struct  NumeredDofEntity_local_idx_change
 
struct  NumeredDofEntity_mofem_index_change
 
struct  NumeredDofEntity_part_and_all_indices_change
 
struct  NumeredDofEntity_part_and_glob_idx_change
 
struct  NumeredDofEntity_part_and_indices_change
 
struct  NumeredDofEntity_part_and_mofem_glob_idx_change
 
struct  NumeredEntFiniteElement
 Partitioned (Indexed) Finite Element in Problem. More...
 
struct  NumeredEntFiniteElement_change_part
 Change finite element part. More...
 
struct  OpAddParentEntData
 Operator to project base functions from parent entity to child. More...
 
struct  OpBaseDerivativesBase
 
struct  OpBaseDerivativesMass
 
struct  OpBaseDerivativesMass< 1 >
 
struct  OpBaseDerivativesMass< 3 >
 
struct  OpBaseDerivativesNext
 
struct  OpBaseDerivativesNext< 1 >
 Specialisation for calculate derivatives for scalar base functions. More...
 
struct  OpBaseDerivativesNext< 3 >
 Specialisation for calculate derivatives for scalar base functions. More...
 
struct  OpBaseDerivativesSetHOInvJacobian
 
struct  OpBaseDerivativesSetHOInvJacobian< 2 >
 
struct  OpBaseImpl
 
struct  OpBaseTimesScalarImpl
 
struct  OpBaseTimesScalarImpl< 1, S, GAUSS, OpBase >
 
struct  OpBaseTimesVectorImpl
 
struct  OpBaseTimesVectorImpl< 1, FIELD_DIM, S, GAUSS, OpBase >
 
struct  OpBaseTimesVectorImpl< 3, FIELD_DIM, S, GAUSS, OpBase >
 
struct  OpBrokenBaseImpl
 
struct  OpBrokenLoopSide
 
struct  OpBrokenSpaceConstrainDFluxImpl
 
struct  OpBrokenSpaceConstrainDFluxImpl< FIELD_DIM, GAUSS, OpBrokenBase >
 
struct  OpBrokenSpaceConstrainDHybridImpl
 
struct  OpBrokenSpaceConstrainDHybridImpl< FIELD_DIM, GAUSS, OpBase >
 
struct  OpBrokenSpaceConstrainImpl
 
struct  OpBrokenSpaceConstrainImpl< FIELD_DIM, GAUSS, OpBrokenBase >
 
struct  OpCalcNormL2Tensor0
 Get norm of input VectorDouble for Tensor0. More...
 
struct  OpCalcNormL2Tensor1
 Get norm of input MatrixDouble for Tensor1. More...
 
struct  OpCalcNormL2Tensor2
 Get norm of input MatrixDouble for Tensor2. More...
 
struct  OpCalculateDivergenceVectorFieldValues
 Calculate field values (template specialization) for tensor field rank 1, i.e. vector field. More...
 
struct  OpCalculateHcurlVectorCurl
 Calculate curl of vector field. More...
 
struct  OpCalculateHcurlVectorCurl< 1, 2 >
 Calculate curl of vector field. More...
 
struct  OpCalculateHcurlVectorCurl< 1, 3 >
 Calculate curl of vector field. More...
 
struct  OpCalculateHcurlVectorCurl< 3, 3 >
 Calculate curl of vector field. More...
 
struct  OpCalculateHdivVectorDivergence
 Calculate divergence of vector field. More...
 
struct  OpCalculateHdivVectorDivergenceDot
 Calculate divergence of vector field dot. More...
 
struct  OpCalculateHOCoords
 Calculate HO coordinates at gauss points. More...
 
struct  OpCalculateHOJac
 
struct  OpCalculateHOJac< 2 >
 
struct  OpCalculateHOJac< 3 >
 
struct  OpCalculateHOJacForFaceImpl
 Calculate jacobian for face element. More...
 
struct  OpCalculateHOJacForFaceImpl< 2 >
 
struct  OpCalculateHOJacForFaceImpl< 3 >
 
struct  OpCalculateHOJacForVolume
 Calculate jacobian on Hex or other volume which is not simplex. More...
 
struct  OpCalculateHTensorTensorField
 Calculate tenor field using tensor base, i.e. Hdiv/Hcurl. More...
 
struct  OpCalculateHVecTensorDivergence
 Calculate divergence of tonsorial field using vectorial base. More...
 
struct  OpCalculateHVecTensorField
 Calculate tenor field using vectorial base, i.e. Hdiv/Hcurl. More...
 
struct  OpCalculateHVecTensorTrace
 Calculate trace of vector (Hdiv/Hcurl) space. More...
 
struct  OpCalculateHVecVectorField
 Get vector field for H-div approximation. More...
 
struct  OpCalculateHVecVectorField_General
 Get vector field for H-div approximation. More...
 
struct  OpCalculateHVecVectorField_General< 3, Field_Dim, double, ublas::row_major, DoubleAllocator >
 Get vector field for H-div approximation. More...
 
struct  OpCalculateHVecVectorFieldDot
 Get vector field for H-div approximation. More...
 
struct  OpCalculateHVecVectorFieldDot< 3, Field_Dim >
 
struct  OpCalculateHVecVectorGradient
 Calculate gradient of vector field. More...
 
struct  OpCalculateHVecVectorHessian
 Calculate gradient of vector field. More...
 
struct  OpCalculateInvJacForFatPrism
 Calculate inverse of jacobian for face element. More...
 
struct  OpCalculateInvJacForFlatPrism
 Calculate inverse of jacobian for face element. More...
 
struct  OpCalculateScalarFieldGradient
 Get field gradients at integration pts for scalar filed rank 0, i.e. vector field. More...
 
struct  OpCalculateScalarFieldGradient_General
 Evaluate field gradient values for scalar field, i.e. gradient is tensor rank 1 (vector) More...
 
struct  OpCalculateScalarFieldGradient_General< Tensor_Dim, double, ublas::row_major, DoubleAllocator >
 Evaluate field gradient values for scalar field, i.e. gradient is tensor rank 1 (vector), specialization. More...
 
struct  OpCalculateScalarFieldHessian
 Evaluate field gradient values for scalar field, i.e. gradient is tensor rank 1 (vector), specialization. More...
 
struct  OpCalculateScalarFieldValues
 Get value at integration points for scalar field. More...
 
struct  OpCalculateScalarFieldValues_General
 Scalar field values at integration points. More...
 
struct  OpCalculateScalarFieldValuesFromPetscVecImpl
 Get rate of scalar field at integration points. More...
 
struct  OpCalculateTensor2FieldValues
 Get values at integration pts for tensor filed rank 2, i.e. matrix field. More...
 
struct  OpCalculateTensor2FieldValues_General
 Calculate field values for tenor field rank 2. More...
 
struct  OpCalculateTensor2FieldValues_General< Tensor_Dim0, Tensor_Dim1, double, ublas::row_major, DoubleAllocator >
 
struct  OpCalculateTensor2FieldValuesDot
 Get time direvarive values at integration pts for tensor filed rank 2, i.e. matrix field. More...
 
struct  OpCalculateTensor2SymmetricFieldGradient
 Get field gradients at integration pts for symmetric tensorial field rank 2. More...
 
struct  OpCalculateTensor2SymmetricFieldGradient_General
 Evaluate field gradient values for symmetric 2nd order tensor field, i.e. gradient is tensor rank 3. More...
 
struct  OpCalculateTensor2SymmetricFieldGradient_General< Tensor_Dim0, Tensor_Dim1, double, ublas::row_major, DoubleAllocator >
 
struct  OpCalculateTensor2SymmetricFieldValues
 Calculate symmetric tensor field values at integration pts. More...
 
struct  OpCalculateTensor2SymmetricFieldValuesDot
 Calculate symmetric tensor field rates ant integratio pts. More...
 
struct  OpCalculateTraceFromMat
 Calculates the trace of an input matrix. More...
 
struct  OpCalculateTraceFromSymmMat
 Calculates the trace of an input matrix. More...
 
struct  OpCalculateVectorFieldGradient
 Get field gradients at integration pts for scalar filed rank 0, i.e. vector field. More...
 
struct  OpCalculateVectorFieldGradient_General
 Evaluate field gradient values for vector field, i.e. gradient is tensor rank 2. More...
 
struct  OpCalculateVectorFieldGradient_General< Tensor_Dim0, Tensor_Dim1, double, ublas::row_major, DoubleAllocator >
 
struct  OpCalculateVectorFieldGradientDot
 Get field gradients time derivative at integration pts for scalar filed rank 0, i.e. vector field. More...
 
struct  OpCalculateVectorFieldHessian
 
struct  OpCalculateVectorFieldValues
 Get values at integration pts for tensor filed rank 1, i.e. vector field. More...
 
struct  OpCalculateVectorFieldValues_General
 Calculate field values for tenor field rank 1, i.e. vector field. More...
 
struct  OpCalculateVectorFieldValues_General< Tensor_Dim, double, ublas::row_major, DoubleAllocator >
 Calculate field values (template specialization) for tensor field rank 1, i.e. vector field. More...
 
struct  OpCalculateVectorFieldValuesFromPetscVecImpl
 Approximate field values for given petsc vector. More...
 
struct  OpConvectiveTermLhsDuImpl
 
struct  OpConvectiveTermLhsDuImpl< 1, 1, SPACE_DIM, GAUSS, OpBase >
 
struct  OpConvectiveTermLhsDuImpl< 1, FIELD_DIM, SPACE_DIM, GAUSS, OpBase >
 
struct  OpConvectiveTermLhsDyImpl
 
struct  OpConvectiveTermLhsDyImpl< 1, 1, SPACE_DIM, GAUSS, OpBase >
 
struct  OpConvectiveTermLhsDyImpl< 1, FIELD_DIM, SPACE_DIM, GAUSS, OpBase >
 
struct  OpConvectiveTermRhsImpl
 
struct  OpConvectiveTermRhsImpl< 1, 1, SPACE_DIM, GAUSS, OpBase >
 
struct  OpConvectiveTermRhsImpl< 1, FIELD_DIM, SPACE_DIM, GAUSS, OpBase >
 
struct  OpCopyGeomDataToE
 Copy geometry-related data from one element to other. More...
 
struct  OpCopyGeomDataToE< 2 >
 Copy geometry-related data from one element to other. More...
 
struct  OpDGProjectionCoefficients
 
struct  OpDGProjectionEvaluation
 
struct  OpDGProjectionMassMatrix
 
struct  OperatorsTester
 Calculate directional derivative of the right hand side and compare it with tangent matrix derivative. More...
 
struct  OpEssentialLhsImpl
 Enforce essential constrains on lhs. More...
 
struct  OpEssentialLhsImpl< DisplacementCubitBcData, BASE_DIM, FIELD_DIM, A, I, OpBase >
 
struct  OpEssentialLhsImpl< HeatFluxCubitBcData, BASE_DIM, FIELD_DIM, A, I, OpBase >
 
struct  OpEssentialLhsImpl< MPCsType, BASE_DIM, FIELD_DIM, A, I, OpBase >
 
struct  OpEssentialLhsImpl< TemperatureCubitBcData, 1, 1, A, I, OpBase >
 
struct  OpEssentialRhsImpl
 Enforce essential constrains on rhs. More...
 
struct  OpEssentialRhsImpl< DisplacementCubitBcData, 1, FIELD_DIM, A, I, OpBase >
 
struct  OpEssentialRhsImpl< HeatFluxCubitBcData, 3, 2, A, GAUSS, OpBase >
 
struct  OpEssentialRhsImpl< HeatFluxCubitBcData, 3, 3, A, GAUSS, OpBase >
 
struct  OpEssentialRhsImpl< MPCsType, 1, FIELD_DIM, A, I, OpBase >
 
struct  OpEssentialRhsImpl< TemperatureCubitBcData, 1, 1, A, I, OpBase >
 
struct  OpFluxLhsImpl
 
struct  OpFluxRhsImpl
 
struct  OpFluxRhsImpl< NaturalMeshsetType< BLOCKSET >, 1, 1, A, I, OpBase >
 
struct  OpFluxRhsImpl< NaturalMeshsetType< BLOCKSET >, 1, FIELD_DIM, A, I, OpBase >
 
struct  OpFluxRhsImpl< NaturalMeshsetType< BLOCKSET >, 3, FIELD_DIM, A, I, OpBase >
 
struct  OpFluxRhsImpl< NaturalMeshsetType< FORCESET >, 1, FIELD_DIM, A, I, OpBase >
 
struct  OpFluxRhsImpl< NaturalMeshsetType< HEATFLUXSET >, 1, 1, A, I, OpBase >
 
struct  OpFluxRhsImpl< NaturalMeshsetType< PRESSURESET >, 1, FIELD_DIM, A, I, OpBase >
 
struct  OpFluxRhsImpl< NaturalMeshsetType< TEMPERATURESET >, 3, FIELD_DIM, A, I, OpBase >
 
struct  OpFluxRhsImpl< NaturalMeshsetType< UNKNOWNSET >, 1, 1, A, I, OpBase >
 
struct  OpFluxRhsImpl< NaturalMeshsetType< UNKNOWNSET >, 1, FIELD_DIM, A, I, OpBase >
 Base class for OpFluxRhsImpl<NaturalMeshsetType<T>, 1, FIELD_DIM, A, I, OpBase> More...
 
struct  OpFluxRhsImpl< NaturalMeshsetType< UNKNOWNSET >, 3, FIELD_DIM, A, I, OpBase >
 
struct  OpFluxRhsImpl< NaturalMeshsetTypeVectorScaling< BLOCKSET >, 1, FIELD_DIM, A, I, OpBase >
 
struct  OpFluxRhsImpl< NaturalMeshsetTypeVectorScaling< UNKNOWNSET >, 1, FIELD_DIM, A, I, OpBase >
 
struct  OpGetBrokenBaseSideData
 
struct  OpGetCoordsAndNormalsOnPrism
 calculate normals at Gauss points of triangle element More...
 
struct  OpGetDataAndGradient
 Get field values and gradients at Gauss points. More...
 
struct  OpGetHONormalsOnFace
 Calculate normals at Gauss points of triangle element. More...
 
struct  OpGetHOTangentOnEdge
 Calculate tangent vector on edge form HO geometry approximation. More...
 
struct  OpGetHOTangentsOnEdge
 Calculate tangent vector on edge form HO geometry approximation. More...
 
struct  OpGetTensor0fromFunc
 Get values from scalar function at integration points and save them to VectorDouble for Tensor0. More...
 
struct  OpGetTensor1fromFunc
 
struct  OpGradGradImpl
 
struct  OpGradGradImpl< 1, 1, SPACE_DIM, GAUSS, OpBase >
 
struct  OpGradGradImpl< 1, FIELD_DIM, SPACE_DIM, GAUSS, OpBase >
 
struct  OpGradGradSymTensorGradGradImpl
 
struct  OpGradGradSymTensorGradGradImpl< 1, 1, SPACE_DIM, S, GAUSS, OpBase >
 
struct  OpGradSymTensorGradImpl
 
struct  OpGradSymTensorGradImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >
 
struct  OpGradTensorGradImpl
 
struct  OpGradTensorGradImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >
 
struct  OpGradTimesSymTensorImpl
 
struct  OpGradTimesSymTensorImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >
 
struct  OpGradTimesTensorImpl
 
struct  OpGradTimesTensorImpl< 1, 1, SPACE_DIM, S, GAUSS, OpBase >
 
struct  OpGradTimesTensorImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >
 
struct  OpHOSetContravariantPiolaTransformOnEdge3D
 transform Hcurl base fluxes from reference element to physical edge More...
 
struct  OpHOSetContravariantPiolaTransformOnFace3D
 transform Hdiv base fluxes from reference element to physical triangle More...
 
struct  OpHOSetCovariantPiolaTransformOnFace3D
 transform Hcurl base fluxes from reference element to physical triangle More...
 
struct  OpInvertMatrix
 
struct  OpLoopSide
 Element used to execute operators on side of the element. More...
 
struct  OpLoopThis
 Execute "this" element in the operator. More...
 
struct  OpMakeHdivFromHcurl
 Make Hdiv space from Hcurl space in 2d. More...
 
struct  OpMassCacheImpl
 
struct  OpMassCacheImpl< 1, FIELD_DIM, I, OpBase >
 
struct  OpMassImpl
 
struct  OpMassImpl< 1, 1, GAUSS, OpBase >
 
struct  OpMassImpl< 1, FIELD_DIM, GAUSS, OpBase >
 
struct  OpMassImpl< 3, 4, GAUSS, OpBase >
 
struct  OpMassImpl< 3, 9, GAUSS, OpBase >
 
struct  OpMassImpl< 3, FIELD_DIM, GAUSS, OpBase >
 
struct  OpMixDivTimesScalarImpl
 
struct  OpMixDivTimesScalarImpl< SPACE_DIM, GAUSS, OpBase >
 
struct  OpMixDivTimesUImpl
 
struct  OpMixDivTimesUImpl< 1, FIELD_DIM, FIELD_DIM, GAUSS, OpBase, CoordSys >
 
struct  OpMixDivTimesUImpl< 3, 1, SPACE_DIM, GAUSS, OpBase, CoordSys >
 
struct  OpMixDivTimesUImpl< 3, FIELD_DIM, SPACE_DIM, GAUSS, OpBase, CoordSys >
 
struct  OpMixDivTimesVecImpl
 
struct  OpMixDivTimesVecImpl< SPACE_DIM, GAUSS, OpBase, CoordSys >
 
struct  OpMixScalarTimesDivImpl
 
struct  OpMixScalarTimesDivImpl< SPACE_DIM, GAUSS, OpBase, COORDINATE_SYSTEM >
 
struct  OpMixTensorTimesGradImpl
 
struct  OpMixTensorTimesGradImpl< SPACE_DIM, GAUSS, OpBase >
 
struct  OpMixTensorTimesGradUImpl
 Tensor field time gradient of vector field. More...
 
struct  OpMixTensorTimesGradUImpl< SPACE_DIM, GAUSS, OpBase >
 
struct  OpMixVecTimesDivLambdaImpl
 Vector filed time divergence of tensor. More...
 
struct  OpMixVecTimesDivLambdaImpl< SPACE_DIM, GAUSS, OpBase >
 
struct  OpMixVectorTimesGradImpl
 
struct  OpMixVectorTimesGradImpl< 1, SPACE_DIM, SPACE_DIM, GAUSS, OpBase >
 
struct  OpMixVectorTimesGradImpl< 3, SPACE_DIM, SPACE_DIM, GAUSS, OpBase >
 
struct  OpMultiplyDeterminantOfJacobianAndWeightsForFatPrisms
 Operator for fat prism element updating integration weights in the volume. More...
 
struct  OpNormalMixVecTimesScalarImpl
 Multiply vector times normal on the face times scalar function. More...
 
struct  OpNormalMixVecTimesScalarImpl< 2, GAUSS, OpBase >
 
struct  OpNormalMixVecTimesScalarImpl< 3, GAUSS, OpBase >
 
struct  OpNormalMixVecTimesVectorFieldImpl
 Multiply vector times normal on the face times vector field. More...
 
struct  OpNormalMixVecTimesVectorFieldImpl< SPACE_DIM, GAUSS, OpBase >
 
struct  OpPostProcMapInMoab
 Post post-proc data at points from hash maps. More...
 
struct  OpRunParent
 Operator to execute finite element instance on parent element. This operator is typically used to project field from parent to child, or vice versa. It enables to evaluate filed data of parent entity on chile entity integration points. More...
 
struct  OpScaleBaseBySpaceInverseOfMeasure
 Scale base functions by inverses of measure of element. More...
 
struct  OpScaleMatrix
 
struct  OpSchurAssembleBase
 
struct  OpSchurAssembleBaseImpl
 
struct  OpSchurAssembleBegin
 Clear Schur complement internal data. More...
 
struct  OpSchurAssembleEnd
 Assemble Schur complement. More...
 
struct  OpSchurAssembleEnd< SchurDGESV >
 
struct  OpSchurAssembleEnd< SchurDSYSV >
 
struct  OpSchurAssembleEndImpl
 Assemble Schur complement (Implementation) More...
 
struct  OpSetBc
 Set indices on entities on finite element. More...
 
struct  OpSetContravariantPiolaTransform
 apply contravariant (Piola) transfer to Hdiv space More...
 
struct  OpSetContravariantPiolaTransformOnEdge2D
 
struct  OpSetContravariantPiolaTransformOnFace
 transform Hdiv base fluxes from reference element to physical triangle More...
 
struct  OpSetContravariantPiolaTransformOnFace2DImpl
 Apply contravariant (Piola) transfer to Hdiv space on face. More...
 
struct  OpSetContravariantPiolaTransformOnFace2DImpl< 2 >
 
struct  OpSetContravariantPiolaTransformOnFace2DImpl< 3 >
 
struct  OpSetCovariantPiolaTransform
 apply covariant transfer to Hcurl space More...
 
struct  OpSetCovariantPiolaTransformOnEdge
 transform Hcurl base fluxes from reference element to physical edge More...
 
struct  OpSetCovariantPiolaTransformOnFace
 transform Hcurl base fluxes from reference element to physical triangle More...
 
struct  OpSetCovariantPiolaTransformOnFace2DImpl
 Transform Hcurl base fluxes from reference element to physical triangle. More...
 
struct  OpSetCovariantPiolaTransformOnFace2DImpl< 2 >
 Apply contravariant (Piola) transfer to Hdiv space on face. More...
 
struct  OpSetFlux
 
struct  OpSetHOContravariantPiolaTransform
 Apply contravariant (Piola) transfer to Hdiv space for HO geometry. More...
 
struct  OpSetHOCovariantPiolaTransform
 Apply covariant (Piola) transfer to Hcurl space for HO geometry. More...
 
struct  OpSetHOInvJacToScalarBases
 Set inverse jacobian to base functions. More...
 
struct  OpSetHOInvJacToScalarBases< 2 >
 
struct  OpSetHOInvJacToScalarBasesImpl
 
struct  OpSetHOInvJacVectorBase
 transform local reference derivatives of shape function to global derivatives if higher order geometry is given More...
 
struct  OpSetHOWeights
 Set inverse jacobian to base functions. More...
 
struct  OpSetHOWeightsOnEdge
 Modify integration weights on face to take in account higher-order geometry. More...
 
struct  OpSetHOWeightsOnFace
 Modify integration weights on face to take in account higher-order geometry. More...
 
struct  OpSetHOWeightsOnSubDim
 
struct  OpSetHOWeightsOnSubDim< 2 >
 
struct  OpSetHOWeightsOnSubDim< 3 >
 
struct  OpSetInvJacH1
 Transform local reference derivatives of shape function to global derivatives. More...
 
struct  OpSetInvJacH1ForFace
 
struct  OpSetInvJacH1ForFaceEmbeddedIn3DSpace
 
struct  OpSetInvJacH1ForFatPrism
 Transform local reference derivatives of shape functions to global derivatives. More...
 
struct  OpSetInvJacH1ForFlatPrism
 Transform local reference derivatives of shape functions to global derivatives. More...
 
struct  OpSetInvJacHcurlFaceImpl
 Transform local reference derivatives of shape function to global derivatives for face. More...
 
struct  OpSetInvJacHcurlFaceImpl< 2 >
 
struct  OpSetInvJacHcurlFaceImpl< 3 >
 
struct  OpSetInvJacHdivAndHcurl
 brief Transform local reference derivatives of shape function to global derivatives More...
 
struct  OpSetInvJacL2ForFace
 
struct  OpSetInvJacL2ForFaceEmbeddedIn3DSpace
 
struct  OpSetInvJacSpaceForFaceImpl
 Transform local reference derivatives of shape functions to global derivatives. More...
 
struct  OpSetInvJacSpaceForFaceImpl< 2, 1 >
 
struct  OpSetInvJacSpaceForFaceImpl< 2, 2 >
 
struct  OpSetInvJacSpaceForFaceImpl< 3, 1 >
 
struct  OpSetInvJacToScalarBasesBasic
 
struct  OpSourceImpl
 
struct  OpSourceImpl< 1, 1, GAUSS, SourceFunctionSpecialization::S< OpBase > >
 Integrate source. More...
 
struct  OpSourceImpl< 1, FIELD_DIM, GAUSS, SourceFunctionSpecialization::S< OpBase > >
 
struct  OpSourceImpl< 3, FIELD_DIM, GAUSS, SourceFunctionSpecialization::S< OpBase > >
 
struct  OpSourceImpl< 3, FIELD_DIM, I, SourceBoundaryNormalSpecialization::S< OpBase > >
 This is specialisation for sources on boundary which depends on normal. More...
 
struct  OpSymmetrizeTensor
 
struct  OpTensorTimesSymmetricTensor
 Calculate \( \pmb\sigma_{ij} = \mathbf{D}_{ijkl} \pmb\varepsilon_{kl} \). More...
 
struct  OpUnSetBc
 
struct  Order_mi_tag
 MultiIndex Tag for field order. More...
 
struct  PairNameFEMethodPtr
 
struct  ParentFiniteElementAdjacencyFunction
 Create adjacency to parent elements. More...
 
struct  ParentFiniteElementAdjacencyFunctionSkeleton
 Create adjacency to parent skeleton elements. More...
 
struct  Part_mi_tag
 
struct  PCMGSetUpViaApproxOrdersCtx
 
struct  PCMGSubMatrixCtx
 
struct  PetscData
 
struct  PetscGlobalIdx_mi_tag
 
struct  PetscLocalIdx_mi_tag
 
struct  PipelineManager
 PipelineManager interface. More...
 
struct  PostProcBrokenMeshInMoab
 
struct  PostProcBrokenMeshInMoab< EdgeElementForcesAndSourcesCore >
 
struct  PostProcBrokenMeshInMoab< FaceElementForcesAndSourcesCore >
 
struct  PostProcBrokenMeshInMoab< VolumeElementForcesAndSourcesCore >
 
struct  PostProcBrokenMeshInMoabBase
 
struct  PostProcBrokenMeshInMoabBaseBeginImpl
 
struct  PostProcBrokenMeshInMoabBaseContImpl
 
struct  PostProcBrokenMeshInMoabBaseEndImpl
 
struct  PostProcGenerateRefMesh
 Element for postprocessing. Uses MoAB to generate post-processing mesh. More...
 
struct  PostProcGenerateRefMesh< MBEDGE >
 
struct  PostProcGenerateRefMesh< MBHEX >
 
struct  PostProcGenerateRefMesh< MBQUAD >
 
struct  PostProcGenerateRefMesh< MBTET >
 
struct  PostProcGenerateRefMesh< MBTRI >
 
struct  PostProcGenerateRefMeshBase
 
struct  PressureCubitBcData
 Definition of the pressure bc data structure. More...
 
struct  PrismInterface
 Create interface from given surface and insert flat prisms in-between. More...
 
struct  PrismsFromSurfaceInterface
 merge node from two bit levels More...
 
struct  Problem
 keeps basic data about problem More...
 
struct  Problem_mi_tag
 
struct  ProblemChangeRefLevelBitAdd
 add ref level to problem More...
 
struct  ProblemChangeRefLevelBitDofMaskAdd
 set prof dof bit ref mask More...
 
struct  ProblemChangeRefLevelBitDofMaskSet
 set prof dof bit ref mask More...
 
struct  ProblemChangeRefLevelBitSet
 set ref level to problem More...
 
struct  ProblemClearComposedProblemData
 Clear composed problem data structure. More...
 
struct  ProblemClearNumeredFiniteElementsChange
 clear problem finite elements More...
 
struct  ProblemClearSubProblemData
 Clear sub-problem data structure. More...
 
struct  ProblemFiniteElementChangeBitAdd
 add finite element to problem More...
 
struct  ProblemFiniteElementChangeBitUnSet
 remove finite element from problem More...
 
struct  ProblemsManager
 Problem manager is used to build and partition problems. More...
 
struct  ProblemZeroNbColsChange
 zero nb. of DOFs in col More...
 
struct  ProblemZeroNbRowsChange
 zero nb. of DOFs in row More...
 
struct  Proc_mi_tag
 
struct  Projection10NodeCoordsOnField
 Projection of edge entities with one mid-node on hierarchical basis. More...
 
struct  ProjectionFieldOn10NodeTet
 
struct  QuadPolynomialBase
 Calculate base functions on triangle. More...
 
struct  RefElement
 keeps data about abstract refined finite element More...
 
struct  RefElement_EDGE
 keeps data about abstract EDGE finite element More...
 
struct  RefElement_MESHSET
 keeps data about abstract MESHSET finite element More...
 
struct  RefElement_PRISM
 keeps data about abstract PRISM finite element More...
 
struct  RefElement_VERTEX
 keeps data about abstract VERTEX finite element More...
 
struct  RefElementFace
 keeps data about abstract TRI finite element More...
 
struct  RefElementVolume
 keeps data about abstract TET finite element More...
 
struct  RefEntExtractor
 Extract entity handle form multi-index container. More...
 
struct  RefEntity_change_left_shift
 ref mofem entity, left shift More...
 
struct  RefEntity_change_parent
 change parent More...
 
struct  RefEntity_change_right_shift
 ref mofem entity, right shift More...
 
struct  RefEntityTmp
 
struct  RefEntityTmp< 0 >
 Struct keeps handle to refined handle. More...
 
struct  RefEntityTmp<-1 >
 
struct  ScalingMethod
 
struct  SchurBackendMatSetValuesPtr
 
struct  SchurDGESV
 
struct  SchurDSYSV
 
struct  SchurElemMats
 Schur complement data storage. More...
 
struct  SchurElemMatsBlock
 
struct  SchurElemMatsPreconditionedBlock
 
struct  SchurEvents
 Structure to register events for Schur block assembly and solver. More...
 
struct  SeriesID_mi_tag
 
struct  SeriesName_mi_tag
 
struct  SeriesRecorder
 
struct  SetBitRefLevelTool
 tool class with methods used more than twp times More...
 
struct  SetOtherGlobalGhostVector
 
struct  SetOtherLocalGhostVector
 
struct  SideNumber
 keeps information about side number for the finite element More...
 
struct  SideNumber_mi_tag
 
struct  Simple
 Simple interface for fast problem set-up. More...
 
struct  SmartPetscObj
 intrusive_ptr for managing petsc objects More...
 
struct  SnesCtx
 Interface for nonlinear (SNES) solver. More...
 
struct  SnesMethod
 data structure for snes (nonlinear solver) context More...
 
struct  SourceBoundaryNormalSpecialization
 
struct  SourceFunctionSpecialization
 
struct  Space_mi_tag
 
struct  TemperatureCubitBcData
 Definition of the temperature bc data structure. More...
 
struct  TempMeshset
 
struct  TetGenInterface
 TetGen interface. More...
 
struct  TetPolynomialBase
 Calculate base functions on tetrahedral. More...
 
struct  TimeScale
 Force scale operator for reading two columns. More...
 
struct  TimeScaleVector
 Force scale operator for reading four columns (time and vector) More...
 
struct  Tools
 Auxiliary tools. More...
 
struct  TriPolynomialBase
 Calculate base functions on triangle. More...
 
struct  TSAdaptMoFEM
 Custom TSAdaptivity in MoFEM. More...
 
struct  TsCtx
 Interface for Time Stepping (TS) solver. More...
 
struct  TSMethod
 data structure for TS (time stepping) context More...
 
struct  TypeSide_mi_tag
 
struct  Unique_Ent_mi_tag
 
struct  Unique_FiniteElement_mi_tag
 
struct  Unique_mi_tag
 
struct  UnknownInterface
 base class for all interface classes More...
 
struct  VecManager
 Vector manager is used to create vectors \mofem_vectors. More...
 
struct  VelocityCubitBcData
 Definition of the velocity bc data structure. More...
 
struct  Version
 
struct  VertexElementForcesAndSourcesCore
 Vertex finite element. More...
 
struct  VolumeElementForcesAndSourcesCore
 Volume finite element base. More...
 
struct  VolumeElementForcesAndSourcesCoreOnContactPrismSide
 Base volume element used to integrate on contact surface (could be extended to other volume elements) More...
 
struct  VolumeElementForcesAndSourcesCoreOnContactPrismSideSwitch
 
struct  VolumeElementForcesAndSourcesCoreOnSide
 Base volume element used to integrate on skeleton. More...
 
struct  VolumeElementForcesAndSourcesCoreOnSideSwitch
 
struct  VolumeElementForcesAndSourcesCoreSwitch
 
struct  WrapMPIComm
 Wrap MPI communicator such that is destroyed when is out of scope. More...
 

Typedefs

template<typename T >
using ShardVec = boost::shared_ptr< std::vector< T > >
 
template<int DIM>
using i_FTIndex = FTensor::Index< 'i', DIM >
 
template<int DIM>
using j_FTIndex = FTensor::Index< 'j', DIM >
 
template<int DIM>
using k_FTIndex = FTensor::Index< 'k', DIM >
 
template<int DIM>
using l_FTIndex = FTensor::Index< 'l', DIM >
 
template<int DIM>
using m_FTIndex = FTensor::Index< 'm', DIM >
 
template<int DIM>
using n_FTIndex = FTensor::Index< 'n', DIM >
 
template<int DIM>
using I_FTIndex = FTensor::Index< 'I', DIM >
 
template<int DIM>
using J_FTIndex = FTensor::Index< 'J', DIM >
 
template<int DIM>
using K_FTIndex = FTensor::Index< 'K', DIM >
 
template<int DIM>
using L_FTIndex = FTensor::Index< 'L', DIM >
 
template<int DIM>
using M_FTIndex = FTensor::Index< 'M', DIM >
 
template<int DIM>
using N_FTIndex = FTensor::Index< 'N', DIM >
 
using VecOfTimeScalingMethods = std::vector< boost::shared_ptr< ScalingMethod > >
 Vector of time scaling methods. More...
 
template<int FIELD_DIM>
using VecOfTimeVectorScalingMethods = std::vector< boost::shared_ptr< TimeScaleVector< FIELD_DIM > >>
 Vector of time vector scaling methods. More...
 
using TimeScaleVector3 = TimeScaleVector< 3 >
 
using TimeScaleVector2 = TimeScaleVector< 3 >
 
using CacheMatsTypeType = std::map< std::pair< int, int >, boost::shared_ptr< MatrixDouble > >
 
using DofsAllocator = ublas::unbounded_array< FEDofEntity *, std::allocator< FEDofEntity * > >
 
using VectorDofs = ublas::vector< FEDofEntity *, DofsAllocator >
 
using FieldEntAllocator = ublas::unbounded_array< FieldEntity *, std::allocator< FieldEntity * > >
 
using VectorFieldEntities = ublas::vector< FieldEntity *, FieldEntAllocator >
 
using BaseDerivatives = EntitiesFieldData::EntData::BaseDerivatives
 
using ScalarFun = boost::function< double(const double, const double, const double)>
 Scalar function type. More...
 
using TimeFun = boost::function< double(double)>
 Lambda function used to scale with time. More...
 
using FEFun = boost::function< double(const FEMethod *fe_ptr)>
 Lambda function used to scale with time. More...
 
using ConstantFun = boost::function< double()>
 Constant function type. More...
 
template<int DIM>
using VectorFun = boost::function< FTensor::Tensor1< double, DIM >(const double, const double, const double)>
 Vector function type. More...
 
using OpCalculateHOJacVolume = OpCalculateHOJacForVolume
 
using OpCalculateHOJacForFace = OpCalculateHOJacForFaceImpl< 2 >
 
using OpCalculateHOJacForFaceEmbeddedIn3DSpace = OpCalculateHOJacForFaceImpl< 3 >
 
typedef boost::function< VectorDouble(const double, const double, const double)> VectorFunc
 
using SchurFieldPair = std::pair< std::string, std::string >
 
using SchurFEOpsFEandFields = std::vector< std::pair< std::string, std::vector< SchurFieldPair > > >
 
using SchurShellMatData = std::pair< SmartPetscObj< Mat >, boost::shared_ptr< BlockStructure > >
 
using NestSchurData = std::tuple< std::array< SmartPetscObj< Mat >, 4 >, std::array< boost::shared_ptr< BlockStructure >, 4 >, boost::shared_ptr< BlockStructure >, std::pair< SmartPetscObj< IS >, SmartPetscObj< IS > > >
 
template<CubitBC BC>
using BcTemperature = BcScalarMeshsetType< BC >
 
using Core = CoreTmp< 0 >
 
using Sev = MoFEM::LogManager::SeverityLevel
 
using CreateRowComressedADJMatrix = CreateRowCompressedADJMatrix
 
typedef multi_index_container< boost::shared_ptr< RefElement >, indexed_by< ordered_unique< tag< Ent_mi_tag >, const_mem_fun< RefElement::interface_type_RefEntity, EntityHandle, &RefElement::getEnt > >, ordered_non_unique< tag< Ent_Ent_mi_tag >, const_mem_fun< RefElement::interface_type_RefEntity, EntityHandle, &RefElement::getParentEnt > >, ordered_non_unique< tag< Composite_ParentEnt_And_BitsOfRefinedEdges_mi_tag >, composite_key< RefElement, const_mem_fun< RefElement::interface_type_RefEntity, EntityHandle, &RefElement::getParentEnt >, const_mem_fun< RefElement, int, &RefElement::getBitRefEdgesUlong > > > > > RefElement_multiIndex_parents_view
 
using Interface = DeprecatedCoreInterface
 
typedef CubitMeshSet_multiIndex::index< CubitMeshsetType_mi_tag >::type CubitMeshsetByType
 
typedef CubitMeshSet_multiIndex::index< CubitMeshsetMaskedType_mi_tag >::type CubitMeshsetByMask
 
typedef CubitMeshSet_multiIndex::index< CubitMeshsets_name >::type CubitMeshsetByName
 
typedef CubitMeshSet_multiIndex::index< CubitMeshsetType_mi_tag >::type CubitMeshsetById
 
typedef multi_index_container< CubitMeshSets, indexed_by< hashed_unique< tag< Meshset_mi_tag >, member< CubitMeshSets, EntityHandle, &CubitMeshSets::meshset > >, ordered_non_unique< tag< CubitMeshsetType_mi_tag >, const_mem_fun< CubitMeshSets, unsigned long int, &CubitMeshSets::getBcTypeULong > >, ordered_non_unique< tag< CubitMeshsetMaskedType_mi_tag >, const_mem_fun< CubitMeshSets, unsigned long int, &CubitMeshSets::getMaskedBcTypeULong > >, ordered_non_unique< tag< CubitMeshsets_name >, const_mem_fun< CubitMeshSets, std::string, &CubitMeshSets::getName > >, hashed_unique< tag< Composite_Cubit_msId_And_MeshsetType_mi_tag >, composite_key< CubitMeshSets, const_mem_fun< CubitMeshSets, int, &CubitMeshSets::getMeshsetId >, const_mem_fun< CubitMeshSets, unsigned long int, &CubitMeshSets::getMaskedBcTypeULong > > > > > CubitMeshSet_multiIndex
 Stores data about meshsets (see CubitMeshSets) storing data about boundary conditions, interfaces, sidesets, nodests, blocksets. More...
 
using DofEntityByUId = DofEntity_multiIndex::index< Unique_mi_tag >::type
 
using DofEntityByEnt = DofEntity_multiIndex::index< Ent_mi_tag >::type
 Dof multi-index by entity. More...
 
using DofEntity_multiIndex_uid_view = multi_index_container< boost::shared_ptr< DofEntity >, indexed_by< ordered_unique< const_mem_fun< DofEntity, UId, &DofEntity::getLocalUniqueId > > > >
 multi-index view on DofEntity by uid More...
 
using DofEntity_multiIndex_global_uid_view = multi_index_container< boost::shared_ptr< DofEntity >, indexed_by< ordered_unique< const_mem_fun< DofEntity, UId, &DofEntity::getGlobalUniqueId > > > >
 multi-index view on DofEntity by uid More...
 
typedef std::vector< boost::weak_ptr< DofEntity > > DofEntity_vector_view
 vector view on DofEntity by uid More...
 
typedef multi_index_container< boost::shared_ptr< DofEntity >, indexed_by< ordered_unique< const_mem_fun< DofEntity, UId, &DofEntity::getLocalUniqueId > >, ordered_non_unique< const_mem_fun< DofEntity, char, &DofEntity::getActive > > > > DofEntity_multiIndex_active_view
 multi-index view on DofEntity activity More...
 
using FEDofEntityByUId = FEDofEntity_multiIndex::index< Unique_mi_tag >::type
 Dof entity multi-index by UId and entity. More...
 
using FENumeredDofEntityByUId = FENumeredDofEntity_multiIndex::index< Unique_mi_tag >::type
 Dof entity multi-index by UId. More...
 
using FENumeredDofEntityByEnt = FENumeredDofEntity_multiIndex::index< Ent_mi_tag >::type
 Numbered DoF multi-index by entity. More...
 
using NumeredDofEntityByUId = NumeredDofEntity_multiIndex::index< Unique_mi_tag >::type
 Numbered DoF multi-index by UId. More...
 
using NumeredDofEntityByLocalIdx = NumeredDofEntity_multiIndex::index< PetscLocalIdx_mi_tag >::type
 Numbered DoF multi-index by local index. More...
 
using NumeredDofEntityByEnt = NumeredDofEntity_multiIndex::index< Ent_mi_tag >::type
 Numbered DoF multi-index by entity. More...
 
using NumeredDofEntity_multiIndex_uid_view_ordered = multi_index_container< boost::shared_ptr< NumeredDofEntity >, indexed_by< ordered_unique< const_mem_fun< NumeredDofEntity::interface_type_DofEntity, UId, &NumeredDofEntity::getLocalUniqueId > > > >
 
using NumeredDofEntity_multiIndex_idx_view_hashed = multi_index_container< boost::shared_ptr< NumeredDofEntity >, indexed_by< hashed_unique< const_mem_fun< NumeredDofEntity, DofIdx, &NumeredDofEntity::getDofIdx > >> >
 
using NumeredDofEntity_multiIndex_petsc_local_dof_view_ordered_non_unique = multi_index_container< boost::shared_ptr< NumeredDofEntity >, indexed_by< ordered_non_unique< const_mem_fun< NumeredDofEntity, DofIdx, &NumeredDofEntity::getPetscLocalDofIdx > >> >
 
using NumeredDofEntity_multiIndex_coeff_idx_ordered_non_unique = multi_index_container< boost::shared_ptr< NumeredDofEntity >, indexed_by< ordered_non_unique< const_mem_fun< NumeredDofEntity::interface_type_DofEntity, FieldCoefficientsNumber, &NumeredDofEntity::getDofCoeffIdx > >> >
 
using ElementAdjacencyFunct = boost::function< MoFEMErrorCode(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)>
 user adjacency function More...
 
using CacheTuple = std::tuple< std::vector< EntityCacheDofs >, std::vector< EntityCacheNumeredDofs >, std::vector< EntityCacheNumeredDofs > >
 
using CacheTupleWeakPtr = boost::weak_ptr< CacheTuple >
 
using CacheTupleSharedPtr = boost::shared_ptr< CacheTuple >
 
using FieldEntityByUId = FieldEntity_multiIndex::index< Unique_mi_tag >::type
 Entity index by field name. More...
 
using FieldEntity_multiIndex_global_uid_view = multi_index_container< boost::shared_ptr< FieldEntity >, indexed_by< ordered_unique< tag< Unique_mi_tag >, const_mem_fun< FieldEntity, UId, &FieldEntity::getGlobalUniqueId > > > >
 multi-index view on DofEntity by uid More...
 
using FieldEntity_multiIndex_ent_view = multi_index_container< boost::shared_ptr< FieldEntity >, indexed_by< sequenced<>, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< FieldEntity::interface_type_RefEntity, EntityHandle, &FieldEntity::getEnt > > > >
 
using FieldEntity_multiIndex_spaceType_view = multi_index_container< boost::shared_ptr< FieldEntity >, indexed_by< sequenced<>, ordered_non_unique< tag< Composite_EntType_and_Space_mi_tag >, composite_key< FieldEntity, const_mem_fun< FieldEntity::interface_type_RefEntity, EntityType, &FieldEntity::getEntType >, const_mem_fun< FieldEntity::interface_type_Field, FieldSpace, &FieldEntity::getSpace > > > > >
 
typedef std::vector< boost::weak_ptr< FieldEntity > > FieldEntity_vector_view
 
using FieldEntity_multiIndex = multi_index_container< boost::shared_ptr< FieldEntity >, indexed_by< ordered_unique< tag< Unique_mi_tag >, member< FieldEntity, UId, &FieldEntity::localUId > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< FieldEntity::interface_type_RefEntity, EntityHandle, &FieldEntity::getEnt > > > >
 
typedef boost::function< int(const int order)> FieldOrderFunct
 user adjacency function More...
 
typedef FieldOrderFunct FieldOrderTable[MBMAXTYPE]
 user adjacency function table More...
 
typedef multi_index_container< boost::shared_ptr< Field >, indexed_by< ordered_unique< tag< BitFieldId_mi_tag >, const_mem_fun< Field, const BitFieldId &, &Field::getId >, LtBit< BitFieldId > > > > Field_multiIndex_view
 
using BlockFieldPair = Problem::BlockFieldPair
 
using EmptyFieldBlocks = Problem::EmptyFieldBlocks
 
typedef multi_index_container< boost::shared_ptr< RefElement >, indexed_by< ordered_unique< tag< Ent_mi_tag >, const_mem_fun< RefElement::interface_type_RefEntity, EntityHandle, &RefElement::getEnt > > > > RefElement_multiIndex
 
using RefEntity = RefEntityTmp< 0 >
 
using RefEntity_multiIndex = multi_index_container< boost::shared_ptr< RefEntity >, indexed_by< ordered_unique< tag< Ent_mi_tag >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getEnt > >, ordered_non_unique< tag< Ent_Ent_mi_tag >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > >, ordered_non_unique< tag< Composite_EntType_and_ParentEntType_mi_tag >, composite_key< RefEntity, const_mem_fun< RefEntity, EntityType, &RefEntity::getEntType >, const_mem_fun< RefEntity, EntityType, &RefEntity::getParentEntType > > >, ordered_non_unique< tag< Composite_ParentEnt_And_EntType_mi_tag >, composite_key< RefEntity, const_mem_fun< RefEntity, EntityType, &RefEntity::getEntType >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > > > > >
 
using RefEntity_multiIndex_view_by_hashed_parent_entity = multi_index_container< boost::shared_ptr< RefEntity >, indexed_by< hashed_non_unique< const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > >, hashed_unique< tag< Composite_EntType_and_ParentEntType_mi_tag >, composite_key< boost::shared_ptr< RefEntity >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getEnt >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > >> > >
 multi-index view of RefEntity by parent entity More...
 
using RefEntity_multiIndex_view_by_ordered_parent_entity = multi_index_container< boost::shared_ptr< RefEntity >, indexed_by< ordered_non_unique< const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > >, hashed_unique< tag< Composite_EntType_and_ParentEntType_mi_tag >, composite_key< boost::shared_ptr< RefEntity >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getEnt >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > >> > >
 
using RefEntity_multiIndex_view_sequence_ordered_view = multi_index_container< boost::shared_ptr< RefEntity >, indexed_by< sequenced<>, ordered_unique< tag< Ent_mi_tag >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getEnt > >> >
 
typedef multi_index_container< FieldSeries, indexed_by< ordered_unique< tag< SeriesID_mi_tag >, const_mem_fun< FieldSeries, EntityID, &FieldSeries::get_meshset_id > >, ordered_unique< tag< SeriesName_mi_tag >, const_mem_fun< FieldSeries, boost::string_ref, &FieldSeries::getNameRef > > > > Series_multiIndex
 Series multi index. More...
 
typedef multi_index_container< FieldSeriesStep, indexed_by< ordered_unique< tag< Composite_SeriesID_And_Step_mi_tag >, composite_key< FieldSeriesStep, const_mem_fun< FieldSeriesStep::interface_type_FieldSeries, EntityID, &FieldSeriesStep::get_meshset_id >, member< FieldSeriesStep, int, &FieldSeriesStep::step_number > > >, ordered_unique< tag< Composite_SeriesName_And_Step_mi_tag >, composite_key< FieldSeriesStep, const_mem_fun< FieldSeriesStep::interface_type_FieldSeries, boost::string_ref, &FieldSeriesStep::getNameRef >, member< FieldSeriesStep, int, &FieldSeriesStep::step_number > > >, ordered_non_unique< tag< SeriesName_mi_tag >, const_mem_fun< FieldSeriesStep::interface_type_FieldSeries, boost::string_ref, &FieldSeriesStep::getNameRef > >, ordered_non_unique< tag< Composite_SeriesName_And_Time_mi_tag >, composite_key< FieldSeriesStep, const_mem_fun< FieldSeriesStep::interface_type_FieldSeries, boost::string_ref, &FieldSeriesStep::getNameRef >, const_mem_fun< FieldSeriesStep, double, &FieldSeriesStep::get_time > > > > > SeriesStep_multiIndex
 Step multi index. More...
 
typedef std::deque< PairNameFEMethodPtrFEMethodsSequence
 
typedef std::deque< BasicMethodPtrBasicMethodsSequence
 
using PostProcGenerateRefMeshPtr = boost::shared_ptr< PostProcGenerateRefMeshBase >
 
using PostProcBrokenMeshInMoabBaseBegin = PostProcBrokenMeshInMoabBaseBeginImpl< PostProcBrokenMeshInMoabBase< ForcesAndSourcesCore > >
 Enable to run stack of post-processing elements. Use this to begin stack. More...
 
template<typename E >
using PostProcBrokenMeshInMoabBaseCont = PostProcBrokenMeshInMoabBaseContImpl< PostProcBrokenMeshInMoabBase< E > >
 Enable to run stack of post-processing elements. More...
 
using PostProcBrokenMeshInMoabBaseEnd = PostProcBrokenMeshInMoabBaseEndImpl< PostProcBrokenMeshInMoabBase< ForcesAndSourcesCore > >
 Enable to run stack of post-processing elements. Use this to end stack. More...
 

Enumerations

enum  MPC {
  MPC::TIE, MPC::RIGID_BODY, MPC::COUPLING, MPC::EMBEDDED_REGION,
  MPC::EQUATION, MPC::LAST
}
 
enum  AssemblyType {
  PETSC, SCHUR, BLOCK_MAT, BLOCK_SCHUR,
  BLOCK_PRECONDITIONER_SCHUR, USER_ASSEMBLE, LAST_ASSEMBLE
}
 [Storage and set boundary conditions] More...
 
enum  IntegrationType { GAUSS, USER_INTEGRATION, LAST_INTEGRATION }
 Form integrator integration types. More...
 

Functions

PetscErrorCode PetscOptionsGetInt (PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
 
PetscErrorCode PetscOptionsGetReal (PetscOptions *, const char pre[], const char name[], PetscReal *dval, PetscBool *set)
 
PetscErrorCode PetscOptionsGetScalar (PetscOptions *, const char pre[], const char name[], PetscScalar *dval, PetscBool *set)
 
PetscErrorCode PetscOptionsGetString (PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
 
PetscErrorCode PetscOptionsGetBool (PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
 
PetscErrorCode PetscOptionsGetRealArray (PetscOptions *, const char pre[], const char name[], PetscReal dval[], PetscInt *nmax, PetscBool *set)
 
PetscErrorCode PetscOptionsGetEList (PetscOptions *, const char pre[], const char name[], const char *const *list, PetscInt next, PetscInt *value, PetscBool *set)
 
PetscErrorCode PetscOptionsGetIntArray (PetscOptions options, const char pre[], const char name[], PetscInt dvalue[], PetscInt *nmax, PetscBool *set)
 
PetscErrorCode PetscOptionsGetScalarArray (PetscOptions options, const char pre[], const char name[], PetscScalar dvalue[], PetscInt *nmax, PetscBool *set)
 
template<typename T >
PetscObject getPetscObject (T obj)
 
auto createDM (MPI_Comm comm, const std::string dm_type_name)
 Creates smart DM object. More...
 
DEPRECATED auto createSmartDM (MPI_Comm comm, const std::string dm_type_name)
 
MPI_Comm getCommFromPetscObject (PetscObject obj)
 Get the Comm From Petsc Object object. More...
 
auto createGhostVector (MPI_Comm comm, PetscInt n, PetscInt N, PetscInt nghost, const PetscInt ghosts[])
 Create smart ghost vector. More...
 
DEPRECATED auto createSmartGhostVector (MPI_Comm comm, PetscInt n, PetscInt N, PetscInt nghost, const PetscInt ghosts[])
 
auto createVectorMPI (MPI_Comm comm, PetscInt n, PetscInt N)
 Create MPI Vector. More...
 
DEPRECATED auto createSmartVectorMPI (MPI_Comm comm, PetscInt n, PetscInt N)
 
SmartPetscObj< Vec > vectorDuplicate (Vec vec)
 Create duplicate vector of smart vector. More...
 
DEPRECATED SmartPetscObj< Vec > smartVectorDuplicate (Vec vec)
 
SmartPetscObj< Mat > matDuplicate (Mat mat, MatDuplicateOption op)
 
DEPRECATED SmartPetscObj< Mat > smartMatDuplicate (Mat mat, MatDuplicateOption op)
 
auto createTS (MPI_Comm comm)
 
auto createSNES (MPI_Comm comm)
 
auto createKSP (MPI_Comm comm)
 
auto createPC (MPI_Comm comm)
 
auto createISGeneral (MPI_Comm comm, PetscInt n, const PetscInt idx[], PetscCopyMode mode)
 Creates a data structure for an index set containing a list of integers. More...
 
auto isAllGather (IS is)
 IS All gather. More...
 
auto createAOMappingIS (IS isapp, IS ispetsc)
 Creates an application mapping using two index sets. More...
 
auto createAOMapping (MPI_Comm comm, PetscInt napp, const PetscInt myapp[], const PetscInt mypetsc[])
 Creates an application mapping using two integer arrays. More...
 
auto createVecScatter (Vec x, IS ix, Vec y, IS iy)
 Create a Vec Scatter object. More...
 
auto isDifference (IS is1, IS is2)
 Get ISDifference. More...
 
auto createISLocalToGlobalMapping (IS is)
 
auto matCreateVecs (Mat mat)
 
auto isDuplicate (IS is)
 
template<typename T1 >
auto getVectorAdaptor (T1 ptr, const size_t n)
 Get Vector adaptor. More...
 
template<typename T1 >
auto getMatrixAdaptor (T1 ptr, const size_t n, const size_t m)
 Get Matrix adaptor. More...
 
template<class X >
std::string toString (X x)
 
template<int S = 1, class T , class A >
static auto getFTensor0FromVec (ublas::vector< T, A > &data)
 Get tensor rank 0 (scalar) form data vector. More...
 
template<int Tensor_Dim, int S = 1, class T , class L , class A >
FTensor::Tensor1< FTensor::PackPtr< T *, S >, Tensor_Dim > getFTensor1FromMat (ublas::matrix< T, L, A > &data)
 Get tensor rank 1 (vector) form data matrix. More...
 
template<int Tensor_Dim, int S = 1>
auto getFTensor1FromMat (MatrixDouble &data)
 Get tensor rank 1 (vector) form data matrix (specialization) More...
 
template<int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor2< FTensor::PackPtr< double *, 1 >, Tensor_Dim1, Tensor_Dim2 > getFTensor2FromMat (MatrixDouble &data)
 Get tensor rank 2 (matrix) form data matrix. More...
 
template<int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor2< FTensor::PackPtr< double *, 1 >, Tensor_Dim1, Tensor_Dim2 > getFTensor2FromVec (VectorDouble &data)
 
template<>
FTensor::Tensor2< FTensor::PackPtr< double *, 1 >, 1, 1 > getFTensor2FromVec (VectorDouble &data)
 
template<int Tensor_Dim, int S, class T , class L , class A >
static auto getFTensor2SymmetricFromMat (ublas::matrix< T, L, A > &data)
 Get symmetric tensor rank 2 (matrix) form data matrix. More...
 
template<int Tensor_Dim, int S = 1>
static auto getFTensor2SymmetricFromMat (MatrixDouble &data)
 
template<int Tensor_Dim01, int Tensor_Dim23, int S = 1, class T , class L , class A >
static FTensor::Ddg< FTensor::PackPtr< T *, 1 >, Tensor_Dim01, Tensor_Dim23 > getFTensor4DdgFromMat (ublas::matrix< T, L, A > &data)
 Get symmetric tensor rank 4 on first two and last indices from form data matrix. More...
 
template<int Tensor_Dim01, int Tensor_Dim23, int S = 1>
static auto getFTensor4DdgFromMat (MatrixDouble &data)
 
template<int Tensor_Dim01, int Tensor_Dim23, int S = 1, class T = double>
static auto getFTensor4DdgFromPtr (T *ptr)
 
template<int Tensor_Dim01, int Tensor_Dim2, int S = 1, class T , class L , class A >
static FTensor::Dg< FTensor::PackPtr< T *, 1 >, Tensor_Dim01, Tensor_Dim2 > getFTensor3DgFromMat (ublas::matrix< T, L, A > &data)
 Get symmetric tensor rank 3 on the first two indices from form data matrix. More...
 
template<int Tensor_Dim01, int Tensor_Dim2, int S = 1>
static auto getFTensor3DgFromMat (MatrixDouble &data)
 
template<int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2, int Tensor_Dim3, int S = 1, class T , class L , class A >
static FTensor::Tensor4< FTensor::PackPtr< T *, 1 >, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2, Tensor_Dim3 > getFTensor4FromMat (ublas::matrix< T, L, A > &data)
 Get tensor rank 4 (non symmetric) form data matrix. More...
 
template<int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2, int Tensor_Dim3, int S = 1>
static auto getFTensor4FromMat (MatrixDouble &data)
 
template<int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2, int S = 1, class T , class L , class A >
static FTensor::Tensor3< FTensor::PackPtr< T *, 1 >, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 > getFTensor3FromMat (ublas::matrix< T, L, A > &data)
 Get tensor rank 3 (non symmetries) form data matrix. More...
 
template<int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2, int S = 1>
static auto getFTensor3FromMat (MatrixDouble &data)
 
template<int DIM, int S = DIM>
FTensor::Tensor1< FTensor::PackPtr< double *, S >, DIM > getFTensor1FromPtr (double *ptr)
 Make Tensor1 from pointer. More...
 
template<int DIM, int S = DIM>
FTensor::Tensor1< FTensor::PackPtr< adouble *, S >, DIM > getFTensor1FromPtr (adouble *ptr)
 
template<int DIM, int S = DIM>
FTensor::Tensor1< FTensor::PackPtr< std::complex< double > *, S >, DIM > getFTensor1FromPtr (std::complex< double > *ptr)
 
template<int DIM1, int DIM2, int S = DIM1 * DIM2>
auto getFTensor2FromPtr (double *ptr)
 Make Tensor2 from pointer. More...
 
template<int DIM1, int DIM2, int S = DIM1 * DIM2>
auto getFTensor2FromPtr (std::complex< double > *ptr)
 Make Tensor2 from pointer. More...
 
template<int DIM1, int DIM2>
FTensor::Tensor2< FTensor::PackPtr< double *, DIM1 *DIM2 >, DIM1, DIM2getFTensor2HVecFromPtr (double *ptr)
 Make Tensor2 for HVec base from pointer. More...
 
template<>
FTensor::Tensor2< FTensor::PackPtr< double *, 6 >, 3, 2 > getFTensor2HVecFromPtr< 3, 2 > (double *ptr)
 
template<>
FTensor::Tensor2< FTensor::PackPtr< double *, 9 >, 3, 3 > getFTensor2HVecFromPtr< 3, 3 > (double *ptr)
 
template<int DIM1, int DIM2, int DIM3>
FTensor::Tensor3< FTensor::PackPtr< double *, DIM1 *DIM2 *DIM3 >, DIM1, DIM2, DIM3 > getFTensor3FromPtr (double *ptr)
 
template<>
FTensor::Tensor3< FTensor::PackPtr< double *, 12 >, 3, 2, 2 > getFTensor3FromPtr< 3, 2, 2 > (double *ptr)
 
template<>
FTensor::Tensor3< FTensor::PackPtr< double *, 27 >, 3, 3, 3 > getFTensor3FromPtr< 3, 3, 3 > (double *ptr)
 
template<int DIM>
FTensor::Tensor2_symmetric< FTensor::PackPtr< double *,(DIM *(DIM+1))/2 >, DIM > getFTensor2SymmetricFromPtr (double *ptr)
 Make symmetric Tensor2 from pointer. More...
 
template<>
FTensor::Tensor2_symmetric< FTensor::PackPtr< double *, 6 >, 3 > getFTensor2SymmetricFromPtr< 3 > (double *ptr)
 
template<>
FTensor::Tensor2_symmetric< FTensor::PackPtr< double *, 3 >, 2 > getFTensor2SymmetricFromPtr< 2 > (double *ptr)
 
template<int DIM>
FTensor::Tensor2_symmetric< FTensor::PackPtr< adouble *,(DIM *(DIM+1))/2 >, DIM > getFTensor2SymmetricFromPtr (adouble *ptr)
 Make symmetric Tensor2 from pointer. More...
 
template<>
FTensor::Tensor2_symmetric< FTensor::PackPtr< adouble *, 6 >, 3 > getFTensor2SymmetricFromPtr< 3 > (adouble *ptr)
 
template<>
FTensor::Tensor2_symmetric< FTensor::PackPtr< adouble *, 3 >, 2 > getFTensor2SymmetricFromPtr< 2 > (adouble *ptr)
 
template<int DIM>
FTensor::Tensor2_symmetric< FTensor::PackPtr< double *, DIM *DIM >, DIM > getFTensor2SymmetricLowerFromPtr (double *ptr)
 Make symmetric Tensor2 from pointer, taking lower triangle of matrix. More...
 
template<>
FTensor::Tensor2_symmetric< FTensor::PackPtr< double *, 9 >, 3 > getFTensor2SymmetricLowerFromPtr< 3 > (double *ptr)
 
template<>
FTensor::Tensor2_symmetric< FTensor::PackPtr< double *, 4 >, 2 > getFTensor2SymmetricLowerFromPtr< 2 > (double *ptr)
 
template<int DIM, int S>
auto getFTensor1FromArray (VectorDouble &data)
 Get FTensor1 from array. More...
 
template<int DIM, int S = 0>
auto getFTensor1FromArray (VectorDouble3 &data)
 Get FTensor1 from array. More...
 
template<>
auto getFTensor1FromArray< 3, 0 > (VectorDouble3 &data)
 
template<int DIM, int S>
FTensor::Tensor1< FTensor::PackPtr< double *, S >, DIM > getFTensor1FromMat (MatrixDouble &data, const size_t rr)
 
template<>
FTensor::Tensor1< FTensor::PackPtr< double *, 1 >, 2 > getFTensor1FromMat (MatrixDouble &data, const size_t rr)
 
template<int DIM, int S>
FTensor::Tensor1< FTensor::PackPtr< double *, S >, DIM > getFTensor1FromArrayDiag (MatrixDouble &data, const size_t rr)
 Get FTensor1 from array. More...
 
template<>
FTensor::Tensor1< FTensor::PackPtr< double *, 2 >, 2 > getFTensor1FromArrayDiag (MatrixDouble &data, const size_t rr)
 
template<int DIM1, int DIM2, int S>
FTensor::Tensor2< FTensor::PackPtr< double *, S >, DIM1, DIM2getFTensor2FromArray (MatrixDouble &data, const size_t rr, const size_t cc=0)
 
template<int DIM1, int DIM2>
FTensor::Tensor2< double *, DIM1, DIM2getFTensor2FromArray (MatrixDouble &data, const size_t rr, const size_t cc, const int ss)
 
template<int S, typename T , typename L , typename A >
auto getFTensor2FromArray2by2 (ublas::matrix< T, L, A > &data, const FTensor::Number< S > &, const size_t rr, const size_t cc=0)
 
template<int S, typename T , typename L , typename A >
auto getFTensor2FromArray3by3 (ublas::matrix< T, L, A > &data, const FTensor::Number< S > &, const size_t rr, const size_t cc=0)
 
template<int DIM1, int DIM2, int S>
auto getFTensor2FromArray (MatrixADouble &data, const size_t rr)
 
MoFEMErrorCode computeMatrixInverse (MatrixDouble &mat)
 compute matrix inverse with lapack dgetri More...
 
MoFEMErrorCode solveLinearSystem (MatrixDouble &mat, VectorDouble &f)
 solve linear system with lapack dgesv More...
 
MoFEMErrorCode solveLinearSystem (const MatrixDouble &mat, VectorDouble &f)
 Solve linear system of equations using Lapack. More...
 
MoFEMErrorCode computeEigenValuesSymmetric (const MatrixDouble &mat, VectorDouble &eig, MatrixDouble &eigen_vec)
 compute eigenvalues of a symmetric matrix using lapack dsyev More...
 
template<int DIM, typename T1 , typename T2 >
MoFEMErrorCode computeEigenValuesSymmetric (FTensor::Tensor2< T1, DIM, DIM > &eigen_vec, FTensor::Tensor1< T2, DIM > &eig)
 compute eigenvalues of a symmetric matrix using lapack dsyev More...
 
template<int DIM, typename T1 , typename T2 , typename T3 >
MoFEMErrorCode computeEigenValuesSymmetric (const FTensor::Tensor2_symmetric< T1, DIM > &mat, FTensor::Tensor1< T2, DIM > &eig, FTensor::Tensor2< T3, DIM, DIM > &eigen_vec)
 compute eigenvalues of a symmetric tensor using lapack dsyev More...
 
template<typename T >
static auto determinantTensor3by3 (T &t)
 Calculate the determinant of a 3x3 matrix or a tensor of rank 2. More...
 
template<typename T >
static auto determinantTensor2by2 (T &t)
 Calculate the determinant of a 2x2 matrix or a tensor of rank 2. More...
 
template<typename T , int DIM>
static auto determinantTensor (FTensor::Tensor2< T, DIM, DIM > &t)
 Calculate the determinant of a tensor of rank DIM. More...
 
template<typename T , int DIM>
static auto determinantTensor (FTensor::Tensor2_symmetric< T, DIM > &t)
 Calculate the determinant of a tensor of rank DIM. More...
 
template<int Tensor_Dim, class T , class L , class A >
MoFEMErrorCode invertTensor3by3 (ublas::matrix< T, L, A > &jac_data, ublas::vector< T, A > &det_data, ublas::matrix< T, L, A > &inv_jac_data)
 Calculate inverse of tensor rank 2 at integration points. More...
 
template<>
MoFEMErrorCode invertTensor3by3< 3, double, ublas::row_major, DoubleAllocator > (MatrixDouble &jac_data, VectorDouble &det_data, MatrixDouble &inv_jac_data)
 
template<class T1 , class T2 >
MoFEMErrorCode determinantTensor3by3 (T1 &t, T2 &det)
 Calculate determinant 3 by 3. More...
 
template<class T1 , class T2 >
MoFEMErrorCode determinantTensor2by2 (T1 &t, T2 &det)
 Calculate determinant 2 by 2. More...
 
template<class T1 , class T2 , class T3 >
MoFEMErrorCode invertTensor3by3 (T1 &t, T2 &det, T3 &inv_t)
 Calculate matrix inverse 3 by 3. More...
 
template<class T1 , class T2 , class T3 >
MoFEMErrorCode invertTensor2by2 (T1 &t, T2 &det, T3 &inv_t)
 Calculate matrix inverse 2 by 2. More...
 
template<typename T1 , typename T2 , typename T3 , int DIM>
static MoFEMErrorCode invertTensor (FTensor::Tensor2< T1, DIM, DIM > &t, T2 &det, FTensor::Tensor2< T3, DIM, DIM > &inv_t)
 
template<typename T1 , typename T2 , typename T3 , int DIM>
static MoFEMErrorCode invertTensor (FTensor::Tensor2_symmetric< T1, DIM > &t, T2 &det, FTensor::Tensor2_symmetric< T3, DIM > &inv_t)
 
template<typename Extractor , typename Iterator >
moab::Range::iterator insertOrdered (Range &r, Extractor, Iterator begin_iter, Iterator end_iter)
 Insert ordered mofem multi-index into range. More...
 
template<typename MI , typename MO = Modify_change_nothing>
MoFEMErrorCode reconstructMultiIndex (const MI &mi, MO &&mo=Modify_change_nothing())
 Template used to reconstruct multi-index. More...
 
auto get_temp_meshset_ptr (moab::Interface &moab)
 Create smart pointer to temporary meshset. More...
 
auto id_from_handle (const EntityHandle h)
 
auto type_from_handle (const EntityHandle h)
 get type from entity handle More...
 
auto ent_form_type_and_id (const EntityType type, const EntityID id)
 get entity handle from type and id More...
 
auto dimension_from_handle (const EntityHandle h)
 get entity dimension form handle More...
 
auto type_name_from_handle (const EntityHandle h)
 get entity type name from handle More...
 
auto field_bit_from_bit_number (const int bit_number)
 get field bit id from bit number More...
 
template<typename I >
auto rangeInserter (const I f, const I s, boost::function< bool(I it)> tester, boost::function< MoFEMErrorCode(I f, I s)> inserter)
 Insert ranges. More...
 
template<typename Dest = void, typename... Arg>
constexpr auto make_array (Arg &&...arg)
 Create Array. More...
 
void tet_type_6 (moab::Interface &moab, const EntityHandle *conn, const EntityHandle *edge_new_nodes, EntityHandle *new_tets_conn)
 
int tet_type_5 (moab::Interface &moab, const EntityHandle *conn, const EntityHandle *edge_new_nodes, EntityHandle *new_tets_conn)
 
int tet_type_4 (const EntityHandle *conn, const int *split_edges, const EntityHandle *edge_new_nodes, EntityHandle *new_tets_conn)
 
int tet_type_3 (const EntityHandle *conn, const int *split_edges, const EntityHandle *edge_new_nodes, EntityHandle *new_tets_conn)
 
int tet_type_2 (const EntityHandle *conn, const int *split_edges, const EntityHandle *edge_new_nodes, EntityHandle *new_tets_conn)
 
void tet_type_1 (const EntityHandle *conn, const int split_edge, const EntityHandle edge_new_node, EntityHandle *new_tets_conn)
 
MoFEMErrorCode tri_type_1 (const EntityHandle *conn, const int split_edge, const EntityHandle edge_new_node, EntityHandle *new_tris_conn)
 
MoFEMErrorCode tri_type_2 (const EntityHandle *conn, const int *split_edges, const EntityHandle *edge_new_nodes, EntityHandle *new_tris_conn)
 
MoFEMErrorCode tri_type_3 (const EntityHandle *conn, const EntityHandle *edge_new_nodes, EntityHandle *new_tris_conn)
 
MoFEMErrorCode prism_type_1 (const EntityHandle *conn, const BitRefEdges split_edges, const EntityHandle *edge_new_nodes, EntityHandle *new_prism_conn)
 
MoFEMErrorCode prism_type_2 (const EntityHandle *conn, const BitRefEdges split_edges, const EntityHandle *edge_new_nodes, EntityHandle *new_prism_conn)
 
MoFEMErrorCode prism_type_3 (const EntityHandle *conn, const BitRefEdges split_edges, const EntityHandle *edge_new_nodes, EntityHandle *new_prism_conn)
 
MoFEMErrorCode quad_split_all_edges (const EntityHandle *conn, const EntityHandle *edge_new_nodes, EntityHandle *new_quad_conn)
 
MoFEMErrorCode Hcurl_Ainsworth_EdgeBaseFunctions_MBTET (int *sense, int *p, double *N, double *diffN, double *edgeN[], double *diff_edgeN[], int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
 Edge based H-curl base functions on tetrahedral. More...
 
MoFEMErrorCode Hcurl_Ainsworth_EdgeBaseFunctions_MBTET_ON_EDGE (int sense, int p, double *N, double *diffN, double *edgeN, double *diff_edgeN, int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
 Edge based H-curl base functions on edge. More...
 
MoFEMErrorCode Hcurl_Ainsworth_EdgeBaseFunctions_MBTET_ON_FACE (int *sense, int *p, double *N, double *diffN, double *edgeN[], double *diff_edgeN[], int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
 Edge based H-curl base functions on face. More...
 
MoFEMErrorCode Hcurl_Ainsworth_EdgeBasedFaceFunctions_MBTET (int *faces_nodes, int *p, double *N, double *diffN, double *phi_f_e[4][3], double *diff_phi_f_e[4][3], int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
 Face edge base functions of Hcurl space on tetrahedral. More...
 
MoFEMErrorCode Hcurl_Ainsworth_EdgeBasedFaceFunctions_MBTET_ON_FACE (int *faces_nodes, int p, double *N, double *diffN, double *phi_f_e[3], double *diff_phi_f_e[3], int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
 Face edge base functions of Hcurl space. More...
 
MoFEMErrorCode Hcurl_Ainsworth_BubbleFaceFunctions_MBTET (int *faces_nodes, int *p, double *N, double *diffN, double *phi_f[4], double *diff_phi_f[4], int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
 Face edge base functions of Hcurl space on face on tetrahedral. More...
 
MoFEMErrorCode Hcurl_Ainsworth_BubbleFaceFunctions_MBTET_ON_FACE (int *faces_nodes, int p, double *N, double *diffN, double *phi_f, double *diff_phi_f, int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
 Face edge base functions of Hcurl space on face. More...
 
MoFEMErrorCode Hcurl_Ainsworth_FaceInteriorFunctions_MBTET (int *faces_nodes, int p, double *N, double *diffN, double *phi_v, double *diff_phi_v, int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
 Face base interior function. More...
 
MoFEMErrorCode Hcurl_Ainsworth_VolumeInteriorFunctions_MBTET (int p, double *N, double *diffN, double *phi_v, double *diff_phi_v, int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
 Volume interior function. More...
 
MoFEMErrorCode Hcurl_Ainsworth_FaceFunctions_MBTET (int *face_nodes, int *p, double *N, double *diffN, double *phi_f[4], double *diff_phi_f[4], int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
 Face H-curl functions. More...
 
MoFEMErrorCode Hcurl_Ainsworth_FaceFunctions_MBTET_ON_FACE (int *faces_nodes, int p, double *N, double *diffN, double *phi_f, double *diff_phi_f, int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
 Face H-curl functions. More...
 
MoFEMErrorCode Hcurl_Ainsworth_VolumeFunctions_MBTET (int p, double *N, double *diffN, double *phi_v, double *diff_phi_v, int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
 H-curl volume base functions. More...
 
MoFEMErrorCode Hcurl_Demkowicz_EdgeBaseFunctions_MBTET (int *sense, int *p, double *n, double *diff_n, double *phi[], double *diff_phi[], int nb_integration_pts)
 Edge based H-curl base functions on tetrahedral. More...
 
MoFEMErrorCode Hcurl_Demkowicz_EdgeBaseFunctions_MBTRI (int *sense, int *p, double *n, double *diff_n, double *phi[], double *diff_phi[], int nb_integration_pts)
 Edge based H-curl base functions on teriangle. More...
 
MoFEMErrorCode Hcurl_Demkowicz_EdgeBaseFunctions_MBEDGE (int sense, int p, double *n, double *diff_n, double *phi, double *diff_phi, int nb_integration_pts)
 Edge based H-curl base functions on edge. More...
 
MoFEMErrorCode Hcurl_Demkowicz_FaceBaseFunctions_MBTET (int *faces_nodes, int *p, double *n, double *diff_n, double *phi[], double *diff_phi[], int nb_integration_pts)
 Face base interior function. More...
 
MoFEMErrorCode Hcurl_Demkowicz_FaceBaseFunctions_MBTRI (int *faces_nodes, int p, double *n, double *diff_n, double *phi, double *diff_phi, int nb_integration_pts)
 Face base interior function. More...
 
MoFEMErrorCode Hcurl_Demkowicz_VolumeBaseFunctions_MBTET (int p, double *n, double *diff_n, double *phi, double *diff_phi, int nb_integration_pts)
 Volume base interior function. More...
 
MoFEMErrorCode Hdiv_Ainsworth_EdgeFaceShapeFunctions_MBTET (int *faces_nodes, int *p, double *N, double *diffN, double *phi_f_e[4][3], double *diff_phi_f_e[4][3], int gdim, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
 Hdiv base functions, Edge-based face functions by Ainsworth [1]. More...
 
MoFEMErrorCode Hdiv_Ainsworth_EdgeFaceShapeFunctions_MBTET_ON_FACE (int *faces_nodes, int p, double *N, double *diffN, double *phi_f_e[3], double *diff_phi_f_e[3], int gdim, int nb, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
 Hdiv base functions, Edge-based face functions by Ainsworth [1]. More...
 
MoFEMErrorCode Hdiv_Ainsworth_FaceBubbleShapeFunctions (int *faces_nodes, int *p, double *N, double *diffN, double *phi_f[], double *diff_phi_f[], int gdim, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
 Face bubble functions by Ainsworth [1]. More...
 
MoFEMErrorCode Hdiv_Ainsworth_FaceBubbleShapeFunctions_ON_FACE (int *faces_nodes, int p, double *N, double *diffN, double *phi_f, double *diff_phi_f, int gdim, int nb, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
 Face bubble functions by Ainsworth [1]. More...
 
MoFEMErrorCode Hdiv_Ainsworth_EdgeBasedVolumeShapeFunctions_MBTET (int p, double *N, double *diffN, double *phi_v_e[6], double *diff_phi_v_e[6], int gdim, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
 Hdiv base function, Edge-based interior (volume) functions by Ainsworth [1]. More...
 
MoFEMErrorCode Hdiv_Ainsworth_FaceBasedVolumeShapeFunctions_MBTET (int p, double *N, double *diffN, double *phi_v_f[], double *diff_phi_v_f[], int gdim, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
 
MoFEMErrorCode Hdiv_Ainsworth_VolumeBubbleShapeFunctions_MBTET (int p, double *N, double *diffN, double *phi_v, double *diff_phi_v, int gdim, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
 Interior bubble functions by Ainsworth [1]. More...
 
MoFEMErrorCode Hdiv_Demkowicz_Face_MBTET_ON_FACE (int *faces_nodes, int p, double *N, double *diffN, double *phi_f, double *diff_phi_f, int gdim, int nb)
 
MoFEMErrorCode Hdiv_Demkowicz_Interior_MBTET (int p, double *N, double *diffN, int p_face[], double *phi_f[4], double *diff_phi_f[4], double *phi_v, double *diff_phi_v, int gdim)
 
MoFEMErrorCode quad_split_all_edges (const EntityHandle *conn, const BitRefEdges split_edges, const EntityHandle *edge_new_nodes, EntityHandle *new_quad_conn)
 
template<class TYPE >
static MoFEMErrorCode get_value (MatrixDouble &pts_x, MatrixDouble &pts_t, TYPE *ctx)
 
MoFEMErrorCode setMPCParentAdjacency ()
 
template<typename T = EntityStorage>
MoFEMErrorCode VecSetValues (Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
 Assemble PETSc vector. More...
 
template<>
MoFEMErrorCode VecSetValues< EntityStorage > (Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
 
template<typename T = EntityStorage>
MoFEMErrorCode VecSetValues (Vec V, const EntitiesFieldData::EntData &data, const VectorDouble &vec, InsertMode iora)
 Assemble PETSc vector. More...
 
template<typename T = EntityStorage>
MoFEMErrorCode MatSetValues (Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
 Assemble PETSc matrix. More...
 
template<typename T = EntityStorage>
MoFEMErrorCode MatSetValues (Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora)
 Assemble PETSc matrix. More...
 
template<>
MoFEMErrorCode MatSetValues< EntityStorage > (Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
 
template<>
MoFEMErrorCode VecSetValues< EssentialBcStorage > (Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
 Set values to vector in operator. More...
 
template<>
MoFEMErrorCode MatSetValues< EssentialBcStorage > (Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
 Set values to matrix in operator. More...
 
template<>
MoFEMErrorCode MatSetValues< AssemblyTypeSelector< PETSC > > (Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
 
template<>
MoFEMErrorCode VecSetValues< AssemblyTypeSelector< PETSC > > (Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
 
double scalar_fun_one (const double, const double, const double)
 
template<typename E >
MoFEMErrorCode addHOOpsVol (const std::string field, E &e, bool h1, bool hcurl, bool hdiv, bool l2)
 
template<typename E >
MoFEMErrorCode addHOOpsFace3D (const std::string field, E &e, bool hcurl, bool hdiv)
 
static void constructor_data (EntitiesFieldData *data, const EntityType type)
 
static void constructor_derived_data (DerivedEntitiesFieldData *derived_data, const boost::shared_ptr< EntitiesFieldData > &data_ptr)
 
std::ostream & operator<< (std::ostream &os, const EntitiesFieldData::EntData &e)
 
std::ostream & operator<< (std::ostream &os, const EntitiesFieldData &e)
 
static auto cmp_uid_lo (const boost::weak_ptr< FieldEntity > &a, const UId &b)
 
static auto cmp_uid_hi (const UId &b, const boost::weak_ptr< FieldEntity > &a)
 
template<typename ENTMULTIINDEX >
static int getMaxOrder (const ENTMULTIINDEX &multi_index)
 
boost::shared_ptr< BlockStructurecreateBlockMatStructure (DM dm, SchurFEOpsFEandFields schur_fe_op_vec)
 Create a Mat Diag Blocks object. More...
 
static MoFEMErrorCode mult_schur_block_shell (Mat mat, Vec x, Vec y, InsertMode iora, boost::function< int(DiagBlockIndex::BlockIndex::nth_index< 0 >::type::iterator)> shift_extractor, boost::shared_ptr< std::vector< double >> data_blocks_ptr, bool multiply_by_preconditioner)
 
static MoFEMErrorCode solve_schur_block_shell (Mat mat, Vec y, Vec x, InsertMode iora)
 
static PetscErrorCode mult (Mat mat, Vec x, Vec y)
 
static PetscErrorCode mult_add (Mat mat, Vec x, Vec y)
 
static PetscErrorCode solve (Mat mat, Vec x, Vec y)
 
static PetscErrorCode solve_add (Mat mat, Vec x, Vec y)
 
static PetscErrorCode zero_rows_columns (Mat A, PetscInt N, const PetscInt rows[], PetscScalar diag, Vec x, Vec b)
 
static PetscErrorCode mat_zero (Mat m)
 
static MoFEMErrorCode setSchurBlockMatOps (Mat mat_raw)
 
SchurShellMatData createBlockMat (DM dm, boost::shared_ptr< BlockStructure > data)
 Create a Schur Mat object. More...
 
MoFEMErrorCode shell_block_mat_asmb_wrap_impl (BlockStructure *ctx, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora, boost::function< int(const DiagBlockIndex::Indexes *)> shift_extractor, boost::shared_ptr< std::vector< double >> data_blocks_ptr)
 
MoFEMErrorCode shell_block_mat_asmb_wrap (Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora)
 
MoFEMErrorCode shell_block_preconditioner_mat_asmb_wrap (Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora)
 
boost::shared_ptr< NestSchurDatacreateSchurNestedMatrixStruture (std::pair< SmartPetscObj< DM >, SmartPetscObj< DM >> dms, boost::shared_ptr< BlockStructure > block_mat_data, std::vector< std::string > fields_name, std::vector< boost::shared_ptr< Range >> field_ents, bool add_preconditioner_block=false)
 Get the Schur Nest Mat Array object. More...
 
std::pair< SmartPetscObj< Mat >, boost::shared_ptr< NestSchurData > > createSchurNestedMatrix (boost::shared_ptr< NestSchurData > schur_net_data_ptr)
 Create a Mat Diag Blocks object. More...
 
OpSchurAssembleBasecreateOpSchurAssembleBegin ()
 
OpSchurAssembleBasecreateOpSchurAssembleEnd (std::vector< std::string > fields_name, std::vector< boost::shared_ptr< Range >> field_ents, SmartPetscObj< AO > ao=SmartPetscObj< AO >(), SmartPetscObj< Mat > schur=SmartPetscObj< Mat >(), bool sym_schur=false, bool symm_op=false)
 Construct a new Op Schur Assemble End object. More...
 
OpSchurAssembleBasecreateOpSchurAssembleEnd (std::vector< std::string > fields_name, std::vector< boost::shared_ptr< Range >> field_ents, std::vector< SmartPetscObj< AO >> sequence_of_aos, std::vector< SmartPetscObj< Mat >> sequence_of_mats, std::vector< bool > sym_schur, bool symm_op, boost::shared_ptr< BlockStructure > diag_blocks)
 
OpSchurAssembleBasecreateOpSchurAssembleEnd (std::vector< std::string > fields_name, std::vector< boost::shared_ptr< Range >> field_ents, std::vector< SmartPetscObj< AO >> sequence_of_aos, std::vector< SmartPetscObj< Mat >> sequence_of_mats, std::vector< bool > sym_schur, std::vector< double > diag_eps, bool symm_op, boost::shared_ptr< BlockStructure > diag_blocks)
 
MoFEMErrorCode setSchurA00MatSolvePC (SmartPetscObj< PC > pc)
 Set PC for A00 block. More...
 
MoFEMErrorCode setSchurMatSolvePC (SmartPetscObj< PC > pc)
 
template<>
MoFEMErrorCode MatSetValues< SchurElemMats > (Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora)
 
MoFEMErrorCode schur_mat_set_values_wrap (Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora)
 
template<>
MoFEMErrorCode MatSetValues< AssemblyTypeSelector< SCHUR > > (Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora)
 
template<>
MoFEMErrorCode MatSetValues< BlockStructure > (Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora)
 
template<>
MoFEMErrorCode MatSetValues< SchurElemMatsBlock > (Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora)
 
template<>
MoFEMErrorCode MatSetValues< SchurElemMatsPreconditionedBlock > (Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora)
 
MoFEMErrorCode schurSwitchPreconditioner (boost::shared_ptr< BlockStructure > block_mat_data)
 Switch preconditioner. More...
 
MoFEMErrorCode schurSaveBlockMesh (boost::shared_ptr< BlockStructure > block_mat_data, std::string filename)
 Save block matrix as a mesh. More...
 
template<>
MoFEMErrorCode DMMoFEMSetNestSchurData (DM dm, boost::shared_ptr< NestSchurData >)
 
template<>
MoFEMErrorCode VecSetValues< SchurElemMats > (Vec V, const EntitiesFieldData::EntData &data, const VectorDouble &nf, InsertMode iora)
 
template<>
MoFEMErrorCode VecSetValues< AssemblyTypeSelector< SCHUR > > (Vec V, const EntitiesFieldData::EntData &data, const VectorDouble &nf, InsertMode iora)
 
template<>
MoFEMErrorCode MatSetValues< AssemblyTypeSelector< BLOCK_MAT > > (Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora)
 
template<>
MoFEMErrorCode VecSetValues< AssemblyTypeSelector< BLOCK_MAT > > (Vec V, const EntitiesFieldData::EntData &data, const VectorDouble &nf, InsertMode iora)
 
template<>
MoFEMErrorCode VecSetValues< SchurElemMatsBlock > (Vec V, const EntitiesFieldData::EntData &data, const VectorDouble &nf, InsertMode iora)
 
template<>
MoFEMErrorCode MatSetValues< AssemblyTypeSelector< BLOCK_SCHUR > > (Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora)
 
template<>
MoFEMErrorCode VecSetValues< AssemblyTypeSelector< BLOCK_SCHUR > > (Vec V, const EntitiesFieldData::EntData &data, const VectorDouble &nf, InsertMode iora)
 
template<>
MoFEMErrorCode MatSetValues< AssemblyTypeSelector< BLOCK_PRECONDITIONER_SCHUR > > (Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora)
 
template<>
MoFEMErrorCode VecSetValues< AssemblyTypeSelector< BLOCK_PRECONDITIONER_SCHUR > > (Vec V, const EntitiesFieldData::EntData &data, const VectorDouble &nf, InsertMode iora)
 
DEPRECATED boost::shared_ptr< NestSchurDatagetNestSchurData (std::pair< SmartPetscObj< DM >, SmartPetscObj< DM >> dms, boost::shared_ptr< BlockStructure > block_mat_data, std::vector< std::string > fields_name, std::vector< boost::shared_ptr< Range >> field_ents, bool add_preconditioner_block=false)
 
template<class T >
static auto get_sub_iface_options_imp (T *const ptr, int) -> decltype(ptr->getSubInterfaceOptions())
 
template<class T >
static auto get_sub_iface_options_imp (T *const ptr, long) -> MoFEMErrorCode
 
template<class T >
static auto get_event_options_imp (T *const ptr, int) -> decltype(ptr->getEventOptions())
 
template<class T >
static auto get_event_options_imp (T *const ptr, long) -> MoFEMErrorCode
 
template<int V, typename std::enable_if<(V >=0), int >::type * = nullptr>
void set_ref_ent_basic_data_ptr_impl (boost::shared_ptr< BasicEntityData > &ptr)
 
std::ostream & operator<< (std::ostream &strm, const LogManager::SeverityLevel &level)
 
static std::vector< med_geometrie_element > moab2med_element_type (const EntityType type)
 
std::ostream & operator<< (std::ostream &os, const MedInterface::FieldData &field_data)
 
static auto min_non_abs (const double a, const double b)
 
template<typename T1 , typename T2 >
MoFEMErrorCode getLocalCoordinatesOnReferenceThreeNodeTriImpl (const T1 *elem_coords, const T2 *global_coords, const int nb_nodes, typename FTensor::promote< T1, T2 >::V *local_coords)
 
std::ostream & operator<< (std::ostream &os, const FENumeredDofEntity &e)
 
std::ostream & operator<< (std::ostream &os, const DisplacementCubitBcData &e)
 
std::ostream & operator<< (std::ostream &os, const ForceCubitBcData &e)
 
std::ostream & operator<< (std::ostream &os, const VelocityCubitBcData &e)
 
std::ostream & operator<< (std::ostream &os, const AccelerationCubitBcData &e)
 
std::ostream & operator<< (std::ostream &os, const TemperatureCubitBcData &e)
 
std::ostream & operator<< (std::ostream &os, const PressureCubitBcData &e)
 
std::ostream & operator<< (std::ostream &os, const HeatFluxCubitBcData &e)
 
std::ostream & operator<< (std::ostream &os, const CfgCubitBcData &e)
 
std::ostream & operator<< (std::ostream &os, const CubitMeshSets &e)
 
std::ostream & operator<< (std::ostream &os, const DofEntity &e)
 
std::ostream & operator<< (std::ostream &os, const NumeredDofEntity &e)
 
std::ostream & operator<< (std::ostream &os, const FEDofEntity &e)
 
std::ostream & operator<< (std::ostream &os, const FiniteElement &e)
 
std::ostream & operator<< (std::ostream &os, const EntFiniteElement &e)
 
std::ostream & operator<< (std::ostream &os, const NumeredEntFiniteElement &e)
 
template<typename ENTSVIEW , typename DOFSVIEW , typename EXTRACTOR , typename INSERTER >
static MoFEMErrorCode get_cache_data_dofs_view (ENTSVIEW &ents_view, DOFSVIEW &dofs_view, EXTRACTOR &&extractor, INSERTER &&inserter)
 
std::ostream & operator<< (std::ostream &os, const FieldEntity &e)
 
std::ostream & operator<< (std::ostream &os, const Field &e)
 
std::ostream & operator<< (std::ostream &os, const FieldEntityEntFiniteElementAdjacencyMap &e)
 
std::ostream & operator<< (std::ostream &os, const BlockSetAttributes &e)
 
std::ostream & operator<< (std::ostream &os, const Mat_Elastic &e)
 
std::ostream & operator<< (std::ostream &os, const Mat_Elastic_EberleinHolzapfel1 &e)
 
std::ostream & operator<< (std::ostream &os, const Mat_Thermal &e)
 
std::ostream & operator<< (std::ostream &os, const Mat_Moisture &e)
 
std::ostream & operator<< (std::ostream &os, const Block_BodyForces &e)
 
std::ostream & operator<< (std::ostream &os, const Mat_Elastic_TransIso &e)
 
std::ostream & operator<< (std::ostream &os, const Mat_Interf &e)
 
std::ostream & operator<< (std::ostream &os, const Problem &e)
 
std::ostream & operator<< (std::ostream &os, const RefElement &e)
 
std::ostream & operator<< (std::ostream &os, const RefElementVolume &e)
 
std::ostream & operator<< (std::ostream &os, const RefElementFace &e)
 
std::ostream & operator<< (std::ostream &os, const RefElement_EDGE &e)
 
std::ostream & operator<< (std::ostream &os, const RefElement_VERTEX &e)
 
std::ostream & operator<< (std::ostream &os, const RefEntity &e)
 
std::ostream & operator<< (std::ostream &os, const FieldSeries &e)
 
std::ostream & operator<< (std::ostream &os, const FieldSeriesStep &e)
 
template<EntityType TYPE>
EntityHandle get_id_for_max_type ()
 
template<EntityType TYPE>
EntityHandle get_id_for_min_type ()
 
EntityHandle get_id_for_max_type (const EntityType type)
 
EntityHandle get_id_for_min_type (const EntityType type)
 
void * get_tag_ptr (moab::Interface &moab, Tag th, EntityHandle ent, int *tag_size)
 Get the tag ptr object. More...
 
PetscErrorCode DMRegister_MoFEM (const char sname[])
 Register MoFEM problem. More...
 
PetscErrorCode DMMoFEMCreateMoFEM (DM dm, MoFEM::Interface *m_field_ptr, const char problem_name[], const MoFEM::BitRefLevel bit_level, const MoFEM::BitRefLevel bit_mask=MoFEM::BitRefLevel().set())
 Must be called by user to set MoFEM data structures. More...
 
PetscErrorCode DMMoFEMDuplicateDMCtx (DM dm, DM dm_duplicate)
 Duplicate internal data struture. More...
 
PetscErrorCode DMMoFEMSwapDMCtx (DM dm, DM dm_swap)
 Swap internal data struture. More...
 
PetscErrorCode DMMoFEMCreateSubDM (DM subdm, DM dm, const char problem_name[])
 Must be called by user to set Sub DM MoFEM data structures. More...
 
PetscErrorCode DMoFEMGetInterfacePtr (DM dm, MoFEM::Interface **m_field_ptr)
 Get pointer to MoFEM::Interface. More...
 
PetscErrorCode DMMoFEMGetProblemPtr (DM dm, const MoFEM::Problem **problem_ptr)
 Get pointer to problem data structure. More...
 
PetscErrorCode DMMoFEMSetDestroyProblem (DM dm, PetscBool destroy_problem)
 
PetscErrorCode DMMoFEMGetDestroyProblem (DM dm, PetscBool *destroy_problem)
 
PetscErrorCode DMMoFEMSetSquareProblem (DM dm, PetscBool square_problem)
 set squared problem More...
 
PetscErrorCode DMMoFEMGetSquareProblem (DM dm, PetscBool *square_problem)
 get squared problem More...
 
PetscErrorCode DMMoFEMResolveSharedFiniteElements (DM dm, std::string fe_name)
 Resolve shared entities. More...
 
PetscErrorCode DMMoFEMGetProblemFiniteElementLayout (DM dm, std::string fe_name, PetscLayout *layout)
 Get finite elements layout in the problem. More...
 
PetscErrorCode DMMoFEMAddElement (DM dm, std::string fe_name)
 add element to dm More...
 
PetscErrorCode DMMoFEMAddElement (DM dm, std::vector< std::string > fe_name)
 add element to dm More...
 
PetscErrorCode DMMoFEMUnSetElement (DM dm, std::string fe_name)
 unset element from dm More...
 
PetscErrorCode DMoFEMMeshToLocalVector (DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
 set local (or ghosted) vector values on mesh for partition only More...
 
PetscErrorCode DMoFEMMeshToGlobalVector (DM dm, Vec g, InsertMode mode, ScatterMode scatter_mode)
 set ghosted vector values on all existing mesh entities More...
 
PetscErrorCode DMoFEMPreProcessFiniteElements (DM dm, MoFEM::FEMethod *method)
 execute finite element method for each element in dm (problem) More...
 
PetscErrorCode DMoFEMPostProcessFiniteElements (DM dm, MoFEM::FEMethod *method)
 execute finite element method for each element in dm (problem) More...
 
PetscErrorCode DMoFEMLoopFiniteElementsUpAndLowRank (DM dm, const char fe_name[], MoFEM::FEMethod *method, int low_rank, int up_rank, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
 Executes FEMethod for finite elements in DM. More...
 
PetscErrorCode DMoFEMLoopFiniteElementsUpAndLowRank (DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, int low_rank, int up_rank, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
 Executes FEMethod for finite elements in DM. More...
 
PetscErrorCode DMoFEMLoopFiniteElements (DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
 Executes FEMethod for finite elements in DM. More...
 
PetscErrorCode DMoFEMLoopFiniteElements (DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
 Executes FEMethod for finite elements in DM. More...
 
PetscErrorCode DMoFEMLoopDofs (DM dm, const char field_name[], MoFEM::DofMethod *method)
 execute method for dofs on field in problem More...
 
PetscErrorCode DMMoFEMKSPSetComputeRHS (DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
 set KSP right hand side evaluation function More...
 
PetscErrorCode DMMoFEMKSPSetComputeRHS (DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
 set KSP right hand side evaluation function More...
 
PetscErrorCode DMMoFEMKSPSetComputeOperators (DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
 Set KSP operators and push mofem finite element methods. More...
 
PetscErrorCode DMMoFEMKSPSetComputeOperators (DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
 Set KSP operators and push mofem finite element methods. More...
 
PetscErrorCode DMMoFEMSNESSetFunction (DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
 set SNES residual evaluation function More...
 
PetscErrorCode DMMoFEMSNESSetFunction (DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
 set SNES residual evaluation function More...
 
PetscErrorCode DMMoFEMSNESSetJacobian (DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
 set SNES Jacobian evaluation function More...
 
PetscErrorCode DMMoFEMSNESSetJacobian (DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
 set SNES Jacobian evaluation function More...
 
PetscErrorCode DMMoFEMTSSetIFunction (DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
 set TS implicit function evaluation function More...
 
PetscErrorCode DMMoFEMTSSetIFunction (DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
 set TS implicit function evaluation function More...
 
PetscErrorCode DMMoFEMTSSetIJacobian (DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
 set TS Jacobian evaluation function More...
 
PetscErrorCode DMMoFEMTSSetIJacobian (DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
 set TS Jacobian evaluation function More...
 
PetscErrorCode DMMoFEMTSSetRHSFunction (DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
 set TS the right hand side function More...
 
PetscErrorCode DMMoFEMTSSetRHSFunction (DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
 
PetscErrorCode DMMoFEMTSSetRHSJacobian (DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
 set TS the right hand side jacobian More...
 
PetscErrorCode DMMoFEMTSSetRHSJacobian (DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
 
PetscErrorCode DMMoFEMTSSetI2Function (DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
 set TS implicit function evaluation function More...
 
PetscErrorCode DMMoFEMTSSetI2Function (DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
 set TS implicit function evaluation function More...
 
PetscErrorCode DMMoFEMTSSetI2Jacobian (DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
 set TS Jacobian evaluation function More...
 
PetscErrorCode DMMoFEMTSSetI2Jacobian (DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
 set TS Jacobian evaluation function More...
 
PetscErrorCode DMMoFEMTSSetMonitor (DM dm, TS ts, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
 Set Monitor To TS solver. More...
 
PetscErrorCode DMMoFEMTSSetMonitor (DM dm, TS ts, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
 Set Monitor To TS solver. More...
 
PetscErrorCode DMMoFEMGetKspCtx (DM dm, MoFEM::KspCtx **ksp_ctx)
 get MoFEM::KspCtx data structure More...
 
PetscErrorCode DMMoFEMGetKspCtx (DM dm, const boost::shared_ptr< MoFEM::KspCtx > &ksp_ctx)
 get MoFEM::KspCtx data structure More...
 
PetscErrorCode DMMoFEMSetKspCtx (DM dm, boost::shared_ptr< MoFEM::KspCtx > ksp_ctx)
 set MoFEM::KspCtx data structure More...
 
PetscErrorCode DMMoFEMGetSnesCtx (DM dm, MoFEM::SnesCtx **snes_ctx)
 get MoFEM::SnesCtx data structure More...
 
PetscErrorCode DMMoFEMGetSnesCtx (DM dm, const boost::shared_ptr< MoFEM::SnesCtx > &snes_ctx)
 get MoFEM::SnesCtx data structure More...
 
PetscErrorCode DMMoFEMSetSnesCtx (DM dm, boost::shared_ptr< MoFEM::SnesCtx > snes_ctx)
 Set MoFEM::SnesCtx data structure. More...
 
PetscErrorCode DMMoFEMGetTsCtx (DM dm, MoFEM::TsCtx **ts_ctx)
 get MoFEM::TsCtx data structure More...
 
PetscErrorCode DMMoFEMGetTsCtx (DM dm, const boost::shared_ptr< MoFEM::TsCtx > &ts_ctx)
 get MoFEM::TsCtx data structure More...
 
PetscErrorCode DMMoFEMSetTsCtx (DM dm, boost::shared_ptr< MoFEM::TsCtx > ts_ctx)
 Set MoFEM::TsCtx data structure. More...
 
PetscErrorCode DMMoFEMSetIsPartitioned (DM dm, PetscBool is_partitioned)
 
PetscErrorCode DMMoFEMGetIsPartitioned (DM dm, PetscBool *is_partitioned)
 
PetscErrorCode DMSetOperators_MoFEM (DM dm)
 Set operators for MoFEM dm. More...
 
PetscErrorCode DMCreate_MoFEM (DM dm)
 Create dm data structure with MoFEM data structure. More...
 
PetscErrorCode DMDestroy_MoFEM (DM dm)
 Destroys dm with MoFEM data structure. More...
 
PetscErrorCode DMCreateGlobalVector_MoFEM (DM dm, Vec *g)
 DMShellSetCreateGlobalVector. More...
 
PetscErrorCode DMCreateGlobalVector_MoFEM (DM dm, SmartPetscObj< Vec > &g_ptr)
 DMShellSetCreateGlobalVector. More...
 
PetscErrorCode DMCreateLocalVector_MoFEM (DM dm, Vec *l)
 DMShellSetCreateLocalVector. More...
 
PetscErrorCode DMCreateMatrix_MoFEM (DM dm, Mat *M)
 
PetscErrorCode DMCreateMatrix_MoFEM (DM dm, SmartPetscObj< Mat > &M)
 
PetscErrorCode DMSetFromOptions_MoFEM (DM dm)
 
PetscErrorCode DMSetUp_MoFEM (DM dm)
 
PetscErrorCode DMSubDMSetUp_MoFEM (DM subdm)
 
PetscErrorCode DMMoFEMAddSubFieldRow (DM dm, const char field_name[])
 
PetscErrorCode DMMoFEMAddSubFieldRow (DM dm, std::string field_name)
 
PetscErrorCode DMMoFEMAddSubFieldRow (DM dm, const char field_name[], boost::shared_ptr< Range > r_ptr)
 Add field to sub dm problem on rows. More...
 
PetscErrorCode DMMoFEMAddSubFieldRow (DM dm, std::string field_name, boost::shared_ptr< Range > r_ptr)
 Add field to sub dm problem on rows. More...
 
PetscErrorCode DMMoFEMAddSubFieldCol (DM dm, const char field_name[])
 
PetscErrorCode DMMoFEMAddSubFieldCol (DM dm, std::string field_name)
 
PetscErrorCode DMMoFEMAddSubFieldCol (DM dm, const char field_name[], boost::shared_ptr< Range > r_ptr)
 Add field to sub dm problem on columns. More...
 
PetscErrorCode DMMoFEMAddSubFieldCol (DM dm, std::string field_name, boost::shared_ptr< Range > r_ptr)
 Add field to sub dm problem on columns. More...
 
PetscErrorCode DMMoFEMGetIsSubDM (DM dm, PetscBool *is_sub_dm)
 
PetscErrorCode DMMoFEMGetSubRowIS (DM dm, IS *is)
 get sub problem is More...
 
PetscErrorCode DMMoFEMGetSubColIS (DM dm, IS *is)
 get sub problem is More...
 
PetscErrorCode DMMoFEMAddRowCompositeProblem (DM dm, const char prb_name[])
 Add problem to composite DM on row. More...
 
PetscErrorCode DMMoFEMAddColCompositeProblem (DM dm, const char prb_name[])
 Add problem to composite DM on col. More...
 
PetscErrorCode DMMoFEMGetIsCompDM (DM dm, PetscBool *is_comp_dm)
 Get if this DM is composite DM. More...
 
PetscErrorCode DMGlobalToLocalBegin_MoFEM (DM dm, Vec, InsertMode, Vec)
 
PetscErrorCode DMGlobalToLocalEnd_MoFEM (DM dm, Vec, InsertMode, Vec)
 
PetscErrorCode DMLocalToGlobalBegin_MoFEM (DM, Vec, InsertMode, Vec)
 
PetscErrorCode DMLocalToGlobalEnd_MoFEM (DM, Vec, InsertMode, Vec)
 
PetscErrorCode DMCreateFieldIS_MoFEM (DM dm, PetscInt *numFields, char ***fieldNames, IS **fields)
 
PetscErrorCode DMMoFEMGetFieldIS (DM dm, RowColData rc, const char field_name[], IS *is)
 get field is in the problem More...
 
PetscErrorCode DMMoFEMSetVerbosity (DM dm, const int verb)
 Set verbosity level. More...
 
MoFEMErrorCode DMMoFEMSetBlocMatData (DM dm, boost::shared_ptr< BlockStructure >)
 Set data for block mat. More...
 
MoFEMErrorCode DMMoFEMGetBlocMatData (DM dm, boost::shared_ptr< BlockStructure > &)
 Get data for block mat. More...
 
MoFEMErrorCode DMMoFEMCreateBlockMat (DM dm, Mat *mat)
 Create block matrix. More...
 
MoFEMErrorCode DMMoFEMCreateBlockMat (DM dm, SmartPetscObj< Mat > &mat)
 Create block matrix. More...
 
template<typename T >
MoFEMErrorCode DMMoFEMSetNestSchurData (DM dm, boost::shared_ptr< T >)
 Set data for nest schur (see specialisation in Schur.hpp) More...
 
MoFEMErrorCode DMMoFEMCreateNestSchurMat (DM dm, Mat *mat)
 Create nest schur matrix. More...
 
MoFEMErrorCode DMMoFEMCreateHybridL2Mat (DM dm, SmartPetscObj< Mat > &mat)
 Create matrix for hybridised system. More...
 
auto getInterfacePtr (DM dm)
 Get the Interface Ptr object. More...
 
auto getProblemPtr (DM dm)
 get problem pointer from DM More...
 
auto createDMMatrix (DM dm)
 Get smart matrix from DM. More...
 
auto createDMHybridisedL2Matrix (DM dm)
 Get smart hybridised L2 matrix from DM. More...
 
auto createDMBlockMat (DM dm)
 
auto createDMNestSchurMat (DM dm)
 
DEPRECATED auto smartCreateDMMatrix (DM dm)
 
auto createDMVector (DM dm)
 Get smart vector from DM. More...
 
DEPRECATED auto smartCreateDMVector (DM dm)
 
auto getDMKspCtx (DM dm)
 Get KSP context data structure used by DM. More...
 
DEPRECATED auto smartGetDMKspCtx (DM dm)
 
auto getDMSnesCtx (DM dm)
 Get SNES context data structure used by DM. More...
 
DEPRECATED auto smartGetDMSnesCtx (DM dm)
 
auto getDMTsCtx (DM dm)
 Get TS context data structure used by DM. More...
 
DEPRECATED auto smartGetDMTsCtx (DM dm)
 
auto getDMSubData (DM dm)
 Get sub problem data structure. More...
 
template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode DMMoFEMKSPSetComputeRHS (DM dm, S fe_name, T0 method, T1 pre_only, T2 post_only)
 
template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode DMMoFEMKSPSetComputeOperators (DM dm, S fe_name, T0 method, T1 pre_only, T2 post_only)
 
template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode DMMoFEMSNESSetFunction (DM dm, S fe_name, T0 method, T1 pre_only, T2 post_only)
 
template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode DMMoFEMSNESSetJacobian (DM dm, S fe_name, T0 method, T1 pre_only, T2 post_only)
 
template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode DMMoFEMTSSetIFunction (DM dm, S fe_name, T0 method, T1 pre_only, T2 post_only)
 
template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode DMMoFEMTSSetIJacobian (DM dm, S fe_name, T0 method, T1 pre_only, T2 post_only)
 
template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode DMMoFEMTSSetRHSFunction (DM dm, S fe_name, T0 method, T1 pre_only, T2 post_only)
 
template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode DMMoFEMTSSetRHSJacobian (DM dm, S fe_name, T0 method, T1 pre_only, T2 post_only)
 
template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode DMMoFEMTSSetI2Function (DM dm, S fe_name, T0 method, T1 pre_only, T2 post_only)
 
template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode DMMoFEMTSSetI2Jacobian (DM dm, S fe_name, T0 method, T1 pre_only, T2 post_only)
 
template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode DMMoFEMTSSetMonitor (DM dm, TS ts, S fe_name, T0 method, T1 pre_only, T2 post_only)
 
PetscErrorCode KspRhs (KSP ksp, Vec f, void *ctx)
 Run over elements in the lists. More...
 
PetscErrorCode KspMat (KSP ksp, Mat A, Mat B, void *ctx)
 Run over elements in the list. More...
 
template<InsertMode MODE>
MoFEMErrorCode sub_mat_mult_generic (Mat a, Vec x, Vec f)
 
MoFEMErrorCode sub_mat_mult (Mat a, Vec x, Vec f)
 
MoFEMErrorCode sub_mat_mult_add (Mat a, Vec x, Vec f)
 
MoFEMErrorCode sub_mat_sor (Mat mat, Vec b, PetscReal omega, MatSORType flag, PetscReal shift, PetscInt its, PetscInt lits, Vec x)
 
MoFEMErrorCode DMMGViaApproxOrdersSetAO (DM dm, AO ao)
 Set DM ordering. More...
 
MoFEMErrorCode DMMGViaApproxOrdersPushBackCoarseningIS (DM, IS is, Mat A, bool create_sub_matrix, bool shell_sub_a)
 Push back coarsening level to MG via approximation orders. More...
 
MoFEMErrorCode DMMGViaApproxOrdersPopBackCoarseningIS (DM)
 Pop IS form MG via approximation orders. More...
 
MoFEMErrorCode DMMGViaApproxOrdersClearCoarseningIS (DM)
 Clear approximation orders. More...
 
MoFEMErrorCode DMRegister_MGViaApproxOrders (const char sname[])
 Register DM for Multi-Grid via approximation orders. More...
 
static MoFEMErrorCode ksp_set_operators (KSP ksp, Mat A, Mat B, void *ctx)
 
MoFEMErrorCode DMCreate_MGViaApproxOrders (DM dm)
 Create DM data structure for Multi-Grid via approximation orders. More...
 
PetscErrorCode DMDestroy_MGViaApproxOrders (DM dm)
 Destroy DM. More...
 
MoFEMErrorCode DMCreateMatrix_MGViaApproxOrders (DM dm, Mat *M)
 Create matrix for Multi-Grid via approximation orders. More...
 
MoFEMErrorCode DMCoarsen_MGViaApproxOrders (DM dm, MPI_Comm comm, DM *dmc)
 Coarsen DM. More...
 
MoFEMErrorCode DMCreateInterpolation_MGViaApproxOrders (DM dm1, DM dm2, Mat *mat, Vec *vec)
 Create interpolation matrix between data managers dm1 and dm2. More...
 
MoFEMErrorCode DMCreateGlobalVector_MGViaApproxOrders (DM dm, Vec *g)
 Create global vector for DMGViaApproxOrders. More...
 
boost::shared_ptr< PCMGSetUpViaApproxOrdersCtxcreatePCMGSetUpViaApproxOrdersCtx (DM dm, Mat A, bool use_shell_mat)
 createPCMGSetUpViaApproxOrdersCtx More...
 
MoFEMErrorCode PCMGSetUpViaApproxOrders (PC pc, boost::shared_ptr< PCMGSetUpViaApproxOrdersCtx > ctx, int verb=0)
 Function build MG structure. More...
 
PetscErrorCode SnesRhs (SNES snes, Vec x, Vec f, void *ctx)
 This is MoFEM implementation for the right hand side (residual vector) evaluation in SNES solver. More...
 
PetscErrorCode SnesMat (SNES snes, Vec x, Mat A, Mat B, void *ctx)
 This is MoFEM implementation for the left hand side (tangent matrix) evaluation in SNES solver. More...
 
MoFEMErrorCode SnesMoFEMSetAssemblyType (SNES snes, MatAssemblyType type)
 Set assembly type at the end of SnesMat. More...
 
MoFEMErrorCode SnesMoFEMSetBehavior (SNES snes, MoFEMTypes bh)
 Set behavior if finite element in sequence does not exist. More...
 
MoFEMErrorCode MoFEMSNESMonitorFields (SNES snes, PetscInt its, PetscReal fgnorm, SnesCtx *snes_ctx)
 Sens monitor printing residual field by field. More...
 
PetscErrorCode TsSetIFunction (TS ts, PetscReal t, Vec u, Vec u_t, Vec F, void *ctx)
 Set IFunction for TS solver. More...
 
PetscErrorCode TsSetIJacobian (TS ts, PetscReal t, Vec u, Vec u_t, PetscReal a, Mat A, Mat B, void *ctx)
 Set function evaluating jacobian in TS solver. More...
 
PetscErrorCode TsMonitorSet (TS ts, PetscInt step, PetscReal t, Vec u, void *ctx)
 Set monitor for TS solver. More...
 
PetscErrorCode TsSetRHSFunction (TS ts, PetscReal t, Vec u, Vec F, void *ctx)
 TS solver function. More...
 
PetscErrorCode TsSetRHSJacobian (TS ts, PetscReal t, Vec u, Mat A, Mat B, void *ctx)
 TS solver function. More...
 
PetscErrorCode TsSetI2Jacobian (TS ts, PetscReal t, Vec u, Vec u_t, Vec u_tt, PetscReal a, PetscReal aa, Mat A, Mat B, void *ctx)
 Calculation Jacobian for second order PDE in time. More...
 
PetscErrorCode TsSetI2Function (TS ts, PetscReal t, Vec u, Vec u_t, Vec u_tt, Vec F, void *ctx)
 Calculation the right hand side for second order PDE in time. More...
 
PetscErrorCode TSAdaptChooseMoFEM (TSAdapt adapt, TS ts, PetscReal h, PetscInt *next_sc, PetscReal *next_h, PetscBool *accept, PetscReal *wlte, PetscReal *wltea, PetscReal *wlter)
 
PetscErrorCode TSAdaptResetMoFEM (TSAdapt adapt)
 
PetscErrorCode TSAdaptDestroyMoFEM (TSAdapt adapt)
 
PetscErrorCode TSAdaptCreateMoFEM (TSAdapt adapt)
 Craete MOFEM adapt. More...
 

Variables

DEPRECATED typedef EdgeElementForcesAndSourcesCore EdgeElementForcesAndSourcesCoreBase
 
DEPRECATED typedef EntitiesFieldData DataForcesAndSourcesCore
 
DEPRECATED typedef DerivedEntitiesFieldData DerivedDataForcesAndSourcesCore
 
DEPRECATED typedef FaceElementForcesAndSourcesCore FaceElementForcesAndSourcesCoreBase
 
DEPRECATED typedef FlatPrismElementForcesAndSourcesCore FlatPrismElementForcesAndSurcesCore
 USe FlatPrismElementForcesAndSourcesCore. More...
 
DEPRECATED typedef ForcesAndSourcesCore ForcesAndSurcesCore
 
DEPRECATED typedef VolumeElementForcesAndSourcesCore VolumeElementForcesAndSourcesCoreBase
 
DEPRECATED typedef VolumeElementForcesAndSourcesCoreOnContactPrismSide VolumeElementForcesAndSourcesCoreOnContactPrismSideBase
 
DEPRECATED typedef VolumeElementForcesAndSourcesCoreOnSide VolumeElementForcesAndSourcesCoreOnSideBase
 
DEPRECATED typedef DofMethod EntMethod
 
const EntityHandle no_handle
 No entity handle is indicated by zero handle, i.e. root meshset. More...
 
static constexpr int edges_conn [] = {0, 1, 1, 2, 2, 0, 0, 3, 1, 3, 2, 3}
 
static constexpr int oposite_edge [] = {5, 3, 4, 1, 2, 0}
 
static constexpr int edge_permutations [6][6]
 
static constexpr int edge_mirror_cross [6] = {0, 3, 4, 1, 2, 5}
 
static constexpr int edge_mirror_vertical [6] = {0, 4, 3, 2, 1, 5}
 
static constexpr int cyclic_node_rotate_face_3 [3][4]
 
static constexpr int cyclic_edge_rotate_face_3 [3][6]
 
static constexpr char edge_bits_mark [] = {1, 2, 4, 8, 16, 32}
 
Tag th
 
Field_multiIndex::index< FieldName_mi_tag >::type::iterator field_it
 
VectorDouble L
 
VectorDouble K
 
constexpr bool debug_schur = false
 
constexpr int max_gemv_size = 2
 
constexpr const char MoFEM_BLOCK_MAT [] = "mofem_block_mat"
 
static char dummy_file
 

Detailed Description

implementation of Data Operators for Forces and Sources

name space of MoFEM library functions and classes

file DataOperators.cpp

Typedef Documentation

◆ BaseDerivatives

Definition at line 1126 of file EntitiesFieldData.hpp.

◆ BasicMethodsSequence

Definition at line 57 of file AuxPETSc.hpp.

◆ BcTemperature

template<CubitBC BC>
using MoFEM::BcTemperature = typedef BcScalarMeshsetType<BC>

Definition at line 16 of file BcManager.hpp.

◆ BlockFieldPair

Definition at line 566 of file ProblemsMultiIndices.hpp.

◆ CacheMatsTypeType

using MoFEM::CacheMatsTypeType = typedef std::map<std::pair<int, int>, boost::shared_ptr<MatrixDouble> >

Definition at line 19 of file BiLinearFormsIntegratorsImpl.hpp.

◆ CacheTuple

using MoFEM::CacheTuple = typedef std::tuple< std::vector<EntityCacheDofs>, std::vector<EntityCacheNumeredDofs>, std::vector<EntityCacheNumeredDofs> >

Definition at line 492 of file FEMultiIndices.hpp.

◆ CacheTupleSharedPtr

using MoFEM::CacheTupleSharedPtr = typedef boost::shared_ptr<CacheTuple>

Definition at line 495 of file FEMultiIndices.hpp.

◆ CacheTupleWeakPtr

using MoFEM::CacheTupleWeakPtr = typedef boost::weak_ptr<CacheTuple>

Definition at line 494 of file FEMultiIndices.hpp.

◆ ConstantFun

using MoFEM::ConstantFun = typedef boost::function<double()>

Constant function type.

Definition at line 166 of file FormsIntegrators.hpp.

◆ Core

using MoFEM::Core = typedef CoreTmp<0>
Examples
add_blockset.cpp, add_cubit_meshsets.cpp, adolc_plasticity.cpp, analytical_nonlinear_poisson.cpp, analytical_poisson.cpp, analytical_poisson_field_split.cpp, approx_sphere.cpp, bernstein_bezier_generate_base.cpp, bone_adaptation.cpp, boundary_marker.cpp, build_large_problem.cpp, build_problems.cpp, cell_forces.cpp, child_and_parent.cpp, continuity_check_on_contact_prism_side_ele.cpp, continuity_check_on_skeleton_3d.cpp, continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, cubit_bc_test.cpp, delete_ho_nodes.cpp, dg_projection.cpp, dm_build_partitioned_mesh.cpp, dm_create_subdm.cpp, dm_partitioned_no_field.cpp, dynamic_first_order_con_law.cpp, edge_and_bubble_shape_functions_on_quad.cpp, eigen_elastic.cpp, elasticity.cpp, elasticity_mixed_formulation.cpp, ep.cpp, EshelbianPlasticity.cpp, field_blas.cpp, field_evaluator.cpp, field_to_vertices.cpp, forces_and_sources_testing_edge_element.cpp, forces_and_sources_testing_flat_prism_element.cpp, forces_and_sources_testing_users_base.cpp, free_surface.cpp, gauss_points_on_outer_product.cpp, hanging_node_approx.cpp, hcurl_check_approx_in_2d.cpp, hcurl_curl_operator.cpp, hcurl_divergence_operator_2d.cpp, hdiv_check_approx_in_3d.cpp, hdiv_divergence_operator.cpp, heat_equation.cpp, heat_method.cpp, hello_world.cpp, helmholtz.cpp, hertz_surface.cpp, higher_derivatives.cpp, level_set.cpp, log.cpp, loop_entities.cpp, lorentz_force.cpp, magnetostatic.cpp, mesh_cut.cpp, mesh_insert_interface_atom.cpp, mesh_smoothing.cpp, meshset_to_vtk.cpp, minimal_surface_area.cpp, mixed_poisson.cpp, mortar_contact.cpp, mortar_contact_thermal.cpp, navier_stokes.cpp, node_merge.cpp, nonlinear_dynamics.cpp, nonlinear_elastic.cpp, operators_tests.cpp, partition_mesh.cpp, phase.cpp, photon_diffusion.cpp, plastic.cpp, plate.cpp, plot_base.cpp, poisson_2d_dis_galerkin.cpp, poisson_2d_homogeneous.cpp, prism_elements_from_surface.cpp, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, reaction_diffusion.cpp, remove_entities_from_problem.cpp, remove_entities_from_problem_not_partitioned.cpp, scalar_check_approximation.cpp, schur_test_diag_mat.cpp, seepage.cpp, shallow_wave.cpp, simple_contact.cpp, simple_contact_thermal.cpp, simple_elasticity.cpp, simple_interface.cpp, simple_l2_only.cpp, split_sideset.cpp, tensor_divergence_operator.cpp, test_broken_space.cpp, test_cache_on_entities.cpp, test_jacobian_of_simple_contact_element.cpp, testing_jacobian_of_hook_element.cpp, testing_jacobian_of_hook_scaled_with_density_element.cpp, thermo_elastic.cpp, unsaturated_transport.cpp, wave_equation.cpp, and wavy_surface.cpp.

Definition at line 1148 of file Core.hpp.

◆ CreateRowComressedADJMatrix

Deprecated:
do not use, instead use CreateRowCompressedADJMatrix

Definition at line 78 of file MatrixManager.cpp.

◆ CubitMeshSet_multiIndex

Stores data about meshsets (see CubitMeshSets) storing data about boundary conditions, interfaces, sidesets, nodests, blocksets.

Parameters
Meshset_mi_tagindex by meshset handle
CubitMeshsetType_mi_tagindex by bc type, see CubitBC
CubitMeshsetMaskedType_mi_tagindex by NODESET, SIDESET, BLOCKSET only
CubitMeshsets_nameindex by meshset name
Composite_Cubit_msId_And_MeshsetType_mi_tagindex by meshset id and type NODESET, SIDESET or BLOCKSET

Example:

MeshsetsManager *m_mng;
CHKERR m_field.getInterface(m_mng);
auto &index = m_mng->getMeshsetsMultindex();
auto mit =
index.get<CubitMeshsetMaskedType_mi_tag>().lower_bound(BLOCKSET); auto
hi_mit =
index.get<CubitMeshsetMaskedType_mi_tag>().upper_bound(BLOCKSET);
// Make a loop over all BLOCKSET
for(;mit!=hi_mit;mit++) {
int id = mit->getMeshsetId(); // get blockset id
EntityHandle handle = mit->getMeshset(); // get block meshset
std::vector< double > attributes;
// get block attributes
auto mit->getAttributes(attributes);
// do something
}

Definition at line 388 of file BCMultiIndices.hpp.

◆ CubitMeshsetById

typedef CubitMeshSet_multiIndex::index<CubitMeshsetType_mi_tag>::type MoFEM::CubitMeshsetById

Definition at line 24 of file MeshsetsManager.hpp.

◆ CubitMeshsetByMask

typedef CubitMeshSet_multiIndex::index<CubitMeshsetMaskedType_mi_tag>::type MoFEM::CubitMeshsetByMask

Definition at line 18 of file MeshsetsManager.hpp.

◆ CubitMeshsetByName

typedef CubitMeshSet_multiIndex::index<CubitMeshsets_name>::type MoFEM::CubitMeshsetByName

Definition at line 21 of file MeshsetsManager.hpp.

◆ CubitMeshsetByType

typedef CubitMeshSet_multiIndex::index<CubitMeshsetType_mi_tag>::type MoFEM::CubitMeshsetByType

Definition at line 15 of file MeshsetsManager.hpp.

◆ DofEntityByUId

using MoFEM::DofEntityByUId = typedef DofEntity_multiIndex::index<Unique_mi_tag>::type

Definition at line 319 of file DofsMultiIndices.hpp.

◆ DofsAllocator

using MoFEM::DofsAllocator = typedef ublas::unbounded_array< FEDofEntity *, std::allocator<FEDofEntity *> >

Definition at line 21 of file EntitiesFieldData.hpp.

◆ EmptyFieldBlocks

Definition at line 567 of file ProblemsMultiIndices.hpp.

◆ FEFun

using MoFEM::FEFun = typedef boost::function<double(const FEMethod *fe_ptr)>

Lambda function used to scale with time.

Definition at line 160 of file FormsIntegrators.hpp.

◆ FEMethodsSequence

Definition at line 56 of file AuxPETSc.hpp.

◆ Field_multiIndex_view

typedef multi_index_container< boost::shared_ptr<Field>, indexed_by< ordered_unique<tag<BitFieldId_mi_tag>, const_mem_fun<Field, const BitFieldId &, &Field::getId>, LtBit<BitFieldId> > > > MoFEM::Field_multiIndex_view

Definition at line 516 of file FieldMultiIndices.hpp.

◆ FieldEntAllocator

using MoFEM::FieldEntAllocator = typedef ublas::unbounded_array< FieldEntity *, std::allocator<FieldEntity *> >

Definition at line 29 of file EntitiesFieldData.hpp.

◆ FieldEntity_multiIndex

using MoFEM::FieldEntity_multiIndex = typedef multi_index_container< boost::shared_ptr<FieldEntity>, indexed_by< ordered_unique<tag<Unique_mi_tag>, member<FieldEntity, UId, &FieldEntity::localUId> >, ordered_non_unique<tag<Ent_mi_tag>, const_mem_fun<FieldEntity::interface_type_RefEntity, EntityHandle, &FieldEntity::getEnt> > > >

Definition at line 489 of file FieldEntsMultiIndices.hpp.

◆ FieldEntity_multiIndex_ent_view

using MoFEM::FieldEntity_multiIndex_ent_view = typedef multi_index_container< boost::shared_ptr<FieldEntity>, indexed_by< sequenced<>, ordered_non_unique<tag<Ent_mi_tag>, const_mem_fun<FieldEntity::interface_type_RefEntity, EntityHandle, &FieldEntity::getEnt> > > >

Definition at line 456 of file FieldEntsMultiIndices.hpp.

◆ FieldEntity_multiIndex_spaceType_view

using MoFEM::FieldEntity_multiIndex_spaceType_view = typedef multi_index_container< boost::shared_ptr<FieldEntity>, indexed_by< sequenced<>, ordered_non_unique< tag<Composite_EntType_and_Space_mi_tag>, composite_key<FieldEntity, const_mem_fun<FieldEntity::interface_type_RefEntity, EntityType, &FieldEntity::getEntType>, const_mem_fun<FieldEntity::interface_type_Field, FieldSpace, &FieldEntity::getSpace> > > > >

Definition at line 476 of file FieldEntsMultiIndices.hpp.

◆ FieldEntity_vector_view

typedef std::vector<boost::weak_ptr<FieldEntity> > MoFEM::FieldEntity_vector_view

Definition at line 478 of file FieldEntsMultiIndices.hpp.

◆ i_FTIndex

template<int DIM>
using MoFEM::i_FTIndex = typedef FTensor::Index<'i', DIM>

Definition at line 1998 of file Templates.hpp.

◆ I_FTIndex

template<int DIM>
using MoFEM::I_FTIndex = typedef FTensor::Index<'I', DIM>

Definition at line 2004 of file Templates.hpp.

◆ Interface

Examples
add_blockset.cpp, add_cubit_meshsets.cpp, adolc_plasticity.cpp, analytical_nonlinear_poisson.cpp, analytical_poisson.cpp, analytical_poisson_field_split.cpp, approx_sphere.cpp, bernstein_bezier_generate_base.cpp, bone_adaptation.cpp, boundary_marker.cpp, build_large_problem.cpp, build_problems.cpp, cell_forces.cpp, child_and_parent.cpp, continuity_check_on_contact_prism_side_ele.cpp, continuity_check_on_skeleton_3d.cpp, continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, cubit_bc_test.cpp, delete_ho_nodes.cpp, dg_projection.cpp, dm_build_partitioned_mesh.cpp, dm_create_subdm.cpp, dm_partitioned_no_field.cpp, dynamic_first_order_con_law.cpp, edge_and_bubble_shape_functions_on_quad.cpp, eigen_elastic.cpp, elasticity.cpp, elasticity_mixed_formulation.cpp, ElasticityMixedFormulation.hpp, ep.cpp, EshelbianPlasticity.cpp, field_blas.cpp, field_evaluator.cpp, field_to_vertices.cpp, forces_and_sources_testing_edge_element.cpp, forces_and_sources_testing_flat_prism_element.cpp, forces_and_sources_testing_users_base.cpp, free_surface.cpp, gauss_points_on_outer_product.cpp, hanging_node_approx.cpp, hcurl_check_approx_in_2d.cpp, hcurl_curl_operator.cpp, hcurl_divergence_operator_2d.cpp, hdiv_check_approx_in_3d.cpp, hdiv_divergence_operator.cpp, heat_equation.cpp, heat_method.cpp, hello_world.cpp, helmholtz.cpp, hertz_surface.cpp, higher_derivatives.cpp, HookeElement.hpp, HookeInternalStressElement.hpp, level_set.cpp, log.cpp, loop_entities.cpp, lorentz_force.cpp, MagneticElement.hpp, magnetostatic.cpp, mesh_cut.cpp, mesh_insert_interface_atom.cpp, mesh_smoothing.cpp, meshset_to_vtk.cpp, minimal_surface_area.cpp, mixed_poisson.cpp, mortar_contact.cpp, mortar_contact_thermal.cpp, navier_stokes.cpp, NavierStokesElement.hpp, node_merge.cpp, nonlinear_dynamics.cpp, nonlinear_elastic.cpp, operators_tests.cpp, partition_mesh.cpp, phase.cpp, photon_diffusion.cpp, plastic.cpp, plate.cpp, plot_base.cpp, poisson_2d_dis_galerkin.cpp, poisson_2d_homogeneous.cpp, prism_elements_from_surface.cpp, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, reaction_diffusion.cpp, Remodeling.cpp, Remodeling.hpp, remove_entities_from_problem.cpp, remove_entities_from_problem_not_partitioned.cpp, scalar_check_approximation.cpp, schur_test_diag_mat.cpp, seepage.cpp, shallow_wave.cpp, simple_contact.cpp, simple_contact_thermal.cpp, simple_elasticity.cpp, simple_interface.cpp, simple_l2_only.cpp, split_sideset.cpp, tensor_divergence_operator.cpp, test_broken_space.cpp, test_cache_on_entities.cpp, test_jacobian_of_simple_contact_element.cpp, testing_jacobian_of_hook_element.cpp, testing_jacobian_of_hook_scaled_with_density_element.cpp, thermo_elastic.cpp, unsaturated_transport.cpp, UnsaturatedFlow.hpp, wave_equation.cpp, and wavy_surface.cpp.

Definition at line 2010 of file Interface.hpp.

◆ j_FTIndex

template<int DIM>
using MoFEM::j_FTIndex = typedef FTensor::Index<'j', DIM>

Definition at line 1999 of file Templates.hpp.

◆ J_FTIndex

template<int DIM>
using MoFEM::J_FTIndex = typedef FTensor::Index<'J', DIM>

Definition at line 2005 of file Templates.hpp.

◆ k_FTIndex

template<int DIM>
using MoFEM::k_FTIndex = typedef FTensor::Index<'k', DIM>

Definition at line 2000 of file Templates.hpp.

◆ K_FTIndex

template<int DIM>
using MoFEM::K_FTIndex = typedef FTensor::Index<'K', DIM>

Definition at line 2006 of file Templates.hpp.

◆ l_FTIndex

template<int DIM>
using MoFEM::l_FTIndex = typedef FTensor::Index<'l', DIM>

Definition at line 2001 of file Templates.hpp.

◆ L_FTIndex

template<int DIM>
using MoFEM::L_FTIndex = typedef FTensor::Index<'L', DIM>

Definition at line 2007 of file Templates.hpp.

◆ m_FTIndex

template<int DIM>
using MoFEM::m_FTIndex = typedef FTensor::Index<'m', DIM>

Definition at line 2002 of file Templates.hpp.

◆ M_FTIndex

template<int DIM>
using MoFEM::M_FTIndex = typedef FTensor::Index<'M', DIM>

Definition at line 2008 of file Templates.hpp.

◆ n_FTIndex

template<int DIM>
using MoFEM::n_FTIndex = typedef FTensor::Index<'n', DIM>

Definition at line 2003 of file Templates.hpp.

◆ N_FTIndex

template<int DIM>
using MoFEM::N_FTIndex = typedef FTensor::Index<'N', DIM>

Definition at line 2009 of file Templates.hpp.

◆ NestSchurData

using MoFEM::NestSchurData = typedef std::tuple< std::array<SmartPetscObj<Mat>, 4>, std::array<boost::shared_ptr<BlockStructure>, 4>, boost::shared_ptr<BlockStructure>, std::pair<SmartPetscObj<IS>, SmartPetscObj<IS> > >

Definition at line 106 of file Schur.hpp.

◆ NumeredDofEntity_multiIndex_coeff_idx_ordered_non_unique

using MoFEM::NumeredDofEntity_multiIndex_coeff_idx_ordered_non_unique = typedef multi_index_container< boost::shared_ptr<NumeredDofEntity>, indexed_by<ordered_non_unique<const_mem_fun< NumeredDofEntity::interface_type_DofEntity, FieldCoefficientsNumber, &NumeredDofEntity::getDofCoeffIdx> >> >

Definition at line 521 of file DofsMultiIndices.hpp.

◆ NumeredDofEntity_multiIndex_idx_view_hashed

using MoFEM::NumeredDofEntity_multiIndex_idx_view_hashed = typedef multi_index_container< boost::shared_ptr<NumeredDofEntity>, indexed_by<hashed_unique<const_mem_fun<NumeredDofEntity, DofIdx, &NumeredDofEntity::getDofIdx> >> >

Definition at line 508 of file DofsMultiIndices.hpp.

◆ NumeredDofEntity_multiIndex_petsc_local_dof_view_ordered_non_unique

using MoFEM::NumeredDofEntity_multiIndex_petsc_local_dof_view_ordered_non_unique = typedef multi_index_container<boost::shared_ptr<NumeredDofEntity>, indexed_by<ordered_non_unique<const_mem_fun< NumeredDofEntity, DofIdx, &NumeredDofEntity::getPetscLocalDofIdx> >> >

Definition at line 514 of file DofsMultiIndices.hpp.

◆ NumeredDofEntity_multiIndex_uid_view_ordered

using MoFEM::NumeredDofEntity_multiIndex_uid_view_ordered = typedef multi_index_container<boost::shared_ptr<NumeredDofEntity>, indexed_by< ordered_unique<const_mem_fun< NumeredDofEntity::interface_type_DofEntity, UId, &NumeredDofEntity::getLocalUniqueId > > > >

Definition at line 503 of file DofsMultiIndices.hpp.

◆ OpCalculateHOJacForFace

◆ OpCalculateHOJacForFaceEmbeddedIn3DSpace

◆ OpCalculateHOJacVolume

◆ OpCalculateScalarFieldValuesDot

◆ OpCalculateScalarFieldValuesDotDot

Examples
wave_equation.cpp.

Definition at line 275 of file UserDataOperators.hpp.

◆ OpCalculateScalarValuesDot

Deprecated:
Name inconsistent with other operators

Definition at line 281 of file UserDataOperators.hpp.

◆ OpSetContrariantPiolaTransformOnEdge

Deprecated:
Name is deprecated and this is added for back compatibility

Definition at line 3100 of file UserDataOperators.hpp.

◆ OpSetContravariantPiolaTransformOnFace2D

◆ OpSetContravariantPiolaTransformOnFace2DEmbeddedIn3DSpace

Definition at line 3078 of file UserDataOperators.hpp.

◆ OpSetCovariantPiolaTransformOnFace2D

Definition at line 3028 of file UserDataOperators.hpp.

◆ OpSetInvJacHcurlFace

◆ OpSetInvJacHcurlFaceEmbeddedIn3DSpace

Definition at line 2979 of file UserDataOperators.hpp.

◆ PostProcBrokenMeshInMoabBaseBegin

Enable to run stack of post-processing elements. Use this to begin stack.

See scalar_check_approximation.cpp

Examples
EshelbianPlasticity.cpp.

Definition at line 934 of file PostProcBrokenMeshInMoabBase.hpp.

◆ PostProcBrokenMeshInMoabBaseCont

Enable to run stack of post-processing elements.

See scalar_check_approximation.cpp

Template Parameters
E

Definition at line 945 of file PostProcBrokenMeshInMoabBase.hpp.

◆ PostProcBrokenMeshInMoabBaseEnd

Enable to run stack of post-processing elements. Use this to end stack.

Examples
EshelbianPlasticity.cpp.

Definition at line 952 of file PostProcBrokenMeshInMoabBase.hpp.

◆ PostProcGenerateRefMeshPtr

Definition at line 54 of file PostProcBrokenMeshInMoabBase.hpp.

◆ RefElement_multiIndex_parents_view

typedef multi_index_container< boost::shared_ptr<RefElement>, indexed_by< ordered_unique<tag<Ent_mi_tag>, const_mem_fun<RefElement::interface_type_RefEntity, EntityHandle, &RefElement::getEnt> >, ordered_non_unique< tag<Ent_Ent_mi_tag>, const_mem_fun<RefElement::interface_type_RefEntity, EntityHandle, &RefElement::getParentEnt> >, ordered_non_unique< tag<Composite_ParentEnt_And_BitsOfRefinedEdges_mi_tag>, composite_key< RefElement, const_mem_fun<RefElement::interface_type_RefEntity, EntityHandle, &RefElement::getParentEnt>, const_mem_fun<RefElement, int, &RefElement::getBitRefEdgesUlong> > > > > MoFEM::RefElement_multiIndex_parents_view

Definition at line 30 of file MeshRefinement.cpp.

◆ RefEntity

using MoFEM::RefEntity = typedef RefEntityTmp<0>

Definition at line 566 of file RefEntsMultiIndices.hpp.

◆ RefEntity_multiIndex_view_by_ordered_parent_entity

using MoFEM::RefEntity_multiIndex_view_by_ordered_parent_entity = typedef multi_index_container< boost::shared_ptr<RefEntity>, indexed_by<ordered_non_unique<const_mem_fun<RefEntity, EntityHandle, &RefEntity::getParentEnt> >, hashed_unique< tag<Composite_EntType_and_ParentEntType_mi_tag>, composite_key<boost::shared_ptr<RefEntity>, const_mem_fun<RefEntity, EntityHandle, &RefEntity::getEnt>, const_mem_fun<RefEntity, EntityHandle, &RefEntity::getParentEnt> >> > >

Definition at line 792 of file RefEntsMultiIndices.hpp.

◆ RefEntity_multiIndex_view_sequence_ordered_view

using MoFEM::RefEntity_multiIndex_view_sequence_ordered_view = typedef multi_index_container< boost::shared_ptr<RefEntity>, indexed_by< sequenced<>, ordered_unique<tag<Ent_mi_tag>, const_mem_fun<RefEntity, EntityHandle, &RefEntity::getEnt> >> >

Definition at line 799 of file RefEntsMultiIndices.hpp.

◆ SchurFEOpsFEandFields

using MoFEM::SchurFEOpsFEandFields = typedef std::vector< std::pair<std::string, std::vector<SchurFieldPair> > >

Definition at line 73 of file Schur.hpp.

◆ SchurFieldPair

using MoFEM::SchurFieldPair = typedef std::pair<std::string, std::string>

Definition at line 67 of file Schur.hpp.

◆ SchurShellMatData

using MoFEM::SchurShellMatData = typedef std::pair<SmartPetscObj<Mat>, boost::shared_ptr<BlockStructure> >

Definition at line 88 of file Schur.hpp.

◆ Sev

◆ ShardVec

template<typename T >
using MoFEM::ShardVec = typedef boost::shared_ptr<std::vector<T> >

Definition at line 10 of file Templates.hpp.

◆ TimeFun

using MoFEM::TimeFun = typedef boost::function<double(double)>

Lambda function used to scale with time.

Definition at line 154 of file FormsIntegrators.hpp.

◆ TimeScaleVector2

Definition at line 127 of file ScalingMethod.hpp.

◆ TimeScaleVector3

Definition at line 126 of file ScalingMethod.hpp.

◆ VecOfTimeScalingMethods

using MoFEM::VecOfTimeScalingMethods = typedef std::vector<boost::shared_ptr<ScalingMethod> >

Vector of time scaling methods.

Definition at line 20 of file Natural.hpp.

◆ VecOfTimeVectorScalingMethods

template<int FIELD_DIM>
using MoFEM::VecOfTimeVectorScalingMethods = typedef std::vector<boost::shared_ptr<TimeScaleVector<FIELD_DIM> >>

Vector of time vector scaling methods.

Definition at line 28 of file Natural.hpp.

◆ VectorDofs

using MoFEM::VectorDofs = typedef ublas::vector<FEDofEntity *, DofsAllocator>

Definition at line 23 of file EntitiesFieldData.hpp.

◆ VectorFieldEntities

using MoFEM::VectorFieldEntities = typedef ublas::vector<FieldEntity *, FieldEntAllocator>

Definition at line 31 of file EntitiesFieldData.hpp.

◆ VectorFunc

typedef boost::function<VectorDouble(const double, const double, const double)> MoFEM::VectorFunc

Definition at line 98 of file NormsOperators.hpp.

Enumeration Type Documentation

◆ MPC

enum MoFEM::MPC
strong
Enumerator
TIE 
RIGID_BODY 
COUPLING 
EMBEDDED_REGION 
EQUATION 
LAST 

Definition at line 16 of file EssentialMPCsData.hpp.

Function Documentation

◆ addHOOpsFace3D()

template<typename E >
MoFEMErrorCode MoFEM::addHOOpsFace3D ( const std::string  field,
E e,
bool  hcurl,
bool  hdiv 
)
Deprecated:
do not use this function, instead use AddHOOps.
Template Parameters
E
Parameters
field
e
hcurl
hdiv
Returns
MoFEMErrorCode
Examples
elasticity.cpp, mortar_contact_thermal.cpp, nonlinear_dynamics.cpp, simple_contact.cpp, and simple_contact_thermal.cpp.

Definition at line 699 of file HODataOperators.hpp.

700  {
701  std::vector<FieldSpace> spaces;
702  if (hcurl)
703  spaces.push_back(HCURL);
704  if (hdiv)
705  spaces.push_back(HDIV);
706  return AddHOOps<2, 3, 3>::add(e.getOpPtrVector(), spaces, field);
707 }

◆ addHOOpsVol()

template<typename E >
MoFEMErrorCode MoFEM::addHOOpsVol ( const std::string  field,
E e,
bool  h1,
bool  hcurl,
bool  hdiv,
bool  l2 
)
Deprecated:
do not use this function, instead use AddHOOps.
Template Parameters
E
Parameters
field
e
h1
hcurl
hdiv
l2
Returns
MoFEMErrorCode
Examples
elasticity.cpp, HookeElement.cpp, MagneticElement.hpp, navier_stokes.cpp, nonlinear_dynamics.cpp, NonlinearElasticElementInterface.hpp, and Remodeling.cpp.

Definition at line 674 of file HODataOperators.hpp.

675  {
676  std::vector<FieldSpace> spaces;
677  if (h1)
678  spaces.push_back(H1);
679  if (hcurl)
680  spaces.push_back(HCURL);
681  if (hdiv)
682  spaces.push_back(HDIV);
683  if (l2)
684  spaces.push_back(L2);
685  return AddHOOps<3, 3, 3>::add(e.getOpPtrVector(), spaces, field);
686 }

◆ cmp_uid_hi()

static auto MoFEM::cmp_uid_hi ( const UId b,
const boost::weak_ptr< FieldEntity > &  a 
)
static

Definition at line 29 of file ForcesAndSourcesCore.cpp.

29  {
30  if (auto a_ptr = a.lock()) {
31  if (b < a_ptr->getLocalUniqueId())
32  return true;
33  else
34  return false;
35  } else {
36  return true;
37  }
38 }

◆ cmp_uid_lo()

static auto MoFEM::cmp_uid_lo ( const boost::weak_ptr< FieldEntity > &  a,
const UId b 
)
static

Definition at line 18 of file ForcesAndSourcesCore.cpp.

18  {
19  if (auto a_ptr = a.lock()) {
20  if (a_ptr->getLocalUniqueId() < b)
21  return true;
22  else
23  return false;
24  } else {
25  return false;
26  }
27 }

◆ computeEigenValuesSymmetric() [1/3]

template<int DIM, typename T1 , typename T2 , typename T3 >
MoFEMErrorCode MoFEM::computeEigenValuesSymmetric ( const FTensor::Tensor2_symmetric< T1, DIM > &  mat,
FTensor::Tensor1< T2, DIM > &  eig,
FTensor::Tensor2< T3, DIM, DIM > &  eigen_vec 
)
inline

compute eigenvalues of a symmetric tensor using lapack dsyev

Template Parameters
DIM
Parameters
matinput tensor pointer of size DIM x DIM
eigoutput eigen values sorted
eigen_vecoutput matrix of row eigen vectors
Returns
MoFEMErrorCode

Definition at line 1520 of file Templates.hpp.

1522  {
1524  for (int ii = 0; ii != DIM; ii++)
1525  for (int jj = 0; jj != DIM; jj++)
1526  eigen_vec(ii, jj) = mat(ii, jj);
1527 
1528  CHKERR computeEigenValuesSymmetric(eigen_vec, eig);
1529 
1531 }

◆ computeEigenValuesSymmetric() [2/3]

MoFEMErrorCode MoFEM::computeEigenValuesSymmetric ( const MatrixDouble mat,
VectorDouble eig,
MatrixDouble eigen_vec 
)
inline

compute eigenvalues of a symmetric matrix using lapack dsyev

Parameters
matinput symmetric matrix
eigoutput eigen values sorted
eigen_vecoutput matrix of row eigen vectors
Returns
MoFEMErrorCode
Examples
EshelbianOperators.cpp, and HenckyOps.hpp.

Definition at line 1452 of file Templates.hpp.

1454  {
1456 
1457  const size_t M = mat.size1();
1458  const size_t N = mat.size2();
1459 
1460  if (M == 0 || M != N)
1461  SETERRQ2(
1462  PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1463  "The input matrix for eigen value computation is not square %d != %d",
1464  M, N);
1465  if (eig.size() != M)
1466  eig.resize(M, false);
1467 
1468  eigen_vec = mat;
1469  const int n = M;
1470  const int lda = M;
1471  const int size = (M + 2) * M;
1472  int lwork = size;
1473  double *work = new double[size];
1474 
1475  if (lapack_dsyev('V', 'U', n, &*eigen_vec.data().begin(), lda,
1476  &*eig.data().begin(), work, lwork) > 0)
1477  SETERRQ(PETSC_COMM_SELF, MOFEM_INVALID_DATA,
1478  "The algorithm failed to compute eigenvalues.");
1479 
1480  delete[] work;
1482 }

◆ computeEigenValuesSymmetric() [3/3]

template<int DIM, typename T1 , typename T2 >
MoFEMErrorCode MoFEM::computeEigenValuesSymmetric ( FTensor::Tensor2< T1, DIM, DIM > &  eigen_vec,
FTensor::Tensor1< T2, DIM > &  eig 
)
inline

compute eigenvalues of a symmetric matrix using lapack dsyev

Template Parameters
DIM
Parameters
eigen_vecinput / output DIM x DIM matrix of row eigen vectors
eigoutput eigen values sorted
Returns
MoFEMErrorCode

Definition at line 1493 of file Templates.hpp.

1494  {
1496 
1497  const int n = DIM;
1498  const int lda = DIM;
1499  const int lwork = (DIM + 2) * DIM;
1500  std::array<double, (DIM + 2) * DIM> work;
1501 
1502  if (lapack_dsyev('V', 'U', n, &eigen_vec(0, 0), lda, &eig(0), work.data(),
1503  lwork) > 0)
1504  SETERRQ(PETSC_COMM_SELF, MOFEM_INVALID_DATA,
1505  "The algorithm failed to compute eigenvalues.");
1507 }

◆ computeMatrixInverse()

MoFEMErrorCode MoFEM::computeMatrixInverse ( MatrixDouble mat)
inline

compute matrix inverse with lapack dgetri

Parameters
matinput square matrix / output inverse matrix
Returns
MoFEMErrorCode

Definition at line 1365 of file Templates.hpp.

1365  {
1367 
1368  const size_t M = mat.size1();
1369  const size_t N = mat.size2();
1370 
1371  if (M != N)
1372  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1373  "The input matrix for inverse computation is not square %d != %d",
1374  M, N);
1375 
1376  int *ipv = new int[N];
1377  int lwork = N * N;
1378  double *work = new double[lwork];
1379  int info;
1380  info = lapack_dgetrf(N, N, &*mat.data().begin(), N, ipv);
1381  if (info != 0)
1382  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1383  "lapack error info = %d", info);
1384  info = lapack_dgetri(N, &*mat.data().begin(), N, ipv, work, lwork);
1385  if (info != 0)
1386  SETERRQ1(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
1387  "lapack error info = %d", info);
1388 
1389  delete[] ipv;
1390  delete[] work;
1391 
1393 }

◆ constructor_data()

static void MoFEM::constructor_data ( EntitiesFieldData data,
const EntityType  type 
)
static

Definition at line 42 of file EntitiesFieldData.cpp.

42  {
43 
45 
46  auto set_default = [&]() {
47  std::array<size_t, MBMAXTYPE> count;
48  std::fill(count.begin(), count.end(), 0);
49  const int dim_type = moab::CN::Dimension(type);
50  data->dataOnEntities[MBVERTEX].resize(1);
51  if (type != MBVERTEX) {
52  for (auto dd = dim_type; dd > 0; --dd) {
53  int nb_ents = moab::CN::NumSubEntities(type, dd);
54  for (int ii = 0; ii != nb_ents; ++ii) {
55  auto sub_ent_type = moab::CN::SubEntityType(type, dd, ii);
56  count[sub_ent_type] = nb_ents;
57  }
58  for (auto tt = moab::CN::TypeDimensionMap[dd].first;
59  tt <= moab::CN::TypeDimensionMap[dd].second; ++tt) {
60  data->dataOnEntities[tt].resize(count[tt]);
61  }
62  }
63  }
64  };
65 
66  switch (type) {
67  case MBENTITYSET:
68  break;
69 
70  default:
71  set_default();
72  }
73 }

◆ constructor_derived_data()

static void MoFEM::constructor_derived_data ( DerivedEntitiesFieldData derived_data,
const boost::shared_ptr< EntitiesFieldData > &  data_ptr 
)
static

Definition at line 86 of file EntitiesFieldData.cpp.

87  {
88 
90  using DerivedEntData = DerivedEntitiesFieldData::DerivedEntData;
91 
92  for (int tt = MBVERTEX; tt != MBMAXTYPE; ++tt) {
93  auto &ent_data = data_ptr->dataOnEntities[tt];
94  auto &derived_ent_data = derived_data->dataOnEntities[tt];
95  for (auto c = derived_ent_data.size(); c < ent_data.size(); ++c) {
96  boost::shared_ptr<EntData> ent_data_ptr(data_ptr, &ent_data[c]);
97  derived_ent_data.push_back(new DerivedEntData(ent_data_ptr));
98  }
99  derived_ent_data.resize(ent_data.size());
100  }
101 }

◆ createAOMapping()

auto MoFEM::createAOMapping ( MPI_Comm  comm,
PetscInt  napp,
const PetscInt  myapp[],
const PetscInt  mypetsc[] 
)
inline

Creates an application mapping using two integer arrays.

AOCreateMappingIS.

Parameters
commMPI communicator that is to share the AO
nappsize of integer arrays
myappinteger array that defines an ordering
mypetscinteger array that defines another ordering (may be NULL to indicate the identity ordering)
Returns
SmartPetscObj<AO>(ao);

Definition at line 338 of file PetscSmartObj.hpp.

339  {
340  AO ao;
341  CHK_THROW_MESSAGE(AOCreateMapping(comm, napp, myapp, mypetsc, &ao),
342  "create ao");
343  return SmartPetscObj<AO>(ao);
344 }

◆ createAOMappingIS()

auto MoFEM::createAOMappingIS ( IS  isapp,
IS  ispetsc 
)
inline

Creates an application mapping using two index sets.

AOCreateMappingIS.

Parameters
isappindex set that defines an ordering
ispetscindex set that defines another ordering, maybe NULL for identity
aooutthe new application ordering
Returns
SmartPetscObj<AO>(ao)
Examples
schur_test_diag_mat.cpp, and test_broken_space.cpp.

Definition at line 318 of file PetscSmartObj.hpp.

318  {
319  AO ao;
320  CHK_THROW_MESSAGE(AOCreateMappingIS(isapp, ispetsc, &ao),
321  "Failed to create AO");
322  return SmartPetscObj<AO>(ao);
323 };

◆ createBlockMat()

SchurShellMatData MoFEM::createBlockMat ( DM  dm,
boost::shared_ptr< BlockStructure data 
)

Create a Schur Mat object.

Parameters
dm
data
Returns
std::pair<SmartPetscObj<Mat>, boost::shared_ptr<BlockStructure>>
Examples
schur_test_diag_mat.cpp.

Definition at line 1379 of file Schur.cpp.

1380  {
1381 
1382  auto problem_ptr = getProblemPtr(dm);
1383  auto nb_local = problem_ptr->nbLocDofsRow;
1384  auto nb_global = problem_ptr->nbDofsRow;
1385 
1386  // check in nb, rows is equal to nb. columns.
1387  if (nb_local != problem_ptr->nbLocDofsCol) {
1388  MOFEM_LOG("SELF", Sev::error)
1389  << "Wrong size " << nb_local << " != " << problem_ptr->nbLocDofsCol;
1391  "nb. cols is inconsistent with nb. rows");
1392  }
1393  if (nb_global != problem_ptr->nbDofsCol) {
1394  MOFEM_LOG("SELF", Sev::error)
1395  << "Wrong size " << nb_global << " != " << problem_ptr->nbDofsCol;
1397  "nb. cols is inconsistent with nb. rows");
1398  }
1399 
1400  // get comm from DM
1401  MPI_Comm comm;
1402  CHKERR PetscObjectGetComm((PetscObject)dm, &comm);
1403 
1404  Mat mat_raw;
1405  CHKERR MatCreateShell(comm, nb_local, nb_local, nb_global, nb_global,
1406  (void *)data.get(), &mat_raw);
1407  CHKERR setSchurBlockMatOps(mat_raw);
1408  // CHKERR PetscObjectSetName((PetscObject)mat_raw, MoFEM_BLOCK_MAT);
1409 
1410  return std::make_pair(SmartPetscObj<Mat>(mat_raw), data);
1411 }

◆ createBlockMatStructure()

boost::shared_ptr< BlockStructure > MoFEM::createBlockMatStructure ( DM  dm,
SchurFEOpsFEandFields  schur_fe_op_vec 
)

Create a Mat Diag Blocks object.

Returns
Mat
Examples
plastic.cpp, schur_test_diag_mat.cpp, and test_broken_space.cpp.

Definition at line 1009 of file Schur.cpp.

1014  {
1015 
1016  auto cmp_uid_lo = [](const boost::weak_ptr<FieldEntity> &a, const UId &b) {
1017  if (auto a_ptr = a.lock()) {
1018  if (a_ptr->getLocalUniqueId() < b)
1019  return true;
1020  else
1021  return false;
1022  } else {
1023  return false;
1024  }
1025  };
1026 
1027  auto cmp_uid_hi = [](const UId &b, const boost::weak_ptr<FieldEntity> &a) {
1028  if (auto a_ptr = a.lock()) {
1029  if (b < a_ptr->getLocalUniqueId())
1030  return true;
1031  else
1032  return false;
1033  } else {
1034  return true;
1035  }
1036  };
1037 
1038  // get uids for fields
1039  auto get_uid_pair = [](const auto &field_id) {
1040  auto lo_uid = FieldEntity::getLocalUniqueIdCalculate(
1041  field_id, get_id_for_min_type<MBVERTEX>());
1042  auto hi_uid = FieldEntity::getLocalUniqueIdCalculate(
1043  field_id, get_id_for_max_type<MBENTITYSET>());
1044  return std::make_pair(lo_uid, hi_uid);
1045  };
1046 
1047  // get uids pair
1048  auto get_it_pair = [cmp_uid_lo, cmp_uid_hi](auto &&field_ents, auto &&p_uid) {
1049  auto lo = std::lower_bound(field_ents.begin(), field_ents.end(),
1050  p_uid.first, cmp_uid_lo);
1051  auto hi = std::upper_bound(field_ents.begin(), field_ents.end(),
1052  p_uid.second, cmp_uid_hi);
1053  return std::make_pair(lo, hi);
1054  };
1055 
1056  // extract DOFs for rows/columns. DOFs are associated with fields entities
1057  // for given problem.
1058  auto row_extractor = [](auto &e) { return e->entityCacheRowDofs; };
1059  auto col_extractor = [](auto &e) { return e->entityCacheColDofs; };
1060 
1061  auto extract_data = [](auto &&its, auto extractor) {
1062  std::vector<std::tuple<UId, int, int, int>> data;
1063  data.reserve(std::distance(its.first, its.second));
1064  // iterate field dofs
1065  for (; its.first != its.second; ++its.first) {
1066  if (auto e = its.first->lock()) {
1067  if (auto cache = extractor(e).lock()) {
1068  int nb_dofs = 0;
1069  for (auto dof = cache->loHi[0]; dof != cache->loHi[1]; ++dof) {
1070  if ((*dof)->getPetscGlobalDofIdx() != -1)
1071  ++nb_dofs;
1072  }
1073  auto uid = e->getLocalUniqueId();
1074  if (nb_dofs) {
1075 
1076  auto glob = (*cache->loHi[0])->getPetscGlobalDofIdx();
1077  auto loc = (*cache->loHi[0])->getPetscLocalDofIdx();
1078  while (glob == -1 && cache->loHi[0] != cache->loHi[1]) {
1079  ++cache->loHi[0];
1080  glob = (*cache->loHi[0])->getPetscGlobalDofIdx();
1081  loc = (*cache->loHi[0])->getPetscLocalDofIdx();
1082  }
1083  data.emplace_back(uid, glob, nb_dofs, loc);
1084 
1085 #ifndef NDEBUG
1086 
1087  for (auto lo = cache->loHi[0]; lo != cache->loHi[1]; ++lo) {
1088  auto glob = (*lo)->getPetscGlobalDofIdx();
1089  if (glob == -1) {
1091  "Wrong global index");
1092  }
1093  }
1094 
1095 #endif
1096  } else {
1097  data.emplace_back(uid, -1, 0, -1);
1098  }
1099  }
1100  }
1101  }
1102  return data;
1103  };
1104 
1105  auto data_ptr = boost::make_shared<BlockStructure>();
1106  auto m_field_ptr = getInterfacePtr(dm);
1107 
1108  // create element to extract data
1109  auto fe_method = boost::shared_ptr<MoFEM::FEMethod>(new MoFEM::FEMethod());
1110 
1111  for (auto &d : schur_fe_op_vec) {
1112 
1113  // extract bit numbers for row and column
1114  auto get_bit_numbers = [&d](auto op) {
1115  std::vector<FieldBitNumber> bit_numbers(d.second.size());
1116  std::transform(d.second.begin(), d.second.end(), bit_numbers.begin(), op);
1117  return bit_numbers;
1118  };
1119 
1120  // extract bit numbers for row
1121  auto row_bit_numbers = get_bit_numbers(
1122  [&](auto &p) { return m_field_ptr->get_field_bit_number(p.first); });
1123  // extract bit numbers for row
1124  auto col_bit_numbers = get_bit_numbers(
1125  [&](auto &p) { return m_field_ptr->get_field_bit_number(p.second); });
1126 
1127  fe_method->preProcessHook = []() { return 0; };
1128  fe_method->postProcessHook = []() { return 0; };
1129  fe_method->operatorHook = [&]() {
1131 
1132  auto fe_uid = fe_method->numeredEntFiniteElementPtr->getLocalUniqueId();
1133 
1134  for (auto f = 0; f != row_bit_numbers.size(); ++f) {
1135 
1136  auto row_data =
1137  extract_data(get_it_pair(fe_method->getRowFieldEnts(),
1138  get_uid_pair(row_bit_numbers[f])),
1139  row_extractor);
1140  auto col_data =
1141  extract_data(get_it_pair(fe_method->getColFieldEnts(),
1142  get_uid_pair(col_bit_numbers[f])),
1143  col_extractor);
1144 
1145  for (auto &r : row_data) {
1146  auto [r_uid, r_glob, r_nb_dofs, r_loc] = r;
1147  for (auto &c : col_data) {
1148  auto [c_uid, c_glob, c_nb_dofs, c_loc] = c;
1149  data_ptr->blockIndex.insert(BlockStructure::Indexes{
1150  r_uid, c_uid, fe_uid, r_glob, c_glob, r_nb_dofs, c_nb_dofs,
1151  r_loc, c_loc, -1});
1152  }
1153  }
1154  }
1155 
1157  };
1158 
1159  CHKERR DMoFEMLoopFiniteElementsUpAndLowRank(dm, d.first, fe_method, 0,
1160  m_field_ptr->get_comm_size());
1161  };
1162 
1163  // order by column (that is for matrix multiplication)
1164  auto mem_size = 0;
1165  for (auto &v : data_ptr->blockIndex.get<0>()) {
1166  v.getMatShift() = mem_size;
1167  mem_size += v.getNbCols() * v.getNbRows();
1168  }
1169 
1170  std::vector<double> tmp;
1171  if (mem_size > tmp.max_size())
1173 
1174  data_ptr->dataBlocksPtr =
1175  boost::make_shared<std::vector<double>>(mem_size, 0);
1176 
1177  auto ghost_x = createDMVector(dm);
1178  auto ghost_y = createDMVector(dm);
1179  CHKERR VecSetDM(ghost_x, PETSC_NULL);
1180  CHKERR VecSetDM(ghost_y, PETSC_NULL);
1181 
1182  data_ptr->ghostX = ghost_x;
1183  data_ptr->ghostY = ghost_y;
1184 
1185  return data_ptr;
1186 }

◆ createDM()

auto MoFEM::createDM ( MPI_Comm  comm,
const std::string  dm_type_name 
)
inline

Creates smart DM object.

DM object can be used as any other object, but is destroyed as smart pointer when no longer used.

{
auto dm = createDM(PETSC_COMM_WORLD, "MOFEM");
// ...
// dm is automatically destroyed when program goes out of the scope
}
Examples
elasticity.cpp, EshelbianPlasticity.cpp, free_surface.cpp, level_set.cpp, plastic.cpp, schur_test_diag_mat.cpp, and test_broken_space.cpp.

Definition at line 141 of file PetscSmartObj.hpp.

141  {
142  DM dm;
143  CHK_THROW_MESSAGE(DMCreate(comm, &dm), "Failed to create DM");
144  CHK_THROW_MESSAGE(DMSetType(dm, dm_type_name.c_str()), "Failed set DM type");
145  return SmartPetscObj<DM>(dm);
146 };

◆ createDMBlockMat()

auto MoFEM::createDMBlockMat ( DM  dm)
inline
Examples
plastic.cpp, and test_broken_space.cpp.

Definition at line 1076 of file DMMoFEM.hpp.

1076  {
1077  Mat raw_a;
1078  ierr = DMMoFEMCreateBlockMat(dm, &raw_a);
1079  CHKERRABORT(getCommFromPetscObject(reinterpret_cast<PetscObject>(dm)), ierr);
1080  return SmartPetscObj<Mat>(raw_a);
1081 };

◆ createDMHybridisedL2Matrix()

auto MoFEM::createDMHybridisedL2Matrix ( DM  dm)
inline

Get smart hybridised L2 matrix from DM.

Parameters
dm
Returns
auto
Examples
test_broken_space.cpp.

Definition at line 1069 of file DMMoFEM.hpp.

1069  {
1070  SmartPetscObj<Mat> a;
1072  CHKERRABORT(getCommFromPetscObject(reinterpret_cast<PetscObject>(dm)), ierr);
1073  return a;
1074 };

◆ createDMNestSchurMat()

auto MoFEM::createDMNestSchurMat ( DM  dm)
inline
Examples
plastic.cpp, and test_broken_space.cpp.

Definition at line 1083 of file DMMoFEM.hpp.

1083  {
1084  Mat raw_a;
1085  ierr = DMMoFEMCreateNestSchurMat(dm, &raw_a);
1086  CHKERRABORT(getCommFromPetscObject(reinterpret_cast<PetscObject>(dm)), ierr);
1087  return SmartPetscObj<Mat>(raw_a);
1088 };

◆ createGhostVector()

auto MoFEM::createGhostVector ( MPI_Comm  comm,
PetscInt  n,
PetscInt  N,
PetscInt  nghost,
const PetscInt  ghosts[] 
)
inline

Create smart ghost vector.

For details abut arguments see here: VecCreateGhost.

auto vec = createGhostVector(...);
Examples
ContactOps.hpp, mixed_poisson.cpp, photon_diffusion.cpp, and simple_interface.cpp.

Definition at line 179 of file PetscSmartObj.hpp.

180  {
181  Vec vv;
182  CHK_THROW_MESSAGE(VecCreateGhost(comm, n, N, nghost, ghosts, &vv),
183  "Failed to create ghosted Vec");
184  return SmartPetscObj<Vec>(vv);
185 };

◆ createISGeneral()

auto MoFEM::createISGeneral ( MPI_Comm  comm,
PetscInt  n,
const PetscInt  idx[],
PetscCopyMode  mode 
)
inline

Creates a data structure for an index set containing a list of integers.

AOCreateMappingIS.

Parameters
commthe MPI communicator
nthe length of the index set
idxthe list of integers
modePETSC_COPY_VALUES, PETSC_OWN_POINTER, or PETSC_USE_POINTER; see PetscCopyMode for meaning of this flag.
Returns
SmartPetscObj<IS>(is)

Definition at line 287 of file PetscSmartObj.hpp.

288  {
289  IS is;
290  CHK_THROW_MESSAGE(ISCreateGeneral(comm, n, idx, mode, &is), "Create IS");
291  return SmartPetscObj<IS>(is);
292 }

◆ createISLocalToGlobalMapping()

auto MoFEM::createISLocalToGlobalMapping ( IS  is)
inline

Definition at line 383 of file PetscSmartObj.hpp.

383  {
384  ISLocalToGlobalMapping map_raw;
385  CHK_THROW_MESSAGE(ISLocalToGlobalMappingCreateIS(is, &map_raw),
386  "create local to global mapping");
387  return SmartPetscObj<ISLocalToGlobalMapping>(map_raw);
388 }

◆ createKSP()

auto MoFEM::createKSP ( MPI_Comm  comm)
inline
Examples
dynamic_first_order_con_law.cpp, elasticity.cpp, free_surface.cpp, level_set.cpp, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, reaction_diffusion.cpp, and schur_test_diag_mat.cpp.

Definition at line 261 of file PetscSmartObj.hpp.

261  {
262  KSP ksp;
263  CHK_THROW_MESSAGE(KSPCreate(comm, &ksp), "Failed to create KSP");
264  return SmartPetscObj<KSP>(ksp);
265 };

◆ createOpSchurAssembleBegin()

OpSchurAssembleBase * MoFEM::createOpSchurAssembleBegin ( )
Examples
plastic.cpp, scalar_check_approximation.cpp, schur_test_diag_mat.cpp, and test_broken_space.cpp.

Definition at line 2181 of file Schur.cpp.

2181  {
2182  return new OpSchurAssembleBegin();
2183 }

◆ createOpSchurAssembleEnd() [1/3]

OpSchurAssembleBase * MoFEM::createOpSchurAssembleEnd ( std::vector< std::string >  fields_name,
std::vector< boost::shared_ptr< Range >>  field_ents,
SmartPetscObj< AO >  ao = SmartPetscObj< AO >(),
SmartPetscObj< Mat >  schur = SmartPetscObj< Mat >(),
bool  sym_schur = false,
bool  symm_op = false 
)

Construct a new Op Schur Assemble End object.

Parameters
fields_namelist of fields (can be empty)
field_entslist of entities on which schur complement is applied
schur_aosmaps dofs indices from main problem to schur complement
schur_matschur matrix
sym_schurtrue if schur (matrix) complement is symmetric
symm_optrue if block diagonal is symmetric
Examples
plastic.cpp, scalar_check_approximation.cpp, schur_test_diag_mat.cpp, and test_broken_space.cpp.

Definition at line 2186 of file Schur.cpp.

2189  {
2190  if (symm_op)
2191  return new OpSchurAssembleEnd<SchurDSYSV>(fields_name, field_ents, ao,
2192  schur, sym_schur, symm_op);
2193  else
2194  return new OpSchurAssembleEnd<SchurDGESV>(fields_name, field_ents, ao,
2195  schur, sym_schur, symm_op);
2196 }

◆ createOpSchurAssembleEnd() [2/3]

DEPRECATED OpSchurAssembleBase * MoFEM::createOpSchurAssembleEnd ( std::vector< std::string >  fields_name,
std::vector< boost::shared_ptr< Range >>  field_ents,
std::vector< SmartPetscObj< AO >>  sequence_of_aos,
std::vector< SmartPetscObj< Mat >>  sequence_of_mats,
std::vector< bool sym_schur,
bool  symm_op,
boost::shared_ptr< BlockStructure diag_blocks = nullptr 
)
Deprecated:
do not use

Definition at line 2199 of file Schur.cpp.

2204  {
2205  return createOpSchurAssembleEnd(
2206  fields_name, field_ents, sequence_of_aos.back(), sequence_of_mats.back(),
2207  sym_schur.back(), symm_op);
2208 }

◆ createOpSchurAssembleEnd() [3/3]

DEPRECATED OpSchurAssembleBase * MoFEM::createOpSchurAssembleEnd ( std::vector< std::string >  fields_name,
std::vector< boost::shared_ptr< Range >>  field_ents,
std::vector< SmartPetscObj< AO >>  sequence_of_aos,
std::vector< SmartPetscObj< Mat >>  sequence_of_mats,
std::vector< bool sym_schur,
std::vector< double diag_eps,
bool  symm_op,
boost::shared_ptr< BlockStructure diag_blocks = nullptr 
)
Deprecated:
do not use

Definition at line 2211 of file Schur.cpp.

2217  {
2218  return createOpSchurAssembleEnd(
2219  fields_name, field_ents, sequence_of_aos.back(), sequence_of_mats.back(),
2220  sym_schur.back(), symm_op);
2221 }

◆ createPC()

auto MoFEM::createPC ( MPI_Comm  comm)
inline
Examples
free_surface.cpp.

Definition at line 267 of file PetscSmartObj.hpp.

267  {
268  PC pc;
269  CHK_THROW_MESSAGE(PCCreate(comm, &pc), "Failed to create PC");
270  return SmartPetscObj<PC>(pc);
271 };

◆ createPCMGSetUpViaApproxOrdersCtx()

boost::shared_ptr< PCMGSetUpViaApproxOrdersCtx > MoFEM::createPCMGSetUpViaApproxOrdersCtx ( DM  dm,
Mat  A,
bool  use_shell_mat 
)

createPCMGSetUpViaApproxOrdersCtx

Parameters
dm
A
use_shell_mat
Returns
PCMGSetUpViaApproxOrdersCtx
Examples
elasticity.cpp, and test_broken_space.cpp.

Definition at line 630 of file PCMGSetUpViaApproxOrders.cpp.

630  {
631  return boost::make_shared<PCMGSetUpViaApproxOrdersCtx>(dm, A, use_shell_mat);
632 }

◆ createSchurNestedMatrix()

std::pair< SmartPetscObj< Mat >, boost::shared_ptr< NestSchurData > > MoFEM::createSchurNestedMatrix ( boost::shared_ptr< NestSchurData schur_net_data_ptr)

Create a Mat Diag Blocks object.

auto [nested_mat, nested_data_ptr] = createSchurNestedMatrix(
{schur_dm, block_dm}, shell_data,
{"TENSOR"}, {nullptr}
)
);
Returns
Mat
Examples
schur_test_diag_mat.cpp.

Definition at line 2153 of file Schur.cpp.

2153  {
2154 
2155  if (!schur_net_data_ptr)
2157 
2158  auto [mat_arrays, data_ptrs, block_mat_data_ptr, iss] = *schur_net_data_ptr;
2159  auto [schur_is, block_is] = iss;
2160 
2161  std::array<IS, 2> is_a = {schur_is, block_is};
2162  std::array<Mat, 4> mats_a = {
2163 
2164  mat_arrays[0], mat_arrays[1], mat_arrays[2], mat_arrays[3]
2165 
2166  };
2167 
2168  MPI_Comm comm;
2169  CHKERR PetscObjectGetComm((PetscObject)mat_arrays[0], &comm);
2170 
2171  Mat mat_raw;
2172  CHKERR MatCreateNest(
2173 
2174  comm, 2, is_a.data(), 2, is_a.data(), mats_a.data(), &mat_raw
2175 
2176  );
2177 
2178  return std::make_pair(SmartPetscObj<Mat>(mat_raw), schur_net_data_ptr);
2179 }

◆ createSchurNestedMatrixStruture()

boost::shared_ptr< NestSchurData > MoFEM::createSchurNestedMatrixStruture ( std::pair< SmartPetscObj< DM >, SmartPetscObj< DM >>  dms,
boost::shared_ptr< BlockStructure block_mat_data,
std::vector< std::string >  fields_name,
std::vector< boost::shared_ptr< Range >>  field_ents,
bool  add_preconditioner_block = false 
)

Get the Schur Nest Mat Array object.

Parameters
dmsschur dm, and block dm
blockmat A data
fields_namelist of fields
field_entslist of entities on which schur complement is applied
add_preconditioner_blockadd block for preconditioner
Returns
boost::shared_ptr<NestSchurData>
Examples
plastic.cpp, schur_test_diag_mat.cpp, and test_broken_space.cpp.

Definition at line 1944 of file Schur.cpp.

1952  {
1953 
1954  if (!block_mat_data_ptr) {
1955  CHK_THROW_MESSAGE(MOFEM_DATA_INCONSISTENCY, "Block data not set");
1956  }
1957 
1958  if (fields_names.size() != field_ents.size())
1960  "fields_names.size() != field_ents.size()");
1961 
1962  auto [schur_dm, block_dm] = dms;
1963  auto schur_prb = getProblemPtr(schur_dm);
1964  auto block_prb = getProblemPtr(block_dm);
1965  // auto m_field_ptr = getInterfacePtr(block_dm);
1966 
1967  auto schur_dofs_row = schur_prb->getNumeredRowDofsPtr();
1968  auto schur_dofs_col = schur_prb->getNumeredColDofsPtr();
1969  auto block_dofs_row = block_prb->getNumeredRowDofsPtr();
1970  auto block_dofs_col = block_prb->getNumeredColDofsPtr();
1971 
1972  auto ao_schur_row = schur_prb->getSubData()->getSmartRowMap();
1973  auto ao_schur_col = schur_prb->getSubData()->getSmartColMap();
1974  auto ao_block_row = block_prb->getSubData()->getSmartRowMap();
1975  auto ao_block_col = block_prb->getSubData()->getSmartColMap();
1976 
1977  auto schur_vec_x = createDMVector(schur_dm);
1978  auto block_vec_x = createDMVector(block_dm);
1979  auto schur_vec_y = vectorDuplicate(schur_vec_x);
1980  auto block_vec_y = vectorDuplicate(block_vec_x);
1981  CHKERR VecSetDM(schur_vec_x, PETSC_NULL);
1982  CHKERR VecSetDM(block_vec_x, PETSC_NULL);
1983  CHKERR VecSetDM(schur_vec_y, PETSC_NULL);
1984  CHKERR VecSetDM(block_vec_y, PETSC_NULL);
1985 
1986  auto find_field_ent = [&](auto uid, auto prb, auto rc) {
1987  boost::shared_ptr<NumeredDofEntity_multiIndex> dofs;
1988 
1989  switch (rc) {
1990  case ROW:
1991  dofs = prb->getNumeredRowDofsPtr();
1992  break;
1993  case COL:
1994  dofs = prb->getNumeredColDofsPtr();
1995  break;
1996  default:
1997  CHK_MOAB_THROW(MOFEM_NOT_IMPLEMENTED, "Wrong RowCol");
1998  break;
1999  }
2000 
2001  auto lo = dofs->get<Unique_mi_tag>().lower_bound(uid);
2002  if (lo == dofs->get<Unique_mi_tag>().end())
2003  return boost::shared_ptr<NumeredDofEntity>();
2004  auto hi = dofs->get<Unique_mi_tag>().upper_bound(
2005  DofEntity::getUniqueIdCalculate(MAX_DOFS_ON_ENTITY - 1, uid));
2006  if (lo != hi)
2007  return *lo;
2008 
2009  return boost::shared_ptr<NumeredDofEntity>();
2010  };
2011 
2012  std::array<boost::shared_ptr<BlockStructure>, 4> data_ptrs;
2013 
2014  for (auto r = 0; r != 3; ++r) {
2015  data_ptrs[r] = boost::make_shared<BlockStructure>();
2016  data_ptrs[r]->dataBlocksPtr = block_mat_data_ptr->dataBlocksPtr;
2017  }
2018  data_ptrs[3] = boost::make_shared<BlockStructure>();
2019  data_ptrs[3]->dataBlocksPtr = block_mat_data_ptr->dataBlocksPtr;
2020 
2021  data_ptrs[0]->ghostX = schur_vec_x;
2022  data_ptrs[0]->ghostY = schur_vec_y;
2023  data_ptrs[1]->ghostX = block_vec_x;
2024  data_ptrs[1]->ghostY = schur_vec_y;
2025  data_ptrs[2]->ghostX = schur_vec_x;
2026  data_ptrs[2]->ghostY = block_vec_y;
2027  data_ptrs[3]->ghostX = block_vec_x;
2028  data_ptrs[3]->ghostY = block_vec_y;
2029 
2030  int idx = 0;
2031  for (auto &d : block_mat_data_ptr->blockIndex.get<0>()) {
2032 
2033  auto insert = [&](auto &m, auto &dof_r, auto &dof_c, auto &d) {
2034  m.insert(
2035 
2036  BlockStructure::Indexes{
2037  d.getRowUId(), d.getColUId(), d.getFEUId(),
2038 
2039  dof_r->getPetscGlobalDofIdx(), dof_c->getPetscGlobalDofIdx(),
2040 
2041  d.getNbRows(), d.getNbCols(),
2042 
2043  dof_r->getPetscLocalDofIdx(), dof_c->getPetscLocalDofIdx(),
2044 
2045  d.getMatShift()}
2046 
2047  );
2048  };
2049 
2050  auto dof_schur_row = find_field_ent(d.getRowUId(), schur_prb, ROW);
2051  auto dof_schur_col = find_field_ent(d.getColUId(), schur_prb, COL);
2052  auto dof_block_row = find_field_ent(d.getRowUId(), block_prb, ROW);
2053  auto dof_block_col = find_field_ent(d.getColUId(), block_prb, COL);
2054 
2055  if (dof_schur_row && dof_schur_col) {
2056  insert(data_ptrs[0]->blockIndex, dof_schur_row, dof_schur_col, d);
2057  }
2058 
2059  if (dof_schur_row && dof_block_col) {
2060  insert(data_ptrs[1]->blockIndex, dof_schur_row, dof_block_col, d);
2061  }
2062 
2063  if (dof_block_row && dof_schur_col) {
2064  insert(data_ptrs[2]->blockIndex, dof_block_row, dof_schur_col, d);
2065  }
2066 
2067  if (dof_block_row && dof_block_col) {
2068  insert(data_ptrs[3]->blockIndex, dof_block_row, dof_block_col, d);
2069  }
2070 
2071  ++idx;
2072  }
2073 
2074  // set data for a00 solve (inverse blocks)
2075  auto set_up_a00_data = [&](auto inv_block_data) {
2077 
2078  if (add_preconditioner_block) {
2079  auto preconditioned_block = boost::make_shared<std::vector<double>>(
2080  inv_block_data->dataBlocksPtr->size(), 0);
2081  inv_block_data->preconditionerBlocksPtr = preconditioned_block;
2082  inv_block_data->multiplyByPreconditioner = true;
2083  block_mat_data_ptr->preconditionerBlocksPtr =
2084  inv_block_data->preconditionerBlocksPtr;
2085  block_mat_data_ptr->multiplyByPreconditioner = false;
2086  }
2087 
2089  };
2090 
2091  CHKERR set_up_a00_data(data_ptrs[3]);
2092 
2093  MPI_Comm comm;
2094  CHKERR PetscObjectGetComm((PetscObject)schur_dm, &comm);
2095 
2096  auto create_shell_mat = [&](auto nb_r_loc, auto nb_c_loc, auto nb_r_glob,
2097  auto nb_c_glob, auto data_ptr) {
2098  Mat mat_raw;
2099  CHKERR MatCreateShell(comm, nb_r_loc, nb_c_loc, nb_r_glob, nb_c_glob,
2100  (void *)data_ptr.get(), &mat_raw);
2101  CHKERR setSchurBlockMatOps(mat_raw);
2102  return SmartPetscObj<Mat>(mat_raw);
2103  };
2104 
2105  auto schur_nb_global = schur_prb->getNbDofsRow();
2106  auto block_nb_global = block_prb->getNbDofsRow();
2107  auto schur_nb_local = schur_prb->getNbLocalDofsRow();
2108  auto block_nb_local = block_prb->getNbLocalDofsRow();
2109 
2110  std::array<SmartPetscObj<Mat>, 4> mats_array;
2111  mats_array[0] =
2112  create_shell_mat(schur_nb_local, schur_nb_local, schur_nb_global,
2113  schur_nb_global, data_ptrs[0]);
2114  mats_array[1] =
2115  create_shell_mat(schur_nb_local, block_nb_local, schur_nb_global,
2116  block_nb_global, data_ptrs[1]);
2117  mats_array[2] =
2118  create_shell_mat(block_nb_local, schur_nb_local, block_nb_global,
2119  schur_nb_global, data_ptrs[2]);
2120  mats_array[3] =
2121  create_shell_mat(block_nb_local, block_nb_local, block_nb_global,
2122  block_nb_global, data_ptrs[3]);
2123 
2124  MOFEM_TAG_AND_LOG("SYNC", Sev::verbose, "NestedSchur")
2125  << "(0, 0) " << schur_nb_local << " " << schur_nb_global << " "
2126  << data_ptrs[0]->blockIndex.size();
2127  MOFEM_TAG_AND_LOG("SYNC", Sev::verbose, "NestedSchur")
2128  << "(0, 1) " << schur_nb_local << " " << block_nb_local << " "
2129  << schur_nb_global << " " << block_nb_global << " "
2130  << data_ptrs[1]->blockIndex.size();
2131  MOFEM_TAG_AND_LOG("SYNC", Sev::verbose, "NestedSchur")
2132  << "(1, 0) " << block_nb_local << " " << schur_nb_local << " "
2133  << block_nb_global << " " << schur_nb_global << " "
2134  << data_ptrs[2]->blockIndex.size();
2135  MOFEM_TAG_AND_LOG("SYNC", Sev::verbose, "NestedSchur")
2136  << "(1, 1) " << block_nb_local << " " << block_nb_global << " "
2137  << data_ptrs[3]->blockIndex.size();
2138 
2139  MOFEM_LOG_SEVERITY_SYNC(comm, Sev::verbose);
2140 
2141  auto schur_is = schur_prb->getSubData()->getSmartRowIs();
2142  auto block_is = block_prb->getSubData()->getSmartRowIs();
2143 
2144  return boost::make_shared<NestSchurData>(
2145 
2146  mats_array, data_ptrs, block_mat_data_ptr,
2147  std::make_pair(schur_is, block_is)
2148 
2149  );
2150 }

◆ createSmartDM()

DEPRECATED auto MoFEM::createSmartDM ( MPI_Comm  comm,
const std::string  dm_type_name 
)
inline
Deprecated:
use createDM
Examples
mortar_contact.cpp, mortar_contact_thermal.cpp, simple_contact.cpp, simple_contact_thermal.cpp, and test_jacobian_of_simple_contact_element.cpp.

Definition at line 149 of file PetscSmartObj.hpp.

150  {
151  return createDM(comm, dm_type_name);
152 }

◆ createSmartGhostVector()

DEPRECATED auto MoFEM::createSmartGhostVector ( MPI_Comm  comm,
PetscInt  n,
PetscInt  N,
PetscInt  nghost,
const PetscInt  ghosts[] 
)
inline
Deprecated:
use createGhostVector

Definition at line 188 of file PetscSmartObj.hpp.

190  {
191  return createGhostVector(comm, n, N, nghost, ghosts);
192 }

◆ createSmartVectorMPI()

DEPRECATED auto MoFEM::createSmartVectorMPI ( MPI_Comm  comm,
PetscInt  n,
PetscInt  N 
)
inline
Deprecated:
use createVectorMPI

Definition at line 209 of file PetscSmartObj.hpp.

210  {
211  return createVectorMPI(comm, n, N);
212 }

◆ createSNES()

auto MoFEM::createSNES ( MPI_Comm  comm)
inline
Examples
mortar_contact.cpp, mortar_contact_thermal.cpp, simple_contact.cpp, simple_contact_thermal.cpp, and test_jacobian_of_simple_contact_element.cpp.

Definition at line 255 of file PetscSmartObj.hpp.

255  {
256  SNES snes;
257  CHK_THROW_MESSAGE(SNESCreate(comm, &snes), "Failed to create SNES");
258  return SmartPetscObj<SNES>(snes);
259 };

◆ createTS()

auto MoFEM::createTS ( MPI_Comm  comm)
inline
Examples
ep.cpp, free_surface.cpp, and reaction_diffusion.cpp.

Definition at line 249 of file PetscSmartObj.hpp.

249  {
250  TS ts;
251  CHK_THROW_MESSAGE(TSCreate(comm, &ts), "Failed to create TS");
252  return SmartPetscObj<TS>(ts);
253 };

◆ createVecScatter()

auto MoFEM::createVecScatter ( Vec  x,
IS  ix,
Vec  y,
IS  iy 
)
inline

Create a Vec Scatter object.

VecScatterCreate.

Parameters
xa vector that defines the shape (parallel data layout of the vector) of vectors from which we scatter
ixthe indices of xin to scatter (if NULL scatters all values)
ya vector that defines the shape (parallel data layout of the vector) of vectors to which we scatter
iythe indices of yin to hold results (if NULL fills entire vector yin in order)
Returns
Examples
free_surface.cpp.

Definition at line 361 of file PetscSmartObj.hpp.

361  {
362  VecScatter s;
363  CHK_THROW_MESSAGE(VecScatterCreate(x, ix, y, iy, &s), "create scatter");
364  return SmartPetscObj<VecScatter>(s);
365 }

◆ createVectorMPI()

auto MoFEM::createVectorMPI ( MPI_Comm  comm,
PetscInt  n,
PetscInt  N 
)
inline

Create MPI Vector.

For details abut arguments see here: VecCreateMPI.

Examples
adolc_plasticity.cpp, approx_sphere.cpp, child_and_parent.cpp, EshelbianPlasticity.cpp, hanging_node_approx.cpp, higher_derivatives.cpp, HookeElement.cpp, level_set.cpp, NavierStokesElement.hpp, poisson_2d_dis_galerkin.cpp, poisson_2d_homogeneous.cpp, test_broken_space.cpp, and thermo_elastic.cpp.

Definition at line 202 of file PetscSmartObj.hpp.

202  {
203  Vec vv;
204  CHK_THROW_MESSAGE(VecCreateMPI(comm, n, N, &vv), "Failed to create Vec");
205  return SmartPetscObj<Vec>(vv);
206 };

◆ determinantTensor() [1/2]

template<typename T , int DIM>
static auto MoFEM::determinantTensor ( FTensor::Tensor2< T, DIM, DIM > &  t)
inlinestatic

Calculate the determinant of a tensor of rank DIM.

Examples
ContactOps.hpp.

Definition at line 1571 of file Templates.hpp.

1571  {
1572  return DeterminantTensorImpl<FTensor::Tensor2<T, DIM, DIM>, DIM>::get(t);
1573 }

◆ determinantTensor() [2/2]

template<typename T , int DIM>
static auto MoFEM::determinantTensor ( FTensor::Tensor2_symmetric< T, DIM > &  t)
inlinestatic

Calculate the determinant of a tensor of rank DIM.

Definition at line 1579 of file Templates.hpp.

1579  {
1580  return DeterminantTensorImpl<FTensor::Tensor2_symmetric<T, DIM>, DIM>::get(t);
1581 }

◆ determinantTensor2by2() [1/2]

template<typename T >
static auto MoFEM::determinantTensor2by2 ( T &  t)
inlinestatic

Calculate the determinant of a 2x2 matrix or a tensor of rank 2.

Template Parameters
T
Parameters
t
Returns
double

Definition at line 1553 of file Templates.hpp.

1553  {
1554  return t(0, 0) * t(1, 1) - t(0, 1) * t(1, 0);
1555 }

◆ determinantTensor2by2() [2/2]

template<class T1 , class T2 >
MoFEMErrorCode MoFEM::determinantTensor2by2 ( T1 &  t,
T2 &  det 
)
inline

Calculate determinant 2 by 2.

Definition at line 1618 of file Templates.hpp.

1618  {
1620  det = determinantTensor2by2(t);
1622 }

◆ determinantTensor3by3() [1/2]

template<typename T >
static auto MoFEM::determinantTensor3by3 ( T &  t)
inlinestatic

Calculate the determinant of a 3x3 matrix or a tensor of rank 2.

Template Parameters
T
Parameters
t
Returns
double
Examples
EshelbianOperators.cpp, HookeElement.cpp, HookeElement.hpp, HookeInternalStressElement.hpp, lorentz_force.cpp, NeoHookean.hpp, Remodeling.cpp, and Remodeling.hpp.

Definition at line 1540 of file Templates.hpp.

1540  {
1541  return t(0, 0) * t(1, 1) * t(2, 2) + t(1, 0) * t(2, 1) * t(0, 2) +
1542  t(2, 0) * t(0, 1) * t(1, 2) - t(0, 0) * t(2, 1) * t(1, 2) -
1543  t(2, 0) * t(1, 1) * t(0, 2) - t(1, 0) * t(0, 1) * t(2, 2);
1544 }

◆ determinantTensor3by3() [2/2]

template<class T1 , class T2 >
MoFEMErrorCode MoFEM::determinantTensor3by3 ( T1 &  t,
T2 &  det 
)
inline

Calculate determinant 3 by 3.

Definition at line 1607 of file Templates.hpp.

1607  {
1609  det = determinantTensor3by3(t);
1611 }

◆ dimension_from_handle()

auto MoFEM::dimension_from_handle ( const EntityHandle  h)
inline

get entity dimension form handle

Definition at line 1914 of file Templates.hpp.

1914  {
1915  return moab::CN::Dimension(type_from_handle(h));
1916 };

◆ DMCreate_MGViaApproxOrders()

MoFEMErrorCode MoFEM::DMCreate_MGViaApproxOrders ( DM  dm)

Create DM data structure for Multi-Grid via approximation orders.

It set data structure and operators needed

Parameters
dmDiscrete manager
Returns
Error code

Definition at line 313 of file PCMGSetUpViaApproxOrders.cpp.

313  {
314  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
316  if (!dm->data) {
317  dm->data = new DMMGViaApproxOrdersCtx();
318  } else {
319  ((DMCtxImpl *)(dm->data))->incrementReference();
320  }
322 
323  dm->ops->creatematrix = DMCreateMatrix_MGViaApproxOrders;
324  dm->ops->createglobalvector = DMCreateGlobalVector_MGViaApproxOrders;
325  dm->ops->coarsen = DMCoarsen_MGViaApproxOrders;
326  dm->ops->createinterpolation = DMCreateInterpolation_MGViaApproxOrders;
327  dm->ops->destroy = DMDestroy_MGViaApproxOrders;
328 
329  CHKERR DMKSPSetComputeOperators(dm, ksp_set_operators, NULL);
330  PetscInfo1(dm, "Create DMMGViaApproxOrders reference = %d\n",
331  ((DMCtxImpl *)(dm->data))->useCount());
333 }

◆ DMCreateGlobalVector_MGViaApproxOrders()

MoFEMErrorCode MoFEM::DMCreateGlobalVector_MGViaApproxOrders ( DM  dm,
Vec *  g 
)

Create global vector for DMGViaApproxOrders.

Parameters
dmDistributed mesh data structure
greturned pointer to vector
Returns
Error code

Definition at line 484 of file PCMGSetUpViaApproxOrders.cpp.

484  {
485  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
487  int leveldown = dm->leveldown;
488  GET_DM_FIELD(dm);
489  if (dm_field->kspOperators.empty()) {
491  } else {
492 #if PETSC_VERSION_GE(3, 5, 3)
493  CHKERR MatCreateVecs(
494  dm_field->kspOperators[dm_field->kspOperators.size() - 1 - leveldown],
495  g, NULL);
496 #else
497  CHKERR MatGetVecs(
498  dm_field->kspOperators[dm_field->kspOperators.size() - 1 - leveldown],
499  g, NULL);
500 #endif
501  CHKERR VecSetDM(*g, dm);
502  }
503  PetscInfo1(dm, "Create global vector DMMGViaApproxOrders leveldown = %d\n",
504  dm->leveldown);
506 }

◆ DMCreateInterpolation_MGViaApproxOrders()

MoFEMErrorCode MoFEM::DMCreateInterpolation_MGViaApproxOrders ( DM  dm1,
DM  dm2,
Mat *  mat,
Vec *  vec 
)

Create interpolation matrix between data managers dm1 and dm2.

Parameters
dm1Distributed mesh data structure
dm2Distributed mesh data structure
matPointer to returned interpolation matrix
vecPointer to scaling vector here returned NULL
Returns
Error code

Definition at line 391 of file PCMGSetUpViaApproxOrders.cpp.

392  {
393  PetscValidHeaderSpecific(dm1, DM_CLASSID, 1);
394  PetscValidHeaderSpecific(dm2, DM_CLASSID, 1);
396 
397  MPI_Comm comm;
398  CHKERR PetscObjectGetComm((PetscObject)dm1, &comm);
399 
400  int m, n, M, N;
401 
402  DM dm_down = dm1;
403  DM dm_up = dm2;
404 
405  int dm_down_leveldown = dm_down->leveldown;
406  int dm_up_leveldown = dm_up->leveldown;
407 
408  PetscInfo2(dm1,
409  "Create interpolation DMMGViaApproxOrders dm1_leveldown = %d "
410  "dm2_leveldown = %d\n",
411  dm_down_leveldown, dm_up_leveldown);
412 
413  IS is_down, is_up;
414  {
415  // Coarser mesh
416  GET_DM_FIELD(dm_down);
417  if (static_cast<int>(dm_field->coarseningIS.size()) < dm_down_leveldown) {
418  SETERRQ(PETSC_COMM_WORLD, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
419  }
420  is_down = dm_field->coarseningIS[dm_field->coarseningIS.size() - 1 -
421  dm_down_leveldown];
422  CHKERR ISGetSize(is_down, &M);
423  CHKERR ISGetLocalSize(is_down, &m);
424  }
425  {
426  // Finer mesh
427  GET_DM_FIELD(dm_up);
428  if (static_cast<int>(dm_field->coarseningIS.size()) < dm_up_leveldown) {
429  SETERRQ(PETSC_COMM_WORLD, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
430  }
431  is_up =
432  dm_field
433  ->coarseningIS[dm_field->coarseningIS.size() - 1 - dm_up_leveldown];
434  CHKERR ISGetSize(is_up, &N);
435  CHKERR ISGetLocalSize(is_up, &n);
436  }
437 
438  // is_dow rows
439  // is_up columns
440 
441  CHKERR MatCreate(comm, mat);
442  CHKERR MatSetSizes(*mat, m, n, M, N);
443  CHKERR MatSetType(*mat, MATMPIAIJ);
444  CHKERR MatMPIAIJSetPreallocation(*mat, 1, PETSC_NULL, 0, PETSC_NULL);
445 
446  // get matrix layout
447  PetscLayout rmap, cmap;
448  CHKERR MatGetLayouts(*mat, &rmap, &cmap);
449  int rstart, rend, cstart, cend;
450  CHKERR PetscLayoutGetRange(rmap, &rstart, &rend);
451  CHKERR PetscLayoutGetRange(cmap, &cstart, &cend);
452 
453  const int *row_indices_ptr, *col_indices_ptr;
454  CHKERR ISGetIndices(is_down, &row_indices_ptr);
455  CHKERR ISGetIndices(is_up, &col_indices_ptr);
456 
457  map<int, int> idx_map;
458  for (int ii = 0; ii < m; ii++) {
459  idx_map[row_indices_ptr[ii]] = rstart + ii;
460  }
461 
462  CHKERR MatZeroEntries(*mat);
463  // FIXME: Use MatCreateMPIAIJWithArrays and set array directly
464  for (int jj = 0; jj < n; jj++) {
465  map<int, int>::iterator mit = idx_map.find(col_indices_ptr[jj]);
466  if (mit != idx_map.end()) {
467  CHKERR MatSetValue(*mat, mit->second, cstart + jj, 1, INSERT_VALUES);
468  }
469  }
470 
471  CHKERR ISRestoreIndices(is_down, &row_indices_ptr);
472  CHKERR ISRestoreIndices(is_up, &col_indices_ptr);
473 
474  CHKERR MatAssemblyBegin(*mat, MAT_FINAL_ASSEMBLY);
475  CHKERR MatAssemblyEnd(*mat, MAT_FINAL_ASSEMBLY);
476 
477  if (vec != NULL) {
478  *vec = PETSC_NULL;
479  }
480 
482 }

◆ DMDestroy_MGViaApproxOrders()

PetscErrorCode MoFEM::DMDestroy_MGViaApproxOrders ( DM  dm)

Destroy DM.

Parameters
dm
Returns
* PetscErrorCode

Definition at line 335 of file PCMGSetUpViaApproxOrders.cpp.

335  {
336  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
337  GET_DM_FIELD(dm);
339  CHKERR dm_field->destroyCoarseningIS();
342 }

◆ DMMGViaApproxOrdersSetAO()

MoFEMErrorCode MoFEM::DMMGViaApproxOrdersSetAO ( DM  dm,
AO  ao 
)

Set DM ordering.

AO will transform indices from coarseningIS ordering to ordering used to construct fine matrix.

Parameters
dm[description]
ao[description]
Returns
[description]

Definition at line 219 of file PCMGSetUpViaApproxOrders.cpp.

219  {
220  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
222  GET_DM_FIELD(dm);
223  dm_field->aO = SmartPetscObj<AO>(ao, true);
225 }

◆ DMMoFEMAddSubFieldCol() [1/3]

PetscErrorCode MoFEM::DMMoFEMAddSubFieldCol ( DM  dm,
const char  field_name[],
boost::shared_ptr< Range r_ptr 
)

Add field to sub dm problem on columns.

Parameters
dm
field_name
rangeof entities
Returns
PetscErrorCode

Definition at line 300 of file DMMoFEM.cpp.

301  {
302  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
304  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
305  if (!dm->data) {
306  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
307  "data structure for MoFEM not yet created");
308  }
309  if (!dm_field->isSubDM) {
310  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "this is not sub-dm");
311  }
312  dm_field->colSubFields.push_back(field_name);
313  dm_field->mapTypeCol[field_name] = r_ptr;
315 }

◆ DMMoFEMAddSubFieldCol() [2/3]

PetscErrorCode MoFEM::DMMoFEMAddSubFieldCol ( DM  dm,
std::string  field_name 
)

Add field to sub dm problem on columns

Definition at line 296 of file DMMoFEM.cpp.

296  {
297  return DMMoFEMAddSubFieldCol(dm, field_name.c_str());
298 }

◆ DMMoFEMAddSubFieldCol() [3/3]

PetscErrorCode MoFEM::DMMoFEMAddSubFieldCol ( DM  dm,
std::string  field_name,
boost::shared_ptr< Range r_ptr 
)

Add field to sub dm problem on columns.

Parameters
dm
field_name
rangeof entities
Returns
PetscErrorCode

Definition at line 317 of file DMMoFEM.cpp.

318  {
319  return DMMoFEMAddSubFieldCol(dm, field_name.c_str(), r_ptr);
320 }

◆ DMMoFEMAddSubFieldRow() [1/2]

PetscErrorCode MoFEM::DMMoFEMAddSubFieldRow ( DM  dm,
std::string  field_name 
)

Add field to sub dm problem on rows

Definition at line 254 of file DMMoFEM.cpp.

254  {
255  return DMMoFEMAddSubFieldRow(dm, field_name.c_str());
256 }

◆ DMMoFEMAddSubFieldRow() [2/2]

PetscErrorCode MoFEM::DMMoFEMAddSubFieldRow ( DM  dm,
std::string  field_name,
boost::shared_ptr< Range r_ptr 
)

Add field to sub dm problem on rows.

Parameters
dm
field_name
m
Returns
PetscErrorCode

Definition at line 275 of file DMMoFEM.cpp.

276  {
277  return DMMoFEMAddSubFieldRow(dm, field_name.c_str(), r_ptr);
278 }

◆ DMMoFEMCreateHybridL2Mat()

MoFEMErrorCode MoFEM::DMMoFEMCreateHybridL2Mat ( DM  dm,
SmartPetscObj< Mat > &  mat 
)

Create matrix for hybridised system.

Parameters
dm
mat
Returns
MoFEMErrorCode

Definition at line 1582 of file DMMoFEM.cpp.

1582  {
1583  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1585  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
1586  auto matrix_mng = dm_field->mField_ptr->getInterface<MatrixManager>();
1587  CHKERR matrix_mng->createHybridL2MPIAIJ<PetscGlobalIdx_mi_tag>(
1588  dm_field->problemName, mat);
1590 }

◆ DMMoFEMCreateNestSchurMat()

MoFEMErrorCode MoFEM::DMMoFEMCreateNestSchurMat ( DM  dm,
Mat *  mat 
)

Create nest schur matrix.

Parameters
dm
mat
Returns
MoFEMErrorCode

Definition at line 1572 of file DMMoFEM.cpp.

1572  {
1573  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1575  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
1576  auto mat_data = createSchurNestedMatrix(dm_field->nestedSchurDataPtr);
1577  *mat = mat_data.first;
1578  CHKERR PetscObjectReference((PetscObject)(*mat));
1580 }

◆ DMMoFEMDuplicateDMCtx()

PetscErrorCode MoFEM::DMMoFEMDuplicateDMCtx ( DM  dm,
DM  dm_duplicate 
)

Duplicate internal data struture.

Parameters
dm
dm_duplicate
Returns
PetscErrorCode

Definition at line 180 of file DMMoFEM.cpp.

180  {
182 
183  if (!dm->data)
184  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
185  "data structure for MoFEM not yet created");
186 
187  if (static_cast<DMCtxImpl *>(dm_duplicate->data)->referenceNumber == 0)
188  delete static_cast<DMCtxImpl *>(dm_duplicate->data);
189 
190  dm_duplicate->data = dm->data;
191  ++(static_cast<DMCtxImpl *>(dm_duplicate->data)->referenceNumber);
192 
194 }

◆ DMMoFEMGetBlocMatData()

MoFEMErrorCode MoFEM::DMMoFEMGetBlocMatData ( DM  dm,
boost::shared_ptr< BlockStructure > &  data 
)

Get data for block mat.

Parameters
dm
Returns
MoFEMErrorCode
Examples
test_broken_space.cpp.

Definition at line 1542 of file DMMoFEM.cpp.

1543  {
1544  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1546  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
1547  data = dm_field->blocMatDataPtr;
1549 }

◆ DMMoFEMGetDestroyProblem()

PetscErrorCode MoFEM::DMMoFEMGetDestroyProblem ( DM  dm,
PetscBool *  destroy_problem 
)

Get if problem will be destroyed with DM

Parameters
dmthe DM object
destroyreturn if PETSC_TRUE problem is destroyed
Returns
error code

Definition at line 447 of file DMMoFEM.cpp.

447  {
449  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
451  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
452  *destroy_problem = dm_field->destroyProblem;
454 }

◆ DMMoFEMGetSubColIS()

PetscErrorCode MoFEM::DMMoFEMGetSubColIS ( DM  dm,
IS *  is 
)

get sub problem is

Parameters
dmhas to be created with DMMoFEMSetSquareProblem
isreturn is on the row
Returns
error code

Returns IS with global indices of the DM used to create SubDM

Definition at line 349 of file DMMoFEM.cpp.

349  {
351  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
353  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
354  if (dm_field->isSubDM != PETSC_TRUE) {
355  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
356  "This DM is not created as a SubDM");
357  }
358  if (dm_field->isProblemBuild != PETSC_TRUE) {
359  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "Problem is not build");
360  }
361  boost::shared_ptr<Problem::SubProblemData> sub_data =
362  dm_field->problemPtr->getSubData();
363  CHKERR sub_data->getColIs(is);
365 }

◆ DMMoFEMGetSubRowIS()

PetscErrorCode MoFEM::DMMoFEMGetSubRowIS ( DM  dm,
IS *  is 
)

get sub problem is

Parameters
dmhas to be created with DMMoFEMSetSquareProblem
isreturn is on the row
Returns
error code

Returns IS with global indices of the DM used to create SubDM

Examples
analytical_poisson_field_split.cpp.

Definition at line 331 of file DMMoFEM.cpp.

331  {
333  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
335  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
336  if (dm_field->isSubDM != PETSC_TRUE) {
337  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
338  "This DM is not created as a SubDM");
339  }
340  if (dm_field->isProblemBuild != PETSC_TRUE) {
341  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "Problem is not build");
342  }
343  boost::shared_ptr<Problem::SubProblemData> sub_data =
344  dm_field->problemPtr->getSubData();
345  CHKERR sub_data->getRowIs(is);
347 }

◆ DMMoFEMKSPSetComputeOperators()

template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode MoFEM::DMMoFEMKSPSetComputeOperators ( DM  dm,
fe_name,
T0  method,
T1  pre_only,
T2  post_only 
)
static

Definition at line 659 of file DMMoFEM.cpp.

660  {
661  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
663  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
664  if (pre_only) {
665  dm_field->kspCtx->getPreProcSetOperators().push_back(pre_only);
666  }
667  if (method) {
668  dm_field->kspCtx->getSetOperators().push_back(
669  PairNameFEMethodPtr(fe_name, method));
670  }
671  if (post_only) {
672  dm_field->kspCtx->getPostProcSetOperators().push_back(post_only);
673  }
674  CHKERR DMKSPSetComputeOperators(dm, KspMat, dm_field->kspCtx.get());
676 }

◆ DMMoFEMKSPSetComputeRHS()

template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode MoFEM::DMMoFEMKSPSetComputeRHS ( DM  dm,
fe_name,
T0  method,
T1  pre_only,
T2  post_only 
)
static

Definition at line 618 of file DMMoFEM.cpp.

619  {
620  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
622  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
623  if (pre_only) {
624  dm_field->kspCtx->getPreProcComputeRhs().push_back(pre_only);
625  }
626  if (method) {
627  dm_field->kspCtx->getComputeRhs().push_back(
628  PairNameFEMethodPtr(fe_name, method));
629  }
630  if (post_only) {
631  dm_field->kspCtx->getPostProcComputeRhs().push_back(post_only);
632  }
633  CHKERR DMKSPSetComputeRHS(dm, KspRhs, dm_field->kspCtx.get());
635 }

◆ DMMoFEMSetBlocMatData()

MoFEMErrorCode MoFEM::DMMoFEMSetBlocMatData ( DM  dm,
boost::shared_ptr< BlockStructure data 
)

Set data for block mat.

Note
You can reset data by setting nullptr
Examples
schur_test_diag_mat.cpp.

Definition at line 1533 of file DMMoFEM.cpp.

1534  {
1535  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1537  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
1538  dm_field->blocMatDataPtr = data;
1540 }

◆ DMMoFEMSetDestroyProblem()

PetscErrorCode MoFEM::DMMoFEMSetDestroyProblem ( DM  dm,
PetscBool  destroy_problem 
)

If this is set to PETSC_TRUE problem is deleted with DM

Parameters
dmthe DM object
destroyif PETSC_TRUE problem is destroyed
Returns
error code
Examples
EshelbianPlasticity.cpp, free_surface.cpp, and level_set.cpp.

Definition at line 438 of file DMMoFEM.cpp.

438  {
440  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
442  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
443  dm_field->destroyProblem = destroy_problem;
445 }

◆ DMMoFEMSetNestSchurData() [1/2]

template<>
MoFEMErrorCode MoFEM::DMMoFEMSetNestSchurData ( DM  dm,
boost::shared_ptr< NestSchurData data 
)
Examples
plastic.cpp, and test_broken_space.cpp.

Definition at line 1562 of file DMMoFEM.cpp.

1563  {
1564  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1566  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
1567  dm_field->nestedSchurDataPtr = data;
1568  dm_field->blocMatDataPtr = get<2>(*(data));
1570 }

◆ DMMoFEMSetNestSchurData() [2/2]

template<typename T >
MoFEMErrorCode MoFEM::DMMoFEMSetNestSchurData ( DM  dm,
boost::shared_ptr< T >   
)

Set data for nest schur (see specialisation in Schur.hpp)

Note
You can reset data by setting nullptr
Template Parameters
T= NestSchurData
Parameters
dm
Returns
MoFEMErrorCode

◆ DMMoFEMSetVerbosity()

PetscErrorCode MoFEM::DMMoFEMSetVerbosity ( DM  dm,
const int  verb 
)

Set verbosity level.

Parameters
dm
verbsee VERBOSITY_LEVELS for list of the levels
Returns
PetscErrorCode

Definition at line 1525 of file DMMoFEM.cpp.

1525  {
1526  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1528  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
1529  dm_field->verbosity = verb;
1531 }

◆ DMMoFEMSNESSetFunction()

template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode MoFEM::DMMoFEMSNESSetFunction ( DM  dm,
fe_name,
T0  method,
T1  pre_only,
T2  post_only 
)
static

Definition at line 699 of file DMMoFEM.cpp.

700  {
701  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
703  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
704  if (pre_only) {
705  dm_field->snesCtx->getPreProcComputeRhs().push_back(pre_only);
706  }
707  if (method) {
708  dm_field->snesCtx->getComputeRhs().push_back(
709  PairNameFEMethodPtr(fe_name, method));
710  }
711  if (post_only) {
712  dm_field->snesCtx->getPostProcComputeRhs().push_back(post_only);
713  }
714  CHKERR DMSNESSetFunction(dm, SnesRhs, dm_field->snesCtx.get());
716 }

◆ DMMoFEMSNESSetJacobian()

template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode MoFEM::DMMoFEMSNESSetJacobian ( DM  dm,
fe_name,
T0  method,
T1  pre_only,
T2  post_only 
)
static

Definition at line 740 of file DMMoFEM.cpp.

741  {
742  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
744  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
745  if (pre_only) {
746  dm_field->snesCtx->getPreProcSetOperators().push_back(pre_only);
747  }
748  if (method) {
749  dm_field->snesCtx->getSetOperators().push_back(
750  PairNameFEMethodPtr(fe_name, method));
751  }
752  if (post_only) {
753  dm_field->snesCtx->getPostProcSetOperators().push_back(post_only);
754  }
755  CHKERR DMSNESSetJacobian(dm, SnesMat, dm_field->snesCtx.get());
757 }

◆ DMMoFEMSwapDMCtx()

PetscErrorCode MoFEM::DMMoFEMSwapDMCtx ( DM  dm,
DM  dm_swap 
)

Swap internal data struture.

Parameters
dm
dm_swap
Returns
PetscErrorCode

Definition at line 196 of file DMMoFEM.cpp.

196  {
198  if (!dm->data)
199  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
200  "data structure for MoFEM not yet created on dm");
201  if (!dm_swap->data)
202  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
203  "data structure for MoFEM not yet created on swap dm");
204 
205  auto *dm_field = static_cast<DMCtxImpl *>(dm->data);
206  auto *dm_field_swap = static_cast<DMCtxImpl *>(dm_swap->data);
207 
208  auto tmp_field = dm_field;
209  dm_field = dm_field_swap;
210  dm_field_swap = tmp_field;
211 
213 }

◆ DMMoFEMTSSetI2Function()

template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode MoFEM::DMMoFEMTSSetI2Function ( DM  dm,
fe_name,
T0  method,
T1  pre_only,
T2  post_only 
)
static

Definition at line 945 of file DMMoFEM.cpp.

946  {
947  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
949  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
950  if (pre_only) {
951  dm_field->tsCtx->getPreProcessIFunction().push_back(pre_only);
952  }
953  if (method) {
954  dm_field->tsCtx->getLoopsIFunction().push_back(
955  PairNameFEMethodPtr(fe_name, method));
956  }
957  if (post_only) {
958  dm_field->tsCtx->getPostProcessIFunction().push_back(post_only);
959  }
960  CHKERR DMTSSetI2Function(dm, TsSetI2Function, dm_field->tsCtx.get());
962 }

◆ DMMoFEMTSSetI2Jacobian()

template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode MoFEM::DMMoFEMTSSetI2Jacobian ( DM  dm,
fe_name,
T0  method,
T1  pre_only,
T2  post_only 
)
static

Definition at line 988 of file DMMoFEM.cpp.

989  {
990  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
992  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
993  if (pre_only) {
994  dm_field->tsCtx->getPreProcessIJacobian().push_back(pre_only);
995  }
996  if (method) {
997  dm_field->tsCtx->getLoopsIJacobian().push_back(
998  PairNameFEMethodPtr(fe_name, method));
999  }
1000  if (post_only) {
1001  dm_field->tsCtx->getPostProcessIJacobian().push_back(post_only);
1002  }
1003  CHKERR DMTSSetI2Jacobian(dm, TsSetI2Jacobian, dm_field->tsCtx.get());
1005 }

◆ DMMoFEMTSSetIFunction()

template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode MoFEM::DMMoFEMTSSetIFunction ( DM  dm,
fe_name,
T0  method,
T1  pre_only,
T2  post_only 
)
static

Definition at line 781 of file DMMoFEM.cpp.

782  {
783  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
785  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
786  if (pre_only) {
787  dm_field->tsCtx->getPreProcessIFunction().push_back(pre_only);
788  }
789  if (method) {
790  dm_field->tsCtx->getLoopsIFunction().push_back(
791  PairNameFEMethodPtr(fe_name, method));
792  }
793  if (post_only) {
794  dm_field->tsCtx->getPostProcessIFunction().push_back(post_only);
795  }
796  CHKERR DMTSSetIFunction(dm, TsSetIFunction, dm_field->tsCtx.get());
798 }

◆ DMMoFEMTSSetIJacobian()

template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode MoFEM::DMMoFEMTSSetIJacobian ( DM  dm,
fe_name,
T0  method,
T1  pre_only,
T2  post_only 
)
static

Definition at line 824 of file DMMoFEM.cpp.

825  {
826  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
828  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
829  if (pre_only) {
830  dm_field->tsCtx->getPreProcessIJacobian().push_back(pre_only);
831  }
832  if (method) {
833  dm_field->tsCtx->getLoopsIJacobian().push_back(
834  PairNameFEMethodPtr(fe_name, method));
835  }
836  if (post_only) {
837  dm_field->tsCtx->getPostProcessIJacobian().push_back(post_only);
838  }
839  CHKERR DMTSSetIJacobian(dm, TsSetIJacobian, dm_field->tsCtx.get());
841 }

◆ DMMoFEMTSSetMonitor() [1/3]

PetscErrorCode MoFEM::DMMoFEMTSSetMonitor ( DM  dm,
TS  ts,
const char  fe_name[],
MoFEM::FEMethod method,
MoFEM::BasicMethod pre_only,
MoFEM::BasicMethod post_only 
)

Set Monitor To TS solver.

See PETSc documentaton here

Parameters
dm
tstime solver
fe_name
method
pre_only
post_only
Returns
PetscErrorCod

Definition at line 1045 of file DMMoFEM.cpp.

1048  {
1049  return DMMoFEMTSSetMonitor<const char *, MoFEM::FEMethod *,
1051  dm, ts, fe_name, method, pre_only, post_only);
1053 }

◆ DMMoFEMTSSetMonitor() [2/3]

PetscErrorCode MoFEM::DMMoFEMTSSetMonitor ( DM  dm,
TS  ts,
const std::string  fe_name,
boost::shared_ptr< MoFEM::FEMethod method,
boost::shared_ptr< MoFEM::BasicMethod pre_only,
boost::shared_ptr< MoFEM::BasicMethod post_only 
)

Set Monitor To TS solver.

See PETSc documentaton here

Parameters
dm
tstime solver
fe_name
method
pre_only
post_only
Returns
PetscErrorCod
Examples
adolc_plasticity.cpp, dynamic_first_order_con_law.cpp, free_surface.cpp, heat_equation.cpp, level_set.cpp, photon_diffusion.cpp, plastic.cpp, reaction_diffusion.cpp, seepage.cpp, shallow_wave.cpp, thermo_elastic.cpp, and wave_equation.cpp.

Definition at line 1056 of file DMMoFEM.cpp.

1059  {
1060  return DMMoFEMTSSetMonitor<const std::string,
1061  boost::shared_ptr<MoFEM::FEMethod>,
1062  boost::shared_ptr<MoFEM::BasicMethod>,
1063  boost::shared_ptr<MoFEM::BasicMethod>>(
1064  dm, ts, fe_name, method, pre_only, post_only);
1066 }

◆ DMMoFEMTSSetMonitor() [3/3]

template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode MoFEM::DMMoFEMTSSetMonitor ( DM  dm,
TS  ts,
fe_name,
T0  method,
T1  pre_only,
T2  post_only 
)
static

Definition at line 1029 of file DMMoFEM.cpp.

1030  {
1031  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1033  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
1034  if (pre_only)
1035  dm_field->tsCtx->getPreProcessMonitor().push_back(pre_only);
1036  if (method)
1037  dm_field->tsCtx->getLoopsMonitor().push_back(
1038  PairNameFEMethodPtr(fe_name, method));
1039  if (post_only)
1040  dm_field->tsCtx->getPostProcessMonitor().push_back(post_only);
1041  CHKERR TSMonitorSet(ts, TsMonitorSet, dm_field->tsCtx.get(), PETSC_NULL);
1043 }

◆ DMMoFEMTSSetRHSFunction() [1/3]

PetscErrorCode MoFEM::DMMoFEMTSSetRHSFunction ( DM  dm,
const char  fe_name[],
MoFEM::FEMethod method,
MoFEM::BasicMethod pre_only,
MoFEM::BasicMethod post_only 
)

Definition at line 894 of file DMMoFEM.cpp.

897  {
898  return DMMoFEMTSSetRHSFunction<const char *, MoFEM::FEMethod *,
900  dm, fe_name, method, pre_only, post_only);
902 }

◆ DMMoFEMTSSetRHSFunction() [2/3]

PetscErrorCode MoFEM::DMMoFEMTSSetRHSFunction ( DM  dm,
const std::string  fe_name,
boost::shared_ptr< MoFEM::FEMethod method,
boost::shared_ptr< MoFEM::BasicMethod pre_only,
boost::shared_ptr< MoFEM::BasicMethod post_only 
)

set TS the right hand side function

See petsc documentation

Parameters
dm
fe_name
method
pre_only
post_only
Returns
PetscErrorCode
Examples
NonlinearElasticElementInterface.hpp, and reaction_diffusion.cpp.

Definition at line 882 of file DMMoFEM.cpp.

885  {
886  return DMMoFEMTSSetRHSFunction<const std::string,
887  boost::shared_ptr<MoFEM::FEMethod>,
888  boost::shared_ptr<MoFEM::BasicMethod>,
889  boost::shared_ptr<MoFEM::BasicMethod>>(
890  dm, fe_name, method, pre_only, post_only);
892 }

◆ DMMoFEMTSSetRHSFunction() [3/3]

template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode MoFEM::DMMoFEMTSSetRHSFunction ( DM  dm,
fe_name,
T0  method,
T1  pre_only,
T2  post_only 
)
static

Definition at line 865 of file DMMoFEM.cpp.

866  {
867  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
869  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
870  if (pre_only)
871  dm_field->tsCtx->getPreProcessRHSFunction().push_back(pre_only);
872  if (method)
873  dm_field->tsCtx->getLoopsRHSFunction().push_back(
874  PairNameFEMethodPtr(fe_name, method));
875  if (post_only)
876  dm_field->tsCtx->getPostProcessRHSFunction().push_back(post_only);
877  CHKERR DMTSSetRHSFunction(dm, TsSetRHSFunction, dm_field->tsCtx.get());
879 }

◆ DMMoFEMTSSetRHSJacobian() [1/3]

PetscErrorCode MoFEM::DMMoFEMTSSetRHSJacobian ( DM  dm,
const char  fe_name[],
MoFEM::FEMethod method,
MoFEM::BasicMethod pre_only,
MoFEM::BasicMethod post_only 
)

Definition at line 934 of file DMMoFEM.cpp.

937  {
938  return DMMoFEMTSSetRHSJacobian<const char *, MoFEM::FEMethod *,
940  dm, fe_name, method, pre_only, post_only);
942 }

◆ DMMoFEMTSSetRHSJacobian() [2/3]

PetscErrorCode MoFEM::DMMoFEMTSSetRHSJacobian ( DM  dm,
const std::string  fe_name,
boost::shared_ptr< MoFEM::FEMethod method,
boost::shared_ptr< MoFEM::BasicMethod pre_only,
boost::shared_ptr< MoFEM::BasicMethod post_only 
)

set TS the right hand side jacobian

See petsc documentation

Parameters
dm
fe_name
method
pre_only
post_only
Returns
PetscErrorCode
Examples
NonlinearElasticElementInterface.hpp.

Definition at line 922 of file DMMoFEM.cpp.

925  {
926  return DMMoFEMTSSetRHSJacobian<const std::string,
927  boost::shared_ptr<MoFEM::FEMethod>,
928  boost::shared_ptr<MoFEM::BasicMethod>,
929  boost::shared_ptr<MoFEM::BasicMethod>>(
930  dm, fe_name, method, pre_only, post_only);
932 }

◆ DMMoFEMTSSetRHSJacobian() [3/3]

template<class S , class T0 , class T1 , class T2 >
static PetscErrorCode MoFEM::DMMoFEMTSSetRHSJacobian ( DM  dm,
fe_name,
T0  method,
T1  pre_only,
T2  post_only 
)
static

Definition at line 905 of file DMMoFEM.cpp.

906  {
907  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
909  DMCtxImpl *dm_field = static_cast<DMCtxImpl *>(dm->data);
910  if (pre_only)
911  dm_field->tsCtx->getPreProcessRHSFunction().push_back(pre_only);
912  if (method)
913  dm_field->tsCtx->getLoopsRHSFunction().push_back(
914  PairNameFEMethodPtr(fe_name, method));
915  if (post_only)
916  dm_field->tsCtx->getPostProcessRHSFunction().push_back(post_only);
917  CHKERR DMTSSetRHSJacobian(dm, TsSetRHSJacobian, dm_field->tsCtx.get());
919 }

◆ ent_form_type_and_id()

auto MoFEM::ent_form_type_and_id ( const EntityType  type,
const EntityID  id 
)
inline

get entity handle from type and id

Definition at line 1906 of file Templates.hpp.

1906  {
1907  return (static_cast<EntityHandle>(type) << MB_ID_WIDTH) | id;
1908 };

◆ field_bit_from_bit_number()

auto MoFEM::field_bit_from_bit_number ( const int  bit_number)
inline

get field bit id from bit number

Definition at line 1930 of file Templates.hpp.

1930  {
1931  return BitFieldId().set(bit_number - 1);
1932 };

◆ get_cache_data_dofs_view()

template<typename ENTSVIEW , typename DOFSVIEW , typename EXTRACTOR , typename INSERTER >
static MoFEMErrorCode MoFEM::get_cache_data_dofs_view ( ENTSVIEW &  ents_view,
DOFSVIEW &  dofs_view,
EXTRACTOR &&  extractor,
INSERTER &&  inserter 
)
inlinestatic

Definition at line 496 of file FEMultiIndices.cpp.

497  {
499 
500  auto hint = dofs_view->end();
501  using ValType = typename std::remove_reference<decltype(**hint)>::type;
502 
503  for (auto &it : *ents_view) {
504  if (auto e = it.lock()) {
505 
506  if (auto cache = extractor(e).lock())
507  for (auto dit = cache->loHi[0]; dit != cache->loHi[1]; ++dit)
508  hint = inserter(dofs_view, hint,
509  boost::reinterpret_pointer_cast<ValType>(*dit));
510  else
511  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Cache not set");
512  }
513  }
514 
516 }

◆ get_event_options_imp() [1/2]

template<class T >
static auto MoFEM::get_event_options_imp ( T *const  ptr,
int   
) -> decltype(ptr->getEventOptions())
static

Definition at line 151 of file Core.cpp.

152  {
153  return ptr->getEventptions();
154 };

◆ get_event_options_imp() [2/2]

template<class T >
static auto MoFEM::get_event_options_imp ( T *const  ptr,
long   
) -> MoFEMErrorCode
static

Definition at line 162 of file Core.cpp.

162  {
163  return 0;
164 };

◆ get_id_for_max_type() [1/2]

template<EntityType TYPE>
EntityHandle MoFEM::get_id_for_max_type ( )
inline

Definition at line 13 of file RefEntsMultiIndices.hpp.

13  {
14  return (static_cast<EntityHandle>(TYPE) << MB_ID_WIDTH) |
15  (~static_cast<EntityHandle>(MB_TYPE_MASK));
16 };

◆ get_id_for_max_type() [2/2]

EntityHandle MoFEM::get_id_for_max_type ( const EntityType  type)
inline

Definition at line 22 of file RefEntsMultiIndices.hpp.

22  {
23  return (static_cast<EntityHandle>(type) << MB_ID_WIDTH) |
24  (~static_cast<EntityHandle>(MB_TYPE_MASK));
25 };

◆ get_id_for_min_type() [1/2]

template<EntityType TYPE>
EntityHandle MoFEM::get_id_for_min_type ( )
inline

Definition at line 18 of file RefEntsMultiIndices.hpp.

18  {
19  return (static_cast<EntityHandle>(TYPE) << MB_ID_WIDTH);
20 };

◆ get_id_for_min_type() [2/2]

EntityHandle MoFEM::get_id_for_min_type ( const EntityType  type)
inline

Definition at line 27 of file RefEntsMultiIndices.hpp.

27  {
28  return (static_cast<EntityHandle>(type) << MB_ID_WIDTH);
29 };

◆ get_sub_iface_options_imp() [1/2]

template<class T >
static auto MoFEM::get_sub_iface_options_imp ( T *const  ptr,
int   
) -> decltype(ptr->getSubInterfaceOptions())
static

Definition at line 138 of file Core.cpp.

139  {
140  return ptr->getSubInterfaceOptions();
141 };

◆ get_sub_iface_options_imp() [2/2]

template<class T >
static auto MoFEM::get_sub_iface_options_imp ( T *const  ptr,
long   
) -> MoFEMErrorCode
static

Definition at line 146 of file Core.cpp.

146  {
147  return 0;
148 };

◆ get_tag_ptr()

void* MoFEM::get_tag_ptr ( moab::Interface &  moab,
Tag  th,
EntityHandle  ent,
int *  tag_size 
)
inline

Get the tag ptr object.

Parameters
moab
th
ent
tag_size
Returns
void*

Definition at line 40 of file RefEntsMultiIndices.hpp.

41  {
42  void *ret_val;
43  rval = moab.tag_get_by_ptr(th, &ent, 1, (const void **)&ret_val, tag_size);
44  if (rval != MB_SUCCESS) {
45  if (tag_size)
46  *tag_size = 0;
47  return NULL;
48  } else {
49  return ret_val;
50  }
51 }

◆ get_temp_meshset_ptr()

auto MoFEM::get_temp_meshset_ptr ( moab::Interface &  moab)
inline

Create smart pointer to temporary meshset.

Examples
child_and_parent.cpp, EshelbianPlasticity.cpp, free_surface.cpp, hanging_node_approx.cpp, level_set.cpp, seepage.cpp, split_sideset.cpp, and thermo_elastic.cpp.

Definition at line 1886 of file Templates.hpp.

1886  {
1887  return boost::make_shared<TempMeshset>(moab);
1888 };

◆ get_value()

template<class TYPE >
static MoFEMErrorCode MoFEM::get_value ( MatrixDouble pts_x,
MatrixDouble pts_t,
TYPE *  ctx 
)
static

Definition at line 25 of file JacobiPolynomial.cpp.

26  {
28  ctx->baseFunPtr->resize(pts_x.size2(), ctx->P + 1, false);
29  ctx->baseDiffFunPtr->resize(pts_x.size2(), ctx->dIm * (ctx->P + 1), false);
30  if (pts_x.size1() != pts_t.size1() || pts_x.size2() != pts_t.size2()) {
31  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
32  "Inconsistent size of arguments");
33  }
34  double *l = NULL;
35  double *diff_l = NULL;
36  for (unsigned int gg = 0; gg < pts_x.size2(); gg++) {
37  if (ctx->baseFunPtr)
38  l = &((*ctx->baseFunPtr)(gg, 0));
39  if (ctx->baseDiffFunPtr)
40  diff_l = &((*ctx->baseDiffFunPtr)(gg, 0));
41  ierr = (ctx->basePolynomialsType1)(ctx->P, ctx->aLpha, pts_x(0, gg),
42  pts_t(0, gg), ctx->diffX, ctx->diffT, l,
43  diff_l, ctx->dIm);
44  CHKERRG(ierr);
45  }
47 }

◆ getCommFromPetscObject()

MPI_Comm MoFEM::getCommFromPetscObject ( PetscObject  obj)
inline

Get the Comm From Petsc Object object.

Parameters
obj
Returns
MPI_Comm

Definition at line 160 of file PetscSmartObj.hpp.

160  {
161  MPI_Comm comm;
162  CHK_THROW_MESSAGE(PetscObjectGetComm(obj, &comm),
163  "Failed to get comm from PETSc object");
164  return comm;
165 };

◆ getDMKspCtx()

auto MoFEM::getDMKspCtx ( DM  dm)
inline

Get KSP context data structure used by DM.

Examples
level_set.cpp, and test_broken_space.cpp.

Definition at line 1113 of file DMMoFEM.hpp.

1113  {
1114  boost::shared_ptr<MoFEM::KspCtx> ksp_ctx;
1115  ierr = DMMoFEMGetKspCtx(dm, ksp_ctx);
1116  CHKERRABORT(getCommFromPetscObject(reinterpret_cast<PetscObject>(dm)), ierr);
1117  return ksp_ctx;
1118 };

◆ getDMSnesCtx()

auto MoFEM::getDMSnesCtx ( DM  dm)
inline

Get SNES context data structure used by DM.

Examples
adolc_plasticity.cpp, free_surface.cpp, plastic.cpp, seepage.cpp, and thermo_elastic.cpp.

Definition at line 1127 of file DMMoFEM.hpp.

1127  {
1128  boost::shared_ptr<MoFEM::SnesCtx> snes_ctx;
1129  ierr = DMMoFEMGetSnesCtx(dm, snes_ctx);
1130  CHKERRABORT(getCommFromPetscObject(reinterpret_cast<PetscObject>(dm)), ierr);
1131  return snes_ctx;
1132 };

◆ getDMSubData()

auto MoFEM::getDMSubData ( DM  dm)
inline

Get sub problem data structure.

Parameters
dm
Returns
auto
Examples
plastic.cpp, schur_test_diag_mat.cpp, and test_broken_space.cpp.

Definition at line 1157 of file DMMoFEM.hpp.

1157  {
1158  auto prb_ptr = getProblemPtr(dm);
1159  return prb_ptr->getSubData();
1160 };

◆ getDMTsCtx()

auto MoFEM::getDMTsCtx ( DM  dm)
inline

Get TS context data structure used by DM.

Examples
adolc_plasticity.cpp, free_surface.cpp, heat_equation.cpp, plastic.cpp, and seepage.cpp.

Definition at line 1141 of file DMMoFEM.hpp.

1141  {
1142  boost::shared_ptr<MoFEM::TsCtx> ts_ctx;
1143  ierr = DMMoFEMGetTsCtx(dm, ts_ctx);
1144  CHKERRABORT(getCommFromPetscObject(reinterpret_cast<PetscObject>(dm)), ierr);
1145  return ts_ctx;
1146 };

◆ getFTensor0FromVec()

template<int S = 1, class T , class A >
static auto MoFEM::getFTensor0FromVec ( ublas::vector< T, A > &  data)
inlinestatic

◆ getFTensor1FromArray() [1/2]

template<int DIM, int S>
auto MoFEM::getFTensor1FromArray ( VectorDouble data)
inline

Get FTensor1 from array.

Todo:
Generalise for different arrays and data types
Template Parameters
DIM
Parameters
data
Returns
FTensor::Tensor1<FTensor::PackPtr<double *, S>, DIM>

Definition at line 1175 of file Templates.hpp.

1175  {
1176  return GetFTensor1FromArray<DIM, S>::get(data);
1177 }

◆ getFTensor1FromArray() [2/2]

template<int DIM, int S = 0>
auto MoFEM::getFTensor1FromArray ( VectorDouble3 data)
inline

Get FTensor1 from array.

Todo:
Generalise for different arrays and data types
Template Parameters
DIM
Parameters
data
Returns
FTensor::Tensor1<FTensor::PackPtr<double *, S>, DIM>

◆ getFTensor1FromArray< 3, 0 >()

template<>
auto MoFEM::getFTensor1FromArray< 3, 0 > ( VectorDouble3 data)
inline

Definition at line 1183 of file Templates.hpp.

1183  {
1184  return GetFTensor1FromArray<3, 0>::get(data);
1185 }

◆ getFTensor1FromArrayDiag() [1/2]

template<int DIM, int S>
FTensor::Tensor1<FTensor::PackPtr<double *, S>, DIM> MoFEM::getFTensor1FromArrayDiag ( MatrixDouble data,
const size_t  rr 
)
inline

Get FTensor1 from array.

Todo:
Generalise for diffrent arrays and data types
Template Parameters
DIM
Parameters
data
rr
Returns
FTensor::Tensor1<FTensor::PackPtr<double *, DIM>, DIM>

Definition at line 1233 of file Templates.hpp.

1233  {
1234  static_assert(DIM != DIM, "not implemented");
1236 }

◆ getFTensor1FromArrayDiag() [2/2]

template<>
FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > MoFEM::getFTensor1FromArrayDiag ( MatrixDouble data,
const size_t  rr 
)
inline

Definition at line 1240 of file Templates.hpp.

1240  {
1241  return FTensor::Tensor1<FTensor::PackPtr<double *, 2>, 2>{&data(rr + 0, 0),
1242  &data(rr + 1, 1)};
1243 }

◆ getFTensor1FromMat() [1/4]

template<int Tensor_Dim, int S = 1>
auto MoFEM::getFTensor1FromMat ( MatrixDouble data)
inline

Get tensor rank 1 (vector) form data matrix (specialization)

Definition at line 246 of file Templates.hpp.

246  {
247  return GetFTensor1FromMatImpl<Tensor_Dim, S, double, ublas::row_major,
248  DoubleAllocator>::get(data);
249 }

◆ getFTensor1FromMat() [2/4]

template<int DIM, int S>
FTensor::Tensor1<FTensor::PackPtr<double *, S>, DIM> MoFEM::getFTensor1FromMat ( MatrixDouble data,
const size_t  rr 
)
inline

Definition at line 1193 of file Templates.hpp.

1193  {
1194  return FTensor::Tensor1<FTensor::PackPtr<double *, 1>, 2>{&data(rr + 0, 0),
1195  &data(rr + 1, 0)};
1196 }

◆ getFTensor1FromMat() [3/4]

template<>
FTensor::Tensor1< FTensor::PackPtr< double *, 1 >, 9 > MoFEM::getFTensor1FromMat ( MatrixDouble data,
const size_t  rr 
)
inline

Definition at line 1193 of file Templates.hpp.

1193  {
1194  return FTensor::Tensor1<FTensor::PackPtr<double *, 1>, 2>{&data(rr + 0, 0),
1195  &data(rr + 1, 0)};
1196 }

◆ getFTensor1FromMat() [4/4]

template<int Tensor_Dim, int S = 1, class T , class L , class A >
FTensor::Tensor1<FTensor::PackPtr<T *, S>, Tensor_Dim> MoFEM::getFTensor1FromMat ( ublas::matrix< T, L, A > &  data)
inline

Get tensor rank 1 (vector) form data matrix.

Definition at line 238 of file Templates.hpp.

238  {
239  static_assert(!std::is_same<T, T>::value, "not implemented");
240 }

◆ getFTensor1FromPtr() [1/3]

template<int DIM, int S = DIM>
FTensor::Tensor1<FTensor::PackPtr<adouble *, S>, DIM> MoFEM::getFTensor1FromPtr ( adouble ptr)
inline

Definition at line 845 of file Templates.hpp.

845  {
846  return GetFTensor1FromPtrImpl<DIM, S, adouble>::get(ptr);
847 };

◆ getFTensor1FromPtr() [2/3]

template<int DIM, int S = DIM>
FTensor::Tensor1<FTensor::PackPtr<double *, S>, DIM> MoFEM::getFTensor1FromPtr ( double ptr)
inline

Make Tensor1 from pointer.

Template Parameters
DIM
Parameters
ptr
Returns
FTensor::Tensor2<FTensor::PackPtr<double *, 3 * DIM>, 3, DIM>

Definition at line 838 of file Templates.hpp.

838  {
839  return GetFTensor1FromPtrImpl<DIM, S, double>::get(ptr);
840 };

◆ getFTensor1FromPtr() [3/3]

template<int DIM, int S = DIM>
FTensor::Tensor1<FTensor::PackPtr<std::complex<double> *, S>, DIM> MoFEM::getFTensor1FromPtr ( std::complex< double > *  ptr)
inline

Definition at line 852 of file Templates.hpp.

852  {
853  return GetFTensor1FromPtrImpl<DIM, S, std::complex<double>>::get(ptr);
854 };

◆ getFTensor2FromArray() [1/3]

template<int DIM1, int DIM2, int S>
auto MoFEM::getFTensor2FromArray ( MatrixADouble data,
const size_t  rr 
)
inline

Definition at line 1351 of file Templates.hpp.

1351  {
1352  return GetFTensor2FromArrayImpl<DIM1, DIM2, S, adouble, ublas::row_major,
1353  VecAllocator<adouble>>::get(data, rr);
1354 }

◆ getFTensor2FromArray() [2/3]

template<int DIM1, int DIM2>
FTensor::Tensor2<double *, DIM1, DIM2> MoFEM::getFTensor2FromArray ( MatrixDouble data,
const size_t  rr,
const size_t  cc,
const int  ss 
)
inline

Definition at line 1327 of file Templates.hpp.

1328  {
1329  return GetFTensor2FromArrayRawPtrImpl<DIM1, DIM2, double, ublas::row_major,
1330  VecAllocator<double>>::get(data, rr, cc,
1331  ss);
1332 }

◆ getFTensor2FromArray() [3/3]

template<int DIM1, int DIM2, int S>
FTensor::Tensor2<FTensor::PackPtr<double *, S>, DIM1, DIM2> MoFEM::getFTensor2FromArray ( MatrixDouble data,
const size_t  rr,
const size_t  cc = 0 
)
inline

Definition at line 1320 of file Templates.hpp.

1320  {
1321  return GetFTensor2FromArrayImpl<DIM1, DIM2, S, double, ublas::row_major,
1322  VecAllocator<double>>::get(data, rr, cc);
1323 }

◆ getFTensor2FromArray2by2()

template<int S, typename T , typename L , typename A >
auto MoFEM::getFTensor2FromArray2by2 ( ublas::matrix< T, L, A > &  data,
const FTensor::Number< S > &  ,
const size_t  rr,
const size_t  cc = 0 
)
inline

Definition at line 1335 of file Templates.hpp.

1337  {
1338  return GetFTensor2FromArrayImpl<2, 2, S, T, L, A>::get(data, rr, cc);
1339 }

◆ getFTensor2FromArray3by3()

template<int S, typename T , typename L , typename A >
auto MoFEM::getFTensor2FromArray3by3 ( ublas::matrix< T, L, A > &  data,
const FTensor::Number< S > &  ,
const size_t  rr,
const size_t  cc = 0 
)
inline

Definition at line 1342 of file Templates.hpp.

1344  {
1345  return GetFTensor2FromArrayImpl<3, 3, S, T, L, A>::get(data, rr, cc);
1346 }

◆ getFTensor2FromMat()

template<int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor2<FTensor::PackPtr<double *, 1>, Tensor_Dim1, Tensor_Dim2> MoFEM::getFTensor2FromMat ( MatrixDouble data)
inline

Get tensor rank 2 (matrix) form data matrix.

Definition at line 278 of file Templates.hpp.

278  {
279  return GetFTensor2FromMatImpl<Tensor_Dim1, Tensor_Dim2, 1, double,
280  ublas::row_major, DoubleAllocator>::get(data);
281 }

◆ getFTensor2FromPtr() [1/2]

template<int DIM1, int DIM2, int S = DIM1 * DIM2>
auto MoFEM::getFTensor2FromPtr ( double ptr)
inline

Make Tensor2 from pointer.

Template Parameters
DIM
Parameters
ptr
Returns
FTensor::Tensor2<FTensor::PackPtr<double *, S>, DIM1, DIM2>

Definition at line 925 of file Templates.hpp.

925  {
926  return GetFTensor2FromPtr<DIM1, DIM2, S, double>::get(ptr);
927 };

◆ getFTensor2FromPtr() [2/2]

template<int DIM1, int DIM2, int S = DIM1 * DIM2>
auto MoFEM::getFTensor2FromPtr ( std::complex< double > *  ptr)
inline

Make Tensor2 from pointer.

Template Parameters
DIM
Parameters
ptr
Returns
FTensor::Tensor2<FTensor::PackPtr<double *, S>, DIM1, DIM2>

Definition at line 937 of file Templates.hpp.

937  {
938  return GetFTensor2FromPtr<DIM1, DIM2, S, std::complex<double>>::get(ptr);
939 };

◆ getFTensor2FromVec() [1/2]

template<int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor2<FTensor::PackPtr<double *, 1>, Tensor_Dim1, Tensor_Dim2> MoFEM::getFTensor2FromVec ( VectorDouble data)
inline

Template specialization for getFTensor2FromMat

Definition at line 292 of file Templates.hpp.

292  {
293  return FTensor::Tensor2<FTensor::PackPtr<double *, 1>, 1, 1>(&*data.begin());
294 }

◆ getFTensor2FromVec() [2/2]

template<>
FTensor::Tensor2<FTensor::PackPtr<double *, 1>, 1, 1> MoFEM::getFTensor2FromVec ( VectorDouble data)
inline

Template specialization for getFTensor2FromMat

Definition at line 292 of file Templates.hpp.

292  {
293  return FTensor::Tensor2<FTensor::PackPtr<double *, 1>, 1, 1>(&*data.begin());
294 }

◆ getFTensor2HVecFromPtr()

template<int DIM1, int DIM2>
FTensor::Tensor2<FTensor::PackPtr<double *, DIM1 * DIM2>, DIM1, DIM2> MoFEM::getFTensor2HVecFromPtr ( double ptr)
inline

Make Tensor2 for HVec base from pointer.

Template Parameters
DIM
Parameters
ptr
Returns
FTensor::Tensor2<FTensor::PackPtr<double *, DIM1 * DIM2>, DIM1, DIM2>

Definition at line 950 of file Templates.hpp.

950  {
951  static_assert(DIM1 == DIM1 || DIM2 != DIM2,
952  "Such getFTensor2HVecFromPtr is not implemented");
953 };

◆ getFTensor2HVecFromPtr< 3, 2 >()

template<>
FTensor::Tensor2<FTensor::PackPtr<double *, 6>, 3, 2> MoFEM::getFTensor2HVecFromPtr< 3, 2 > ( double ptr)
inline

Definition at line 957 of file Templates.hpp.

957  {
959  ptr + HVEC0_0, ptr + HVEC0_1,
960 
961  ptr + HVEC1_0, ptr + HVEC1_1,
962 
963  ptr + HVEC2_0, ptr + HVEC2_1);
964 };

◆ getFTensor2HVecFromPtr< 3, 3 >()

template<>
FTensor::Tensor2<FTensor::PackPtr<double *, 9>, 3, 3> MoFEM::getFTensor2HVecFromPtr< 3, 3 > ( double ptr)
inline

Definition at line 968 of file Templates.hpp.

968  {
970  ptr + HVEC0_0, ptr + HVEC0_1, ptr + HVEC0_2,
971 
972  ptr + HVEC1_0, ptr + HVEC1_1, ptr + HVEC1_2,
973 
974  ptr + HVEC2_0, ptr + HVEC2_1, ptr + HVEC2_2);
975 };

◆ getFTensor2SymmetricFromMat() [1/2]

template<int Tensor_Dim, int S = 1>
static auto MoFEM::getFTensor2SymmetricFromMat ( MatrixDouble data)
inlinestatic

Definition at line 339 of file Templates.hpp.

339  {
340  return getFTensor2SymmetricFromMat<Tensor_Dim, S, double, ublas::row_major,
341  DoubleAllocator>(data);
342 }

◆ getFTensor2SymmetricFromMat() [2/2]

template<int Tensor_Dim, int S, class T , class L , class A >
static auto MoFEM::getFTensor2SymmetricFromMat ( ublas::matrix< T, L, A > &  data)
inlinestatic

Get symmetric tensor rank 2 (matrix) form data matrix.

Definition at line 334 of file Templates.hpp.

334  {
335  return GetFTensor2SymmetricFromMatImpl<Tensor_Dim, S, T, L, A>::get(data);
336 }

◆ getFTensor2SymmetricFromPtr() [1/2]

template<int DIM>
FTensor::Tensor2_symmetric< FTensor::PackPtr<adouble *, (DIM * (DIM + 1)) / 2>, DIM> MoFEM::getFTensor2SymmetricFromPtr ( adouble ptr)
inline

Make symmetric Tensor2 from pointer.

Template Parameters
DIM
Parameters
ptr
Returns
FTensor::Tensor2<FTensor::PackPtr<double *, DIM1 * DIM2>, DIM1, DIM2>

Definition at line 1055 of file Templates.hpp.

1055  {
1056  static_assert(DIM, "Such getFTensor2SymmetricFromPtr is not implemented");
1057 }

◆ getFTensor2SymmetricFromPtr() [2/2]

template<int DIM>
FTensor::Tensor2_symmetric< FTensor::PackPtr<double *, (DIM * (DIM + 1)) / 2>, DIM> MoFEM::getFTensor2SymmetricFromPtr ( double ptr)
inline

Make symmetric Tensor2 from pointer.

Template Parameters
DIM
Parameters
ptr
Returns
FTensor::Tensor2<FTensor::PackPtr<double *, DIM1 * DIM2>, DIM1, DIM2>

Definition at line 1021 of file Templates.hpp.

1021  {
1022  static_assert(DIM, "Such getFTensor2SymmetricFromPtr is not implemented");
1023 }

◆ getFTensor2SymmetricFromPtr< 2 >() [1/2]

Definition at line 1072 of file Templates.hpp.

1072  {
1074  ptr + 0, ptr + 1, ptr + 2);
1075 };

◆ getFTensor2SymmetricFromPtr< 2 >() [2/2]

Definition at line 1038 of file Templates.hpp.

1038  {
1040  &ptr[0], &ptr[1], &ptr[2]);
1041 };

◆ getFTensor2SymmetricFromPtr< 3 >() [1/2]

Definition at line 1061 of file Templates.hpp.

1061  {
1063  ptr + 0, ptr + 1, ptr + 2,
1064 
1065  ptr + 3, ptr + 4,
1066 
1067  ptr + 5);
1068 };

◆ getFTensor2SymmetricFromPtr< 3 >() [2/2]

Definition at line 1027 of file Templates.hpp.

1027  {
1029  ptr + 0, ptr + 1, ptr + 2,
1030 
1031  ptr + 3, ptr + 4,
1032 
1033  ptr + 5);
1034 };

◆ getFTensor2SymmetricLowerFromPtr()

template<int DIM>
FTensor::Tensor2_symmetric<FTensor::PackPtr<double *, DIM * DIM>, DIM> MoFEM::getFTensor2SymmetricLowerFromPtr ( double ptr)
inline

Make symmetric Tensor2 from pointer, taking lower triangle of matrix.

Template Parameters
DIM
Parameters
ptr
Returns
FTensor::Tensor2<FTensor::PackPtr<double *, DIM1 * DIM2>, DIM1, DIM2>

Definition at line 1088 of file Templates.hpp.

1088  {
1089  static_assert(DIM,
1090  "Such getFTensor2SymmetricLowerFromPtr is not implemented");
1091 }

◆ getFTensor2SymmetricLowerFromPtr< 2 >()

Examples
plate.cpp.

Definition at line 1106 of file Templates.hpp.

1106  {
1108  ptr + 0, ptr + 1, ptr + 3);
1109 };

◆ getFTensor2SymmetricLowerFromPtr< 3 >()

Definition at line 1095 of file Templates.hpp.

1095  {
1097  ptr + HVEC0_0, ptr + HVEC0_1, ptr + HVEC0_2,
1098 
1099  ptr + HVEC1_0, ptr + HVEC1_1,
1100 
1101  ptr + HVEC2_2);
1102 };

◆ getFTensor3DgFromMat() [1/2]

template<int Tensor_Dim01, int Tensor_Dim2, int S = 1>
static auto MoFEM::getFTensor3DgFromMat ( MatrixDouble data)
inlinestatic

Definition at line 526 of file Templates.hpp.

526  {
527  return GetFTensor3DgFromMatImpl<Tensor_Dim01, Tensor_Dim2, S, double,
528  ublas::row_major, DoubleAllocator>::get(data);
529 }

◆ getFTensor3DgFromMat() [2/2]

template<int Tensor_Dim01, int Tensor_Dim2, int S = 1, class T , class L , class A >
static FTensor::Dg<FTensor::PackPtr<T *, 1>, Tensor_Dim01, Tensor_Dim2> MoFEM::getFTensor3DgFromMat ( ublas::matrix< T, L, A > &  data)
inlinestatic

Get symmetric tensor rank 3 on the first two indices from form data matrix.

Template Parameters
Tensor_Dim01dimension of first two indicies
Tensor_Dim2dimension of last index
Tthe type of object stored
Lthe storage organization
Athe type of Storage array
Parameters
datadata container
Returns
FTensor::Dg<FTensor::PackPtr<T *, 1>, Tensor_Dim01, TensorDim23>

Definition at line 520 of file Templates.hpp.

520  {
521  static_assert(!std::is_same<T, T>::value,
522  "Such getFTensor3DgFromMat specialisation is not implemented");
523 }

◆ getFTensor3FromMat() [1/2]

template<int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2, int S = 1>
static auto MoFEM::getFTensor3FromMat ( MatrixDouble data)
inlinestatic

Definition at line 782 of file Templates.hpp.

782  {
783  return GetFTensor3FromMatImpl<Tensor_Dim0, Tensor_Dim1, Tensor_Dim2, S,
785  DoubleAllocator>::get(data);
786 }

◆ getFTensor3FromMat() [2/2]

template<int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2, int S = 1, class T , class L , class A >
static FTensor::Tensor3<FTensor::PackPtr<T *, 1>, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2> MoFEM::getFTensor3FromMat ( ublas::matrix< T, L, A > &  data)
inlinestatic

Get tensor rank 3 (non symmetries) form data matrix.

Template Parameters
Tensor_Dim0dimension of first index
Tensor_Dim1dimension of second index
Tensor_Dim2dimension of third index
Sshift size
Tthe type of object stored
Lthe storage organization
Athe type of Storage array
Parameters
datadata container
Returns
FTensor::Tensor3<FTensor::PackPtr<T *, 1>, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2>

Definition at line 776 of file Templates.hpp.

776  {
777  static_assert(!std::is_same<T, T>::value,
778  "Such getFTensor3FromMat specialisation is not implemented");
779 }

◆ getFTensor3FromPtr()

template<int DIM1, int DIM2, int DIM3>
FTensor::Tensor3<FTensor::PackPtr<double *, DIM1 * DIM2 * DIM3>, DIM1, DIM2, DIM3> MoFEM::getFTensor3FromPtr ( double ptr)
inline

Definition at line 988 of file Templates.hpp.

988  {
989  static_assert(DIM1 == DIM1 || DIM2 != DIM2 || DIM3 != DIM3,
990  "Such getFTensor3FromPtr is not implemented");
991 };

◆ getFTensor3FromPtr< 3, 2, 2 >()

template<>
FTensor::Tensor3<FTensor::PackPtr<double *, 12>, 3, 2, 2> MoFEM::getFTensor3FromPtr< 3, 2, 2 > ( double ptr)
inline

Definition at line 995 of file Templates.hpp.

995  {
997  ptr + 0, ptr + 1, ptr + 2, ptr + 3, ptr + 4, ptr + 5, ptr + 6, ptr + 7,
998  ptr + 8, ptr + 9, ptr + 10, ptr + 11);
999 };

◆ getFTensor3FromPtr< 3, 3, 3 >()

template<>
FTensor::Tensor3<FTensor::PackPtr<double *, 27>, 3, 3, 3> MoFEM::getFTensor3FromPtr< 3, 3, 3 > ( double ptr)
inline

Definition at line 1003 of file Templates.hpp.

1003  {
1005  ptr + 0, ptr + 1, ptr + 2, ptr + 3, ptr + 4, ptr + 5, ptr + 6, ptr + 7,
1006  ptr + 8, ptr + 9, ptr + 10, ptr + 11, ptr + 12, ptr + 13, ptr + 14,
1007  ptr + 15, ptr + 16, ptr + 17, ptr + 18, ptr + 19, ptr + 20, ptr + 21,
1008  ptr + 22, ptr + 23, ptr + 24, ptr + 25, ptr + 26);
1009 };

◆ getFTensor4DdgFromMat() [1/2]

template<int Tensor_Dim01, int Tensor_Dim23, int S = 1>
static auto MoFEM::getFTensor4DdgFromMat ( MatrixDouble data)
inlinestatic

Definition at line 424 of file Templates.hpp.

424  {
425  return GetFTensor4DdgFromMatImpl<Tensor_Dim01, Tensor_Dim23, S, double,
427  DoubleAllocator>::get(data);
428 }

◆ getFTensor4DdgFromMat() [2/2]

template<int Tensor_Dim01, int Tensor_Dim23, int S = 1, class T , class L , class A >
static FTensor::Ddg<FTensor::PackPtr<T *, 1>, Tensor_Dim01, Tensor_Dim23> MoFEM::getFTensor4DdgFromMat ( ublas::matrix< T, L, A > &  data)
inlinestatic

Get symmetric tensor rank 4 on first two and last indices from form data matrix.

Template Parameters
Tensor_Dim01dimension of first two indicies
Tensor_Dim23dimension of second two indicies
Memoryshift
Tthe type of object stored
Lthe storage organization
Athe type of Storage array
Parameters
datadata container
Returns
FTensor::Ddg<FTensor::PackPtr<T *, 1>, Tensor_Dim01, TensorDim23>

Definition at line 418 of file Templates.hpp.

418  {
419  static_assert(!std::is_same<T, T>::value,
420  "Such getFTensor4DdgFromMat specialisation is not implemented");
421 }

◆ getFTensor4DdgFromPtr()

template<int Tensor_Dim01, int Tensor_Dim23, int S = 1, class T = double>
static auto MoFEM::getFTensor4DdgFromPtr ( T *  ptr)
inlinestatic

Definition at line 447 of file Templates.hpp.

447  {
448  return GetFTensor4DdgFromPtrImpl<Tensor_Dim01, Tensor_Dim23, S, T>::get(ptr);
449 }

◆ getFTensor4FromMat() [1/2]

template<int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2, int Tensor_Dim3, int S = 1>
static auto MoFEM::getFTensor4FromMat ( MatrixDouble data)
inlinestatic

Definition at line 627 of file Templates.hpp.

627  {
628  return GetFTensor4FromMatImpl<Tensor_Dim0, Tensor_Dim1, Tensor_Dim2,
629  Tensor_Dim3, S, double, ublas::row_major,
630  DoubleAllocator>::get(data);
631 }

◆ getFTensor4FromMat() [2/2]

template<int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2, int Tensor_Dim3, int S = 1, class T , class L , class A >
static FTensor::Tensor4<FTensor::PackPtr<T *, 1>, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2, Tensor_Dim3> MoFEM::getFTensor4FromMat ( ublas::matrix< T, L, A > &  data)
inlinestatic

Get tensor rank 4 (non symmetric) form data matrix.

Template Parameters
Tensor_Dim0dimension of frirst index
Tensor_Dim1dimension of second index
Tensor_Dim2dimension of third index
Tensor_Dim3dimension of fourth index
Tthe type of object stored
Lthe storage organization
Athe type of Storage array
Parameters
datadata container
Returns
FTensor::Tensor4<FTensor::PackPtr<T *, 1>, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2, Tensor_Dim3>

Definition at line 620 of file Templates.hpp.

620  {
621  static_assert(!std::is_same<T, T>::value,
622  "Such getFTensor4FromMat specialisation is not implemented");
623 }

◆ getInterfacePtr()

auto MoFEM::getInterfacePtr ( DM  dm)
inline

Get the Interface Ptr object.

Parameters
dm
Returns
auto

Definition at line 1033 of file DMMoFEM.hpp.

1033  {
1034  MoFEM::Interface *m_field_ptr;
1035  CHK_THROW_MESSAGE(DMoFEMGetInterfacePtr(dm, &m_field_ptr),
1036  "Can not get interface ptr from DM");
1037  return m_field_ptr;
1038 };

◆ getLocalCoordinatesOnReferenceThreeNodeTriImpl()

template<typename T1 , typename T2 >
MoFEMErrorCode MoFEM::getLocalCoordinatesOnReferenceThreeNodeTriImpl ( const T1 *  elem_coords,
const T2 *  global_coords,
const int  nb_nodes,
typename FTensor::promote< T1, T2 >::V *  local_coords 
)

Definition at line 141 of file Tools.cpp.

143  {
144 
150 
151  FTensor::Tensor1<const double, 3> t_n = {Tools::shapeFunMBTRIAt00[0],
152  Tools::shapeFunMBTRIAt00[1],
153  Tools::shapeFunMBTRIAt00[2]};
154  auto t_diff = getFTensor2FromPtr<3, 2>(
155  const_cast<double *>(Tools::diffShapeFunMBTRI.data()));
156  auto t_elem_coords = getFTensor2FromPtr<3, 3>(const_cast<T1 *>(elem_coords));
157 
158  // Build matrix and get coordinates of zero point
160  t_a(K2, i3) = t_diff(j3, K2) * t_elem_coords(j3, i3);
162  t_b(K2, L2) = t_a(K2, j3) ^ t_a(L2, j3);
163  // Solve problem
164  const auto inv_det = 1. / (t_b(0, 0) * t_b(1, 1) - t_b(0, 1) * t_b(1, 0));
165  t_inv_b(0, 0) = t_b(1, 1) * inv_det;
166  t_inv_b(0, 1) = -t_b(0, 1) * inv_det;
167  t_inv_b(1, 1) = t_b(0, 0) * inv_det;
168 
169  // Coords at corner
170  FTensor::Tensor1<T1, 3> t_coords_at_0;
171  t_coords_at_0(i3) = t_n(j3) * t_elem_coords(j3, i3);
172 
173  auto t_global_coords = getFTensor1FromPtr<3>(const_cast<T2 *>(global_coords));
174  auto t_local_coords = getFTensor1FromPtr<2>(local_coords);
175 
176  // Calculate right hand side
177  for (int ii = 0; ii != nb_nodes; ++ii) {
178  t_local_coords(L2) =
179  t_inv_b(L2, K2) *
180  (t_a(K2, j3) * (t_global_coords(j3) - t_coords_at_0(j3)));
181  ++t_local_coords;
182  ++t_global_coords;
183  }
184 
186 }

◆ getMatrixAdaptor()

template<typename T1 >
auto MoFEM::getMatrixAdaptor ( T1  ptr,
const size_t  n,
const size_t  m 
)
inline

Get Matrix adaptor.

double *a;
CHKERR VecGetArray(v,&a);
for(int n = 0; n != nodes; ++n) {
auto F = getMatrixAdaptor(&a[3*3*n], 3, 3);
MatrixDouble C = prod(F, trans(F));
}
CHKERR VecRetsoreArray(v,&a);
Examples
field_evaluator.cpp.

Definition at line 57 of file Templates.hpp.

57  {
58  typedef typename std::remove_pointer<T1>::type T;
59  return MatrixShallowArrayAdaptor<T>(
60  n, m, ublas::shallow_array_adaptor<T>(n * m, ptr));
61 };

◆ getMaxOrder()

template<typename ENTMULTIINDEX >
static int MoFEM::getMaxOrder ( const ENTMULTIINDEX &  multi_index)
inlinestatic

Definition at line 110 of file ForcesAndSourcesCore.cpp.

110  {
111  int max_order = 0;
112  for (auto ent_field_weak_ptr : multi_index)
113  if (auto e = ent_field_weak_ptr.lock()) {
114  const int order = e->getMaxOrder();
115  max_order = (max_order < order) ? order : max_order;
116  }
117  return max_order;
118 }

◆ getNestSchurData()

DEPRECATED boost::shared_ptr<NestSchurData> MoFEM::getNestSchurData ( std::pair< SmartPetscObj< DM >, SmartPetscObj< DM >>  dms,
boost::shared_ptr< BlockStructure block_mat_data,
std::vector< std::string >  fields_name,
std::vector< boost::shared_ptr< Range >>  field_ents,
bool  add_preconditioner_block = false 
)
inline
Deprecated:
do not use, use createSchurNestedMatrixStruture instead

Definition at line 355 of file Schur.hpp.

362  {
363  return createSchurNestedMatrixStruture(dms, block_mat_data, fields_name,
364  field_ents, add_preconditioner_block);
365 }

◆ getPetscObject()

template<typename T >
PetscObject MoFEM::getPetscObject ( obj)
inline
Examples
free_surface.cpp.

Definition at line 9 of file PetscSmartObj.hpp.

9  {
10  return reinterpret_cast<PetscObject>(obj);
11 }

◆ getProblemPtr()

auto MoFEM::getProblemPtr ( DM  dm)
inline

get problem pointer from DM

Examples
free_surface.cpp, and level_set.cpp.

Definition at line 1044 of file DMMoFEM.hpp.

1044  {
1045  const MoFEM::Problem *problem_ptr;
1046  CHK_THROW_MESSAGE(DMMoFEMGetProblemPtr(dm, &problem_ptr),
1047  "Get cot get problem ptr from DM");
1048  return problem_ptr;
1049 };

◆ getVectorAdaptor()

template<typename T1 >
auto MoFEM::getVectorAdaptor ( T1  ptr,
const size_t  n 
)
inline

Get Vector adaptor.

double *a;
CHKERR VecGetArray(v,&a);
for(int n = 0; n != nodes; ++n) {
auto a = getVectorAdaptor(&a[3*n], 3);
double dot = inner_prod(a, a);
}
CHKERR VecRetsoreArray(v,&a);
Examples
ADOLCPlasticity.hpp, and bernstein_bezier_generate_base.cpp.

Definition at line 31 of file Templates.hpp.

31  {
32  typedef typename std::remove_pointer<T1>::type T;
33  return VectorShallowArrayAdaptor<T>(n,
34  ublas::shallow_array_adaptor<T>(n, ptr));
35 };

◆ Hcurl_Ainsworth_BubbleFaceFunctions_MBTET()

MoFEMErrorCode MoFEM::Hcurl_Ainsworth_BubbleFaceFunctions_MBTET ( int *  faces_nodes,
int *  p,
double N,
double diffN,
double phi_f[4],
double diff_phi_f[4],
int  nb_integration_pts,
PetscErrorCode(*)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)  base_polynomials 
)

Face edge base functions of Hcurl space on face on tetrahedral.

On each face we have P*(P-1) base functions and are 4 faces.

See NBFACETRI_AINSWORTH_EDGE_HCURL

Parameters
face_nodesarray [4*3] of local indices of face nodes
papproximation order
Narray shape functions evaluated at each integration point
diffNderivatives of nodal shape functions
phi_f[4]calculated shape functions for each face
diff_phi_v[4]derivatives of shape functions for each face
nb_integration_ptsnumber of shape functions
base_polynomialspolynomial base function (f.e. Legendre of Lobatto)
Returns
error code

Definition at line 545 of file Hcurl.cpp.

550  {
551 
553 
556 
557  // double coords[] = { 0,0,0, 1,0,0, 0,1,0, 0,0,1 };
558  // FTensor::Tensor1<double*,3> t_coords[4] = {
559  // FTensor::Tensor1<double*,3>(&coords[0],&coords[ 1],&coords[ 2]),
560  // FTensor::Tensor1<double*,3>(&coords[3],&coords[ 4],&coords[ 5]),
561  // FTensor::Tensor1<double*,3>(&coords[6],&coords[ 7],&coords[ 8]),
562  // FTensor::Tensor1<double*,3>(&coords[9],&coords[10],&coords[11])
563  // };
564  FTensor::Tensor1<double *, 3> t_node_diff_ksi[4] = {
565  FTensor::Tensor1<double *, 3>(&diffN[0], &diffN[1], &diffN[2]),
566  FTensor::Tensor1<double *, 3>(&diffN[3], &diffN[4], &diffN[5]),
567  FTensor::Tensor1<double *, 3>(&diffN[6], &diffN[7], &diffN[8]),
568  FTensor::Tensor1<double *, 3>(&diffN[9], &diffN[10], &diffN[11])};
569  FTensor::Tensor1<double, 3> t_diff_ksi0i, t_diff_ksi0j;
570  FTensor::Tensor1<double, 3> diff_beta_0ij;
571 
574 
575  for (int ff = 0; ff != 4; ff++) {
576 
577  if (NBFACETRI_AINSWORTH_FACE_HCURL(p[ff]) == 0)
578  continue;
579 
580  int n0 = faces_nodes[3 * ff + 0];
581  int n1 = faces_nodes[3 * ff + 1];
582  int n2 = faces_nodes[3 * ff + 2];
583 
584  // tou_0i(i) = t_coords[n1](i)-t_coords[n0](i);
585  // tou_0j(i) = t_coords[n2](i)-t_coords[n0](i);
586  tou_0i(i) = t_node_diff_ksi[n1](i) - t_node_diff_ksi[n0](i);
587  tou_0j(i) = t_node_diff_ksi[n2](i) - t_node_diff_ksi[n0](i);
588 
589  t_diff_ksi0i(i) = t_node_diff_ksi[n1](i) - t_node_diff_ksi[n0](i);
590  t_diff_ksi0j(i) = t_node_diff_ksi[n2](i) - t_node_diff_ksi[n0](i);
591 
592  double psi_l_0i[p[ff] + 1], diff_psi_l_0i[3 * p[ff] + 3];
593  double psi_l_0j[p[ff] + 1], diff_psi_l_0j[3 * p[ff] + 3];
594 
595  FTensor::Tensor1<double *, 3> t_phi_f(&phi_f[ff][0], &phi_f[ff][1],
596  &phi_f[ff][2], 3);
598  &diff_phi_f[ff][0], &diff_phi_f[ff][3], &diff_phi_f[ff][6],
599  &diff_phi_f[ff][1], &diff_phi_f[ff][4], &diff_phi_f[ff][7],
600  &diff_phi_f[ff][2], &diff_phi_f[ff][5], &diff_phi_f[ff][8], 9);
602 
603  for (int ii = 0; ii != nb_integration_pts; ii++) {
604 
605  const int node_shift = ii * 4;
606  const double beta_0ij =
607  N[node_shift + n0] * N[node_shift + n1] * N[node_shift + n2];
608  diff_beta_0ij(i) =
609  t_node_diff_ksi[n0](i) * N[node_shift + n1] * N[node_shift + n2] +
610  N[node_shift + n0] * t_node_diff_ksi[n1](i) * N[node_shift + n2] +
611  N[node_shift + n0] * N[node_shift + n1] * t_node_diff_ksi[n2](i);
612 
613  const double ksi_0i = N[node_shift + n1] - N[node_shift + n0];
614  CHKERR base_polynomials(p[ff], ksi_0i, &t_diff_ksi0i(0), psi_l_0i,
615  diff_psi_l_0i, 3);
616 
617  const double ksi_0j = N[node_shift + n2] - N[node_shift + n0];
618  CHKERR base_polynomials(p[ff], ksi_0j, &t_diff_ksi0j(0), psi_l_0j,
619  diff_psi_l_0j, 3);
620 
621  int cc = 0;
622  for (int oo = 0; oo <= (p[ff] - 3); oo++) {
623  FTensor::Tensor1<double *, 3> t_diff_psi_l_0i(
624  &diff_psi_l_0i[0], &diff_psi_l_0i[p[ff] + 1],
625  &diff_psi_l_0i[2 * p[ff] + 2], 1);
626  for (int pp0 = 0; pp0 <= oo; pp0++) {
627  const int pp1 = oo - pp0;
628  if (pp1 >= 0) {
629  FTensor::Tensor1<double *, 3> t_diff_psi_l_0j(
630  &diff_psi_l_0j[pp1], &diff_psi_l_0j[p[ff] + 1 + pp1],
631  &diff_psi_l_0j[2 * p[ff] + 2 + pp1], 1);
632  // base functions
633  const double a = beta_0ij * psi_l_0i[pp0] * psi_l_0j[pp1];
634  t_phi_f(i) = a * tou_0i(i);
635  ++t_phi_f;
636  ++cc;
637  t_phi_f(i) = a * tou_0j(i);
638  ++t_phi_f;
639  ++cc;
640  // diff base functions
641  t_b(j) = diff_beta_0ij(j) * psi_l_0i[pp0] * psi_l_0j[pp1] +
642  beta_0ij * t_diff_psi_l_0i(j) * psi_l_0j[pp1] +
643  beta_0ij * psi_l_0i[pp0] * t_diff_psi_l_0j(j);
644  t_diff_phi_f(i, j) = t_b(j) * tou_0i(i);
645  ++t_diff_phi_f;
646  t_diff_phi_f(i, j) = t_b(j) * tou_0j(i);
647  ++t_diff_phi_f;
648  ++t_diff_psi_l_0i;
649  }
650  }
651  }
652  const int nb_base_fun_on_face = NBFACETRI_AINSWORTH_FACE_HCURL(p[ff]);
653  if (cc != nb_base_fun_on_face) {
654  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
655  "Wrong number of base functions %d != %d", cc,
656  nb_base_fun_on_face);
657  }
658  }
659  }
661 }

◆ Hcurl_Ainsworth_BubbleFaceFunctions_MBTET_ON_FACE()

MoFEMErrorCode MoFEM::Hcurl_Ainsworth_BubbleFaceFunctions_MBTET_ON_FACE ( int *  faces_nodes,
int  p,
double N,
double diffN,
double phi_f,
double diff_phi_f,
int  nb_integration_pts,
PetscErrorCode(*)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)  base_polynomials 
)

Face edge base functions of Hcurl space on face.

On each face we have P*(P-1) base functions and are 4 faces.

See NBFACETRI_AINSWORTH_EDGE_HCURL

Parameters
face_nodesarray [4*3] of local indices of face nodes
papproximation order
Narray shape functions evaluated at each integration point
diffNderivatives of nodal shape functions
phi_f[4]calculated shape functions for each face
diff_phi_v[4]derivatives of shape functions for each face
nb_integration_ptsnumber of shape functions
base_polynomialspolynomial base function (f.e. Legendre of Lobatto)
Returns
error code

Definition at line 663 of file Hcurl.cpp.

668  {
669 
671 
672  double zero = 0;
673  FTensor::Tensor2<double *, 3, 3> t_node_diff_ksi(&diffN[0], &diffN[1], &zero,
674  &diffN[2], &diffN[3], &zero,
675  &diffN[4], &diffN[5], &zero);
676 
679 
680  if (NBFACETRI_AINSWORTH_FACE_HCURL(p) == 0)
682 
686 
687  const int node0 = faces_nodes[0];
688  const int node1 = faces_nodes[1];
689  const int node2 = faces_nodes[2];
690 
693 
694  tou_0i(i) = t_node_diff_ksi(N1, i) - t_node_diff_ksi(N0, i);
695  ;
696  tou_0j(i) = t_node_diff_ksi(N2, i) - t_node_diff_ksi(N0, i);
697  ;
698 
699  double psi_l_0i[p + 1], psi_l_0j[p + 1];
700  double diff_psi_l_0i[2 * p + 2], diff_psi_l_0j[2 * p + 2];
701  FTensor::Tensor1<double *, 3> t_phi_f(&phi_f[0], &phi_f[1], &phi_f[2], 3);
703  &diff_phi_f[HVEC0_0], &diff_phi_f[HVEC0_1], &diff_phi_f[HVEC1_0],
704  &diff_phi_f[HVEC1_1], &diff_phi_f[HVEC2_0], &diff_phi_f[HVEC2_1]);
705 
706  double diff_ksi_0i[] = {t_node_diff_ksi(node1, 0) - t_node_diff_ksi(node0, 0),
707  t_node_diff_ksi(node1, 1) -
708  t_node_diff_ksi(node0, 1)};
709  double diff_ksi_0j[] = {t_node_diff_ksi(node2, 0) - t_node_diff_ksi(node0, 0),
710  t_node_diff_ksi(node2, 1) -
711  t_node_diff_ksi(node0, 1)};
712 
713  for (int ii = 0; ii != nb_integration_pts; ii++) {
714 
715  const int node_shift = ii * 3;
716  const double n0 = N[node_shift + node0];
717  const double n1 = N[node_shift + node1];
718  const double n2 = N[node_shift + node2];
719 
720  const double beta_0ij = n0 * n1 * n2;
721  FTensor::Tensor1<double, 2> diff_beta_0ij(
722  t_node_diff_ksi(node0, 0) * n1 * n2 +
723  n0 * t_node_diff_ksi(node1, 0) * n2 +
724  n0 * n1 * t_node_diff_ksi(node2, 0),
725  t_node_diff_ksi(node0, 1) * n1 * n2 +
726  n0 * t_node_diff_ksi(node1, 1) * n2 +
727  n0 * n1 * t_node_diff_ksi(node2, 1));
728 
729  const double ksi_0i = N[node_shift + node1] - N[node_shift + node0];
730  CHKERR base_polynomials(p, ksi_0i, diff_ksi_0i, psi_l_0i, diff_psi_l_0i, 2);
731 
732  const double ksi_0j = N[node_shift + node2] - N[node_shift + node0];
733  CHKERR base_polynomials(p, ksi_0j, diff_ksi_0j, psi_l_0j, diff_psi_l_0j, 2);
734 
735  int cc = 0;
737  for (int oo = 0; oo <= (p - 3); oo++) {
738  for (int pp0 = 0; pp0 <= oo; pp0++) {
739  const int pp1 = oo - pp0;
740  if (pp1 >= 0) {
741  FTensor::Tensor1<double, 2> t_diff_psi_l_0i(
742  diff_psi_l_0i[0 + pp0], diff_psi_l_0i[p + 1 + pp0]);
743  FTensor::Tensor1<double, 2> t_diff_psi_l_0j(
744  diff_psi_l_0j[0 + pp1], diff_psi_l_0j[p + 1 + pp1]);
745  const double a = beta_0ij * psi_l_0i[pp0] * psi_l_0j[pp1];
746  t_diff_a(j) = diff_beta_0ij(j) * psi_l_0i[pp0] * psi_l_0j[pp1] +
747  beta_0ij * psi_l_0i[pp0] * t_diff_psi_l_0j(j) +
748  beta_0ij * psi_l_0j[pp1] * t_diff_psi_l_0i(j);
749 
750  t_phi_f(i) = a * tou_0i(i);
751  t_diff_phi_f(i, j) = tou_0i(i) * t_diff_a(j);
752  ++t_phi_f;
753  ++t_diff_phi_f;
754  ++cc;
755  t_phi_f(i) = a * tou_0j(i);
756  t_diff_phi_f(i, j) = tou_0j(i) * t_diff_a(j);
757  ++t_phi_f;
758  ++t_diff_phi_f;
759  ++cc;
760  }
761  }
762  }
763 
764  const int nb_base_fun_on_face = NBFACETRI_AINSWORTH_FACE_HCURL(p);
765  if (cc != nb_base_fun_on_face) {
766  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
767  "Wrong number of base functions %d != %d", cc,
768  nb_base_fun_on_face);
769  }
770  }
771 
773 }

◆ Hcurl_Ainsworth_EdgeBasedFaceFunctions_MBTET()

MoFEMErrorCode MoFEM::Hcurl_Ainsworth_EdgeBasedFaceFunctions_MBTET ( int *  faces_nodes,
int *  p,
double N,
double diffN,
double phi_f_e[4][3],
double diff_phi_f_e[4][3],
int  nb_integration_pts,
PetscErrorCode(*)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)  base_polynomials 
)

Face edge base functions of Hcurl space on tetrahedral.

On each edge we have (P-1) base functions, and each face has 3 edges and are 4 faces on tetrahedral.

See NBFACETRI_AINSWORTH_EDGE_HCURL

Parameters
face_nodesarray [4*3] of local indices of face nodes
papproximation order
Narray shape functions evaluated at each integration point
diffNderivatives of nodal shape functions
phi_f[4]calculated shape functions for each face
diff_phi_v[4]derivatives of shape functions for each face
nb_integration_ptsnumber of shape functions
base_polynomialspolynomial base function (f.e. Legendre of Lobatto)
Returns
error code

Definition at line 363 of file Hcurl.cpp.

368  {
369 
371  const int edges[3][2] = {{0, 1}, {1, 2}, {2, 0}};
372 
375 
376  FTensor::Tensor1<double *, 3> t_node_diff_ksi[4] = {
377  FTensor::Tensor1<double *, 3>(&diffN[0], &diffN[1], &diffN[2]),
378  FTensor::Tensor1<double *, 3>(&diffN[3], &diffN[4], &diffN[5]),
379  FTensor::Tensor1<double *, 3>(&diffN[6], &diffN[7], &diffN[8]),
380  FTensor::Tensor1<double *, 3>(&diffN[9], &diffN[10], &diffN[11])};
381  FTensor::Tensor1<double, 3> t_edge_diff_ksi;
382  FTensor::Tensor1<double, 3> t_diff_beta_e;
383 
384  for (int ff = 0; ff != 4; ff++) {
385 
386  const int o_nodes[3] = {faces_nodes[3 * ff + 2], faces_nodes[3 * ff + 0],
387  faces_nodes[3 * ff + 1]};
388  FTensor::Tensor1<double *, 3> t_opposite_node_diff[3] = {
389  FTensor::Tensor1<double *, 3>(&diffN[3 * o_nodes[0] + 0],
390  &diffN[3 * o_nodes[0] + 1],
391  &diffN[3 * o_nodes[0] + 2]),
392  FTensor::Tensor1<double *, 3>(&diffN[3 * o_nodes[1] + 0],
393  &diffN[3 * o_nodes[1] + 1],
394  &diffN[3 * o_nodes[1] + 2]),
395  FTensor::Tensor1<double *, 3>(&diffN[3 * o_nodes[2] + 0],
396  &diffN[3 * o_nodes[2] + 1],
397  &diffN[3 * o_nodes[2] + 2])};
398  double psi_l[p[ff] + 1], diff_psi_l[3 * p[ff] + 3];
399 
400  const int nb_base_fun_on_face = NBFACETRI_AINSWORTH_EDGE_HCURL(p[ff]);
401  // cerr << nb_base_fun_on_face << " " << p[ff] << endl;
402  if (nb_base_fun_on_face == 0)
403  continue;
404 
405  for (int ee = 0; ee != 3; ee++) {
406 
407  FTensor::Tensor1<double *, 3> t_face_edge_base(
408  &phi_f_e[ff][ee][0], &phi_f_e[ff][ee][1], &phi_f_e[ff][ee][2], 3);
409  FTensor::Tensor2<double *, 3, 3> t_diff_face_edge_base(
410  &diff_phi_f_e[ff][ee][0], &diff_phi_f_e[ff][ee][3],
411  &diff_phi_f_e[ff][ee][6], &diff_phi_f_e[ff][ee][1],
412  &diff_phi_f_e[ff][ee][4], &diff_phi_f_e[ff][ee][7],
413  &diff_phi_f_e[ff][ee][2], &diff_phi_f_e[ff][ee][5],
414  &diff_phi_f_e[ff][ee][8], 9);
415  const int en[] = {faces_nodes[3 * ff + edges[ee][0]],
416  faces_nodes[3 * ff + edges[ee][1]]};
417  t_edge_diff_ksi(i) =
418  t_node_diff_ksi[en[1]](i) - t_node_diff_ksi[en[0]](i);
419 
420  for (int ii = 0; ii != nb_integration_pts; ii++) {
421 
422  const int node_shift = ii * 4;
423  const double n[] = {N[node_shift + faces_nodes[3 * ff + edges[ee][0]]],
424  N[node_shift + faces_nodes[3 * ff + edges[ee][1]]]};
425  const double ksi_0i = n[1] - n[0];
426  CHKERR base_polynomials(p[ff], ksi_0i, &t_edge_diff_ksi(0), psi_l,
427  diff_psi_l, 3);
428 
429  FTensor::Tensor1<double *, 3> t_diff_psi_l(
430  &diff_psi_l[0], &diff_psi_l[p[ff] + 1], &diff_psi_l[2 * p[ff] + 2],
431  1);
432 
433  const double beta_e = n[0] * n[1];
434  t_diff_beta_e(j) =
435  t_node_diff_ksi[en[0]](j) * n[1] + n[0] * t_node_diff_ksi[en[1]](j);
436 
437  for (int ll = 0; ll != nb_base_fun_on_face; ll++) {
438  // if(ll == nb_base_fun_on_face-1) cerr << psi_l[ll] << endl;
439 
440  t_face_edge_base(i) =
441  beta_e * psi_l[ll] * t_opposite_node_diff[ee](i);
442  ++t_face_edge_base;
443 
444  t_diff_face_edge_base(i, j) =
445  (beta_e * t_diff_psi_l(j) + t_diff_beta_e(j) * psi_l[ll]) *
446  t_opposite_node_diff[ee](i);
447 
448  ++t_diff_face_edge_base;
449  ++t_diff_psi_l;
450  }
451  }
452  }
453  }
454 
456 }

◆ Hcurl_Ainsworth_EdgeBasedFaceFunctions_MBTET_ON_FACE()

MoFEMErrorCode MoFEM::Hcurl_Ainsworth_EdgeBasedFaceFunctions_MBTET_ON_FACE ( int *  faces_nodes,
int  p,
double N,
double diffN,
double phi_f_e[3],
double diff_phi_f_e[3],
int  nb_integration_pts,
PetscErrorCode(*)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)  base_polynomials 
)

Face edge base functions of Hcurl space.

On each edge we have (P-1) base functions, and each face has 3 edges and are 4 faces on tetrahedral.

See NBFACETRI_AINSWORTH_EDGE_HCURL

Parameters
face_nodesarray [4*3] of local indices of face nodes
papproximation order
Narray shape functions evaluated at each integration point
diffNderivatives of nodal shape functions
phi_f[4]calculated shape functions for each face
diff_phi_v[4]derivatives of shape functions for each face
nb_integration_ptsnumber of shape functions
base_polynomialspolynomial base function (f.e. Legendre of Lobatto)
Returns
error code

Definition at line 458 of file Hcurl.cpp.

463  {
464 
466 
467  const int nb_base_fun_on_face = NBFACETRI_AINSWORTH_EDGE_HCURL(p);
468  if (nb_base_fun_on_face == 0)
470 
471  const int edges[3][2] = {{0, 1}, {1, 2}, {2, 0}};
472 
475 
476  const int o_nodes[3] = {2, 0, 1};
477  FTensor::Tensor2<double, 3, 3> t_opposite_node_diff(
478  diffN[2 * o_nodes[0] + 0], diffN[2 * o_nodes[0] + 1], 0.,
479  diffN[2 * o_nodes[1] + 0], diffN[2 * o_nodes[1] + 1], 0.,
480  diffN[2 * o_nodes[2] + 0], diffN[2 * o_nodes[2] + 1], 0.);
481  double psi_l[p + 1];
482  double diff_psi_l[2 * p + 2];
483 
484  FTensor::Tensor1<double *, 3> t_face_edge_base[3] = {
485  FTensor::Tensor1<double *, 3>(&phi_f_e[0][HVEC0], &phi_f_e[0][HVEC1],
486  &phi_f_e[0][HVEC2], 3),
487  FTensor::Tensor1<double *, 3>(&phi_f_e[1][HVEC0], &phi_f_e[1][HVEC1],
488  &phi_f_e[1][HVEC2], 3),
489  FTensor::Tensor1<double *, 3>(&phi_f_e[2][HVEC0], &phi_f_e[2][HVEC1],
490  &phi_f_e[2][HVEC2], 3),
491  };
493  t_diff_face_edge_base[3] = {
495  &diff_phi_f_e[0][HVEC0_0], &diff_phi_f_e[0][HVEC0_1],
496  &diff_phi_f_e[0][HVEC1_0], &diff_phi_f_e[0][HVEC1_1],
497  &diff_phi_f_e[0][HVEC2_0], &diff_phi_f_e[0][HVEC2_1]),
499  &diff_phi_f_e[1][HVEC0_0], &diff_phi_f_e[1][HVEC0_1],
500  &diff_phi_f_e[1][HVEC1_0], &diff_phi_f_e[1][HVEC1_1],
501  &diff_phi_f_e[1][HVEC2_0], &diff_phi_f_e[1][HVEC2_1]),
503  &diff_phi_f_e[2][HVEC0_0], &diff_phi_f_e[2][HVEC0_1],
504  &diff_phi_f_e[2][HVEC1_0], &diff_phi_f_e[2][HVEC1_1],
505  &diff_phi_f_e[2][HVEC2_0], &diff_phi_f_e[2][HVEC2_1])};
506 
507  for (int ee = 0; ee != 3; ee++) {
508 
509  const int node0 = faces_nodes[edges[ee][0]];
510  const int node1 = faces_nodes[edges[ee][1]];
511  double diff_ksi0i[] = {diffN[2 * node1 + 0] - diffN[2 * node0 + 0],
512  diffN[2 * node1 + 1] - diffN[2 * node0 + 1]};
513 
514  for (int ii = 0; ii != nb_integration_pts; ii++) {
515 
516  const int node_shift = ii * 3;
517  const double n0 = N[node_shift + node0];
518  const double n1 = N[node_shift + node1];
519  const double ksi_0i = n1 - n0;
520  CHKERR base_polynomials(p, ksi_0i, diff_ksi0i, psi_l, diff_psi_l, 2);
521 
522  const double beta_e = n0 * n1;
523  FTensor::Tensor1<double, 2> t_diff_beta_e(
524  diffN[2 * node0 + 0] * n1 + n0 * diffN[2 * node1 + 0],
525  diffN[2 * node0 + 1] * n1 + n0 * diffN[2 * node1 + 1]);
526  FTensor::Tensor1<double *, 2> t_diff_psi_l(&diff_psi_l[0],
527  &diff_psi_l[p + 1], 1);
528 
529  for (int ll = 0; ll != nb_base_fun_on_face; ll++) {
530  t_face_edge_base[ee](i) =
531  beta_e * psi_l[ll] * t_opposite_node_diff(ee, i);
532  t_diff_face_edge_base[ee](i, j) =
533  beta_e * t_opposite_node_diff(ee, i) * t_diff_psi_l(j) +
534  psi_l[ll] * t_opposite_node_diff(ee, i) * t_diff_beta_e(j);
535  ++t_face_edge_base[ee];
536  ++t_diff_face_edge_base[ee];
537  ++t_diff_psi_l;
538  }
539  }
540  }
541 
543 }

◆ Hcurl_Ainsworth_EdgeBaseFunctions_MBTET()

MoFEMErrorCode MoFEM::Hcurl_Ainsworth_EdgeBaseFunctions_MBTET ( int *  sense,
int *  p,
double N,
double diffN,
double edgeN[],
double diff_edgeN[],
int  nb_integration_pts,
PetscErrorCode(*)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)  base_polynomials 
)

Edge based H-curl base functions on tetrahedral.

Function generates hierarchical base of h-curl comforting functions on tetrahedral edge. For more details see [3].

On each tetrahedral's edge we have P+1 functions. See NBEDGE_AINSWORTH_HCURL

Parameters
sensesense fo edge (i.e. unique orientation)
parray of oder for each edge
Narray shape functions evaluated at each integration point
diffNderivatives of shape functions
edgeNbase functions on edges
diff_edgeNderivatives of edge shape functions
nb_integration_ptsnumber of integration points
base_polynomialspolynomial base function (f.e. Legendre of Lobatto)
Returns
error code

Definition at line 16 of file Hcurl.cpp.

21  {
23 
24  const int edges_nodes[6][2] = {{0, 1}, {1, 2}, {2, 0},
25  {0, 3}, {1, 3}, {2, 3}};
26  int P[6];
27  for (int ee = 0; ee != 6; ee++)
28  P[ee] = NBEDGE_AINSWORTH_HCURL(p[ee]);
29 
32 
33  FTensor::Tensor1<double *, 3> t_node_diff_ksi[4] = {
34  FTensor::Tensor1<double *, 3>(&diffN[0], &diffN[1], &diffN[2]),
35  FTensor::Tensor1<double *, 3>(&diffN[3], &diffN[4], &diffN[5]),
36  FTensor::Tensor1<double *, 3>(&diffN[6], &diffN[7], &diffN[8]),
37  FTensor::Tensor1<double *, 3>(&diffN[9], &diffN[10], &diffN[11])};
38  double edge_diff_ksi[6][3];
39  FTensor::Tensor1<double *, 3> t_edge_diff_ksi[6] = {
40  FTensor::Tensor1<double *, 3>(&edge_diff_ksi[0][0], &edge_diff_ksi[0][1],
41  &edge_diff_ksi[0][2]),
42  FTensor::Tensor1<double *, 3>(&edge_diff_ksi[1][0], &edge_diff_ksi[1][1],
43  &edge_diff_ksi[1][2]),
44  FTensor::Tensor1<double *, 3>(&edge_diff_ksi[2][0], &edge_diff_ksi[2][1],
45  &edge_diff_ksi[2][2]),
46  FTensor::Tensor1<double *, 3>(&edge_diff_ksi[3][0], &edge_diff_ksi[3][1],
47  &edge_diff_ksi[3][2]),
48  FTensor::Tensor1<double *, 3>(&edge_diff_ksi[4][0], &edge_diff_ksi[4][1],
49  &edge_diff_ksi[4][2]),
50  FTensor::Tensor1<double *, 3>(&edge_diff_ksi[5][0], &edge_diff_ksi[5][1],
51  &edge_diff_ksi[5][2])};
52  for (int ee = 0; ee != 6; ee++) {
53  t_edge_diff_ksi[ee](i) = (t_node_diff_ksi[edges_nodes[ee][1]](i) -
54  t_node_diff_ksi[edges_nodes[ee][0]](i)) *
55  sense[ee];
56  }
57 
58  FTensor::Tensor1<double *, 3> t_edge_n[6] = {
59  FTensor::Tensor1<double *, 3>(&edge_n[0][0], &edge_n[0][1], &edge_n[0][2],
60  3),
61  FTensor::Tensor1<double *, 3>(&edge_n[1][0], &edge_n[1][1], &edge_n[1][2],
62  3),
63  FTensor::Tensor1<double *, 3>(&edge_n[2][0], &edge_n[2][1], &edge_n[2][2],
64  3),
65  FTensor::Tensor1<double *, 3>(&edge_n[3][0], &edge_n[3][1], &edge_n[3][2],
66  3),
67  FTensor::Tensor1<double *, 3>(&edge_n[4][0], &edge_n[4][1], &edge_n[4][2],
68  3),
69  FTensor::Tensor1<double *, 3>(&edge_n[5][0], &edge_n[5][1], &edge_n[5][2],
70  3)};
71  FTensor::Tensor2<double *, 3, 3> t_diff_edge_n[6] = {
73  &diff_edge_n[0][0], &diff_edge_n[0][3], &diff_edge_n[0][6],
74  &diff_edge_n[0][1], &diff_edge_n[0][4], &diff_edge_n[0][7],
75  &diff_edge_n[0][2], &diff_edge_n[0][5], &diff_edge_n[0][8], 9),
77  &diff_edge_n[1][0], &diff_edge_n[1][3], &diff_edge_n[1][6],
78  &diff_edge_n[1][1], &diff_edge_n[1][4], &diff_edge_n[1][7],
79  &diff_edge_n[1][2], &diff_edge_n[1][5], &diff_edge_n[1][8], 9),
81  &diff_edge_n[2][0], &diff_edge_n[2][3], &diff_edge_n[2][6],
82  &diff_edge_n[2][1], &diff_edge_n[2][4], &diff_edge_n[2][7],
83  &diff_edge_n[2][2], &diff_edge_n[2][5], &diff_edge_n[2][8], 9),
85  &diff_edge_n[3][0], &diff_edge_n[3][3], &diff_edge_n[3][6],
86  &diff_edge_n[3][1], &diff_edge_n[3][4], &diff_edge_n[3][7],
87  &diff_edge_n[3][2], &diff_edge_n[3][5], &diff_edge_n[3][8], 9),
89  &diff_edge_n[4][0], &diff_edge_n[4][3], &diff_edge_n[4][6],
90  &diff_edge_n[4][1], &diff_edge_n[4][4], &diff_edge_n[4][7],
91  &diff_edge_n[4][2], &diff_edge_n[4][5], &diff_edge_n[4][8], 9),
93  &diff_edge_n[5][0], &diff_edge_n[5][3], &diff_edge_n[5][6],
94  &diff_edge_n[5][1], &diff_edge_n[5][4], &diff_edge_n[5][7],
95  &diff_edge_n[5][2], &diff_edge_n[5][5], &diff_edge_n[5][8], 9)};
96  FTensor::Tensor1<double, 3> t_psi_e_0, t_psi_e_1;
97  FTensor::Tensor2<double, 3, 3> t_diff_psi_e_0, t_diff_psi_e_1;
98 
99  for (int ii = 0; ii != nb_integration_pts; ii++) {
100 
101  const int node_shift = ii * 4;
102  for (int ee = 0; ee != 6; ee++) {
103 
104  if (P[ee] == 0)
105  continue;
106 
107  t_psi_e_0(i) = (N[node_shift + edges_nodes[ee][1]] *
108  t_node_diff_ksi[edges_nodes[ee][0]](i) -
109  N[node_shift + edges_nodes[ee][0]] *
110  t_node_diff_ksi[edges_nodes[ee][1]](i)) *
111  sense[ee];
112  t_diff_psi_e_0(i, j) = (t_node_diff_ksi[edges_nodes[ee][1]](j) *
113  t_node_diff_ksi[edges_nodes[ee][0]](i) -
114  t_node_diff_ksi[edges_nodes[ee][0]](j) *
115  t_node_diff_ksi[edges_nodes[ee][1]](i)) *
116  sense[ee];
117 
118  t_psi_e_1(i) = N[node_shift + edges_nodes[ee][1]] *
119  t_node_diff_ksi[edges_nodes[ee][0]](i) +
120  N[node_shift + edges_nodes[ee][0]] *
121  t_node_diff_ksi[edges_nodes[ee][1]](i);
122  t_diff_psi_e_1(i, j) = t_node_diff_ksi[edges_nodes[ee][1]](j) *
123  t_node_diff_ksi[edges_nodes[ee][0]](i) +
124  t_node_diff_ksi[edges_nodes[ee][0]](j) *
125  t_node_diff_ksi[edges_nodes[ee][1]](i);
126 
127  (t_edge_n[ee])(i) = t_psi_e_0(i);
128  ++(t_edge_n[ee]);
129  (t_edge_n[ee])(i) = t_psi_e_1(i);
130  ++(t_edge_n[ee]);
131 
132  (t_diff_edge_n[ee])(i, j) = t_diff_psi_e_0(i, j);
133  ++(t_diff_edge_n[ee]);
134  (t_diff_edge_n[ee])(i, j) = t_diff_psi_e_1(i, j);
135  ++(t_diff_edge_n[ee]);
136 
137  if (p[ee] > 1) {
138 
139  const double ksi_0i = (N[node_shift + edges_nodes[ee][1]] -
140  N[node_shift + edges_nodes[ee][0]]) *
141  sense[ee];
142  double psi_l[p[ee] + 1], diff_psi_l[3 * p[ee] + 3];
143  CHKERR base_polynomials(p[ee], ksi_0i, &edge_diff_ksi[ee][0], psi_l,
144  diff_psi_l, 3);
145 
146  FTensor::Tensor1<double *, 3> t_diff_psi_l(
147  &diff_psi_l[0], &diff_psi_l[p[ee] + 1], &diff_psi_l[2 * p[ee] + 2],
148  1);
149 
150  for (int ll = 2; ll != P[ee]; ll++) {
151 
152  const double a = (double)(2 * ll + 1) / (double)(ll + 1);
153  const double b = (double)(ll) / (double)(ll + 1);
154 
155  (t_edge_n[ee])(i) = a * psi_l[ll - 1] * t_psi_e_1(i) -
156  b * psi_l[ll - 2] * t_psi_e_0(i);
157  ++(t_edge_n[ee]);
158 
159  (t_diff_edge_n[ee])(i, j) =
160  -b * (t_diff_psi_l(j) * t_psi_e_0(i) +
161  psi_l[ll - 2] * t_diff_psi_e_0(i, j));
162  ++t_diff_psi_l;
163  (t_diff_edge_n[ee])(i, j) +=
164  a * (t_diff_psi_l(j) * t_psi_e_1(i) +
165  psi_l[ll - 1] * t_diff_psi_e_1(i, j));
166  ++(t_diff_edge_n[ee]);
167  }
168  }
169  }
170  }
171 
173 }

◆ Hcurl_Ainsworth_EdgeBaseFunctions_MBTET_ON_EDGE()

MoFEMErrorCode MoFEM::Hcurl_Ainsworth_EdgeBaseFunctions_MBTET_ON_EDGE ( int  sense,
int  p,
double N,
double diffN,
double edgeN,
double diff_edgeN,
int  nb_integration_pts,
PetscErrorCode(*)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)  base_polynomials 
)

Edge based H-curl base functions on edge.

Function generates hierarchical base of h-curl comforting functions on tetrahedral edge. For more details see [3].

On each edge we have P+1 functions. See NBEDGE_AINSWORTH_HCURL

Parameters
sensesense fo edge (i.e. unique orientation)
parray of oder for each edge
Narray shape functions evaluated at each integration point
diffNderivatives of shape functions
edgeNbase functions on edges
diff_edgeNderivatives of edge shape functions
nb_integration_ptsnumber of integration points
base_polynomialspolynomial base function (f.e. Legendre of Lobatto)
Returns
error code

Definition at line 175 of file Hcurl.cpp.

180  {
182 
183  if (NBEDGE_AINSWORTH_HCURL(p) == 0)
185  if (diff_edge_n != NULL)
186  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
187  "Calculation of derivatives not implemented");
188 
190  FTensor::Tensor1<double, 3> t_node_diff_ksi[2];
191  t_node_diff_ksi[0](0) = diffN[0];
192  t_node_diff_ksi[0](1) = 0;
193  t_node_diff_ksi[0](2) = 0;
194  t_node_diff_ksi[1](0) = diffN[1];
195  t_node_diff_ksi[1](1) = 0;
196  t_node_diff_ksi[1](2) = 0;
197 
199  &edge_n[0], &edge_n[1], &edge_n[2]);
200  FTensor::Tensor1<double, 3> t_psi_e_0, t_psi_e_1;
201 
202  for (int ii = 0; ii != nb_integration_pts; ii++) {
203 
204  const int node_shift = ii * 2;
205 
206  t_psi_e_0(i) = (N[node_shift + 1] * t_node_diff_ksi[0](i) -
207  N[node_shift + 0] * t_node_diff_ksi[1](i)) *
208  sense;
209  t_psi_e_1(i) = N[node_shift + 1] * t_node_diff_ksi[0](i) +
210  N[node_shift + 0] * t_node_diff_ksi[1](i);
211 
212  t_edge_n(i) = t_psi_e_0(i);
213  ++t_edge_n;
214 
215  t_edge_n(i) = t_psi_e_1(i);
216  ++t_edge_n;
217 
218  if (p > 1) {
219 
220  const double ksi_0i = (N[node_shift + 1] - N[node_shift + 0]) * sense;
221  double psi_l[p + 1];
222  CHKERR base_polynomials(p, ksi_0i, NULL, psi_l, NULL, 3);
223 
224  for (int ll = 2; ll != NBEDGE_AINSWORTH_HCURL(p); ll++) {
225  const double a = (double)(2 * ll + 1) / (double)(ll + 1);
226  const double b = (double)(ll) / (double)(ll + 1);
227  t_edge_n(i) =
228  a * psi_l[ll - 1] * t_psi_e_1(i) - b * psi_l[ll - 2] * t_psi_e_0(i);
229  ++t_edge_n;
230  }
231  }
232  }
233 
235 }

◆ Hcurl_Ainsworth_EdgeBaseFunctions_MBTET_ON_FACE()

MoFEMErrorCode MoFEM::Hcurl_Ainsworth_EdgeBaseFunctions_MBTET_ON_FACE ( int *  sense,
int *  p,
double N,
double diffN,
double edgeN[],
double diff_edgeN[],
int  nb_integration_pts,
PetscErrorCode(*)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)  base_polynomials 
)

Edge based H-curl base functions on face.

Function generates hierarchical base of h-curl comforting functions on tetrahedral edge. For more details see [3].

On each face's edge we have P+1 functions. See NBEDGE_AINSWORTH_HCURL

Parameters
sensesense fo edge (i.e. unique orientation)
parray of oder for each edge
Narray shape functions evaluated at each integration point
diffNderivatives of shape functions
edgeNbase functions on edges
diff_edgeNderivatives of edge shape functions
nb_integration_ptsnumber of integration points
base_polynomialspolynomial base function (f.e. Legendre of Lobatto)
Returns
error code

Definition at line 237 of file Hcurl.cpp.

242  {
243 
245 
246  // TODO This is not by atom tests properly
247 
248  const int edges_nodes[3][2] = {{0, 1}, {1, 2}, {2, 0}};
249  int P[3];
250  for (int ee = 0; ee < 3; ee++)
251  P[ee] = NBEDGE_AINSWORTH_HCURL(p[ee]);
252 
255 
256  FTensor::Tensor1<double, 3> t_node_diff_ksi[3] = {
257  FTensor::Tensor1<double, 3>(diffN[0], diffN[1], 0.),
258  FTensor::Tensor1<double, 3>(diffN[2], diffN[3], 0.),
259  FTensor::Tensor1<double, 3>(diffN[4], diffN[5], 0.),
260  };
261  FTensor::Tensor1<double, 2> t_2d_diff_ksi[3] = {
262  FTensor::Tensor1<double, 2>(diffN[0], diffN[1]),
263  FTensor::Tensor1<double, 2>(diffN[2], diffN[3]),
264  FTensor::Tensor1<double, 2>(diffN[4], diffN[5])};
265 
266  FTensor::Tensor1<double *, 3> t_edge_n[3] = {
267  FTensor::Tensor1<double *, 3>(&edge_n[0][0], &edge_n[0][1], &edge_n[0][2],
268  3),
269  FTensor::Tensor1<double *, 3>(&edge_n[1][0], &edge_n[1][1], &edge_n[1][2],
270  3),
271  FTensor::Tensor1<double *, 3>(&edge_n[2][0], &edge_n[2][1], &edge_n[2][2],
272  3)};
273  FTensor::Tensor2<FTensor::PackPtr<double *, 6>, 3, 2> t_diff_edge_n[3] = {
275  &diff_edge_n[0][HVEC0_0], &diff_edge_n[0][HVEC0_1],
276  &diff_edge_n[0][HVEC1_0], &diff_edge_n[0][HVEC1_1],
277  &diff_edge_n[0][HVEC2_0], &diff_edge_n[0][HVEC2_1]),
279  &diff_edge_n[1][HVEC0_0], &diff_edge_n[1][HVEC0_1],
280  &diff_edge_n[1][HVEC1_0], &diff_edge_n[1][HVEC1_1],
281  &diff_edge_n[1][HVEC2_0], &diff_edge_n[1][HVEC2_1]),
283  &diff_edge_n[2][HVEC0_0], &diff_edge_n[2][HVEC0_1],
284  &diff_edge_n[2][HVEC1_0], &diff_edge_n[2][HVEC1_1],
285  &diff_edge_n[2][HVEC2_0], &diff_edge_n[2][HVEC2_1])};
286 
287  FTensor::Tensor1<double, 3> t_psi_e_0, t_psi_e_1;
288  FTensor::Tensor2<double, 3, 2> t_diff_psi_e_0, t_diff_psi_e_1;
289 
290  for (int ee = 0; ee != 3; ee++) {
291 
292  if (P[ee] == 0)
293  continue;
294  const int node0 = edges_nodes[ee][0];
295  const int node1 = edges_nodes[ee][1];
296  const int sense_edge = sense[ee];
297 
298  t_diff_psi_e_0(i, j) =
299  (t_node_diff_ksi[node0](i) * t_2d_diff_ksi[node1](j) -
300  t_node_diff_ksi[node1](i) * t_2d_diff_ksi[node0](j)) *
301  sense_edge;
302  t_diff_psi_e_1(i, j) = t_node_diff_ksi[node0](i) * t_2d_diff_ksi[node1](j) +
303  t_node_diff_ksi[node1](i) * t_2d_diff_ksi[node0](j);
304 
305  for (int ii = 0; ii != nb_integration_pts; ii++) {
306 
307  const int node_shift = ii * 3;
308  const double n0 = N[node_shift + node0];
309  const double n1 = N[node_shift + node1];
310 
311  t_psi_e_0(i) =
312  (n1 * t_node_diff_ksi[node0](i) - n0 * t_node_diff_ksi[node1](i)) *
313  sense_edge;
314  t_psi_e_1(i) =
315  n1 * t_node_diff_ksi[node0](i) + n0 * t_node_diff_ksi[node1](i);
316 
317  (t_edge_n[ee])(i) = t_psi_e_0(i);
318  (t_diff_edge_n[ee])(i, j) = t_diff_psi_e_0(i, j);
319  ++(t_edge_n[ee]);
320  ++(t_diff_edge_n[ee]);
321  (t_edge_n[ee])(i) = t_psi_e_1(i);
322  (t_diff_edge_n[ee])(i, j) = t_diff_psi_e_1(i, j);
323  ++(t_edge_n[ee]);
324  ++(t_diff_edge_n[ee]);
325 
326  if (p[ee] > 1) {
327  const double ksi_0i = (n1 - n0) * sense_edge;
328  double diff_ksi_0i[] = {
329  ((t_2d_diff_ksi[node1])(0) - (t_2d_diff_ksi[node0])(0)) *
330  sense_edge,
331  ((t_2d_diff_ksi[node1])(1) - (t_2d_diff_ksi[node0])(1)) *
332  sense_edge};
333 
334  double psi_l[p[ee] + 1], diff_psi_l[2 * p[ee] + 2];
335  CHKERR
336  base_polynomials(p[ee], ksi_0i, diff_ksi_0i, psi_l, diff_psi_l, 2);
337 
338  FTensor::Tensor1<double *, 2> t_diff_psi_ll_m1(
339  &diff_psi_l[0 + 2 - 1], &diff_psi_l[p[ee] + 1 + 2 - 1], 1);
340  FTensor::Tensor1<double *, 2> t_diff_psi_ll_m2(
341  &diff_psi_l[0 + 2 - 2], &diff_psi_l[p[ee] + 1 + 2 - 2], 1);
342  for (int ll = 2; ll != P[ee]; ll++) {
343  const double a = (double)(2 * ll + 1) / (double)(ll + 1);
344  const double b = (double)(ll) / (double)(ll + 1);
345  (t_edge_n[ee])(i) = a * psi_l[ll - 1] * t_psi_e_1(i) -
346  b * psi_l[ll - 2] * t_psi_e_0(i);
347  (t_diff_edge_n[ee])(i, j) = a * t_psi_e_1(i) * t_diff_psi_ll_m1(j) +
348  a * psi_l[ll - 1] * t_diff_psi_e_1(i, j) -
349  b * t_psi_e_0(i) * t_diff_psi_ll_m2(j) -
350  b * psi_l[ll - 2] * t_diff_psi_e_0(i, j);
351  ++(t_edge_n[ee]);
352  ++(t_diff_edge_n[ee]);
353  ++t_diff_psi_ll_m1;
354  ++t_diff_psi_ll_m2;
355  }
356  }
357  }
358  }
359 
361 }

◆ Hcurl_Ainsworth_FaceFunctions_MBTET()

MoFEMErrorCode MoFEM::Hcurl_Ainsworth_FaceFunctions_MBTET ( int *  face_nodes,
int *  p,
double N,
double diffN,
double phi_f[4],
double diff_phi_f[4],
int  nb_integration_pts,
PetscErrorCode(*)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)  base_polynomials 
)

Face H-curl functions.

Face H-curl functions are set of Eddge-Based Face functions (Hcurl_Ainsworth_EdgeBasedFaceFunctions_MBTET) and Bubble-Face functions (Hcurl_Ainsworth_BubbleFaceFunctions_MBTET).

See NBVOLUMETET_AINSWORTH_FACE_HCURL

Parameters
face_nodesarray [4*3] of local indices of face nodes
papproximation order
Nnodal shape functions
diffNderivatives of nodal shape functions
phi_f[4]calculated shape functions for each face
diff_phi_v[4]derivatives of shape functions for each face
nb_integration_ptsnumber of shape functions
base_polynomialspolynomial base function (f.e. Legendre of Lobatto)
Returns
error code

Definition at line 1052 of file Hcurl.cpp.

1057  {
1058 
1060 
1061  try {
1062 
1063  MatrixDouble base_face_edge_functions[4];
1064  MatrixDouble diff_base_face_edge_functions[4];
1065  double *phi_f_e[4][3];
1066  double *diff_phi_f_e[4][3];
1067  for (int ff = 0; ff != 4; ff++) {
1068  if (NBFACETRI_AINSWORTH_EDGE_HCURL(p[ff]) == 0) {
1069  for (int ee = 0; ee != 3; ee++) {
1070  phi_f_e[ff][ee] = NULL;
1071  diff_phi_f_e[ff][ee] = NULL;
1072  }
1073  } else {
1074  base_face_edge_functions[ff].resize(
1075  3, 3 * NBFACETRI_AINSWORTH_EDGE_HCURL(p[ff]) * nb_integration_pts);
1076  diff_base_face_edge_functions[ff].resize(
1077  3, 9 * NBFACETRI_AINSWORTH_EDGE_HCURL(p[ff]) * nb_integration_pts);
1078  // base_face_edge_functions[ff].clear();
1079  // diff_base_face_edge_functions[ff].clear();
1080  for (int ee = 0; ee != 3; ee++) {
1081  phi_f_e[ff][ee] = &base_face_edge_functions[ff](ee, 0);
1082  diff_phi_f_e[ff][ee] = &diff_base_face_edge_functions[ff](ee, 0);
1083  }
1084  }
1085  }
1087  face_nodes, p, N, diffN, phi_f_e, diff_phi_f_e, nb_integration_pts,
1088  base_polynomials);
1089 
1090  VectorDouble base_face_bubble_functions[4];
1091  VectorDouble diff_base_face_bubble_functions[4];
1092  double *phi_f_f[4];
1093  double *diff_phi_f_f[4];
1094  for (int ff = 0; ff != 4; ff++) {
1095  int nb_dofs = NBFACETRI_AINSWORTH_FACE_HCURL(p[ff]);
1096  if (nb_dofs == 0) {
1097  phi_f_f[ff] = NULL;
1098  diff_phi_f_f[ff] = NULL;
1099  } else {
1100  base_face_bubble_functions[ff].resize(3 * nb_dofs * nb_integration_pts,
1101  false);
1102  diff_base_face_bubble_functions[ff].resize(
1103  9 * nb_dofs * nb_integration_pts, false);
1104  phi_f_f[ff] = &*base_face_bubble_functions[ff].data().begin();
1105  diff_phi_f_f[ff] = &*diff_base_face_bubble_functions[ff].data().begin();
1106  }
1107  }
1109  face_nodes, p, N, diffN, phi_f_f, diff_phi_f_f, nb_integration_pts,
1110  base_polynomials);
1111 
1114 
1115  for (int ff = 0; ff != 4; ff++) {
1116 
1117  if (NBFACETRI_AINSWORTH_EDGE_HCURL(p[ff]) == 0)
1118  continue;
1119 
1120  FTensor::Tensor1<double *, 3> t_face_edge_base[] = {
1121  FTensor::Tensor1<double *, 3>(&phi_f_e[ff][0][0], &phi_f_e[ff][0][1],
1122  &phi_f_e[ff][0][2], 3),
1123  FTensor::Tensor1<double *, 3>(&phi_f_e[ff][1][0], &phi_f_e[ff][1][1],
1124  &phi_f_e[ff][1][2], 3),
1125  FTensor::Tensor1<double *, 3>(&phi_f_e[ff][2][0], &phi_f_e[ff][2][1],
1126  &phi_f_e[ff][2][2], 3)};
1127  FTensor::Tensor2<double *, 3, 3> t_diff_face_edge_base[] = {
1129  &diff_phi_f_e[ff][0][0], &diff_phi_f_e[ff][0][3],
1130  &diff_phi_f_e[ff][0][6], &diff_phi_f_e[ff][0][1],
1131  &diff_phi_f_e[ff][0][4], &diff_phi_f_e[ff][0][7],
1132  &diff_phi_f_e[ff][0][2], &diff_phi_f_e[ff][0][5],
1133  &diff_phi_f_e[ff][0][8], 9),
1135  &diff_phi_f_e[ff][1][0], &diff_phi_f_e[ff][1][3],
1136  &diff_phi_f_e[ff][1][6], &diff_phi_f_e[ff][1][1],
1137  &diff_phi_f_e[ff][1][4], &diff_phi_f_e[ff][1][7],
1138  &diff_phi_f_e[ff][1][2], &diff_phi_f_e[ff][1][5],
1139  &diff_phi_f_e[ff][1][8], 9),
1141  &diff_phi_f_e[ff][2][0], &diff_phi_f_e[ff][2][3],
1142  &diff_phi_f_e[ff][2][6], &diff_phi_f_e[ff][2][1],
1143  &diff_phi_f_e[ff][2][4], &diff_phi_f_e[ff][2][7],
1144  &diff_phi_f_e[ff][2][2], &diff_phi_f_e[ff][2][5],
1145  &diff_phi_f_e[ff][2][8], 9)};
1146 
1147  FTensor::Tensor1<double *, 3> t_face_base(&phi_f[ff][0], &phi_f[ff][1],
1148  &phi_f[ff][2], 3);
1149  FTensor::Tensor2<double *, 3, 3> t_diff_face_base(
1150  &diff_phi_f[ff][0], &diff_phi_f[ff][3], &diff_phi_f[ff][6],
1151  &diff_phi_f[ff][1], &diff_phi_f[ff][4], &diff_phi_f[ff][7],
1152  &diff_phi_f[ff][2], &diff_phi_f[ff][5], &diff_phi_f[ff][8], 9);
1153 
1154  if (NBFACETRI_AINSWORTH_FACE_HCURL(p[ff]) > 0) {
1155  FTensor::Tensor1<double *, 3> t_face_face_base(
1156  &phi_f_f[ff][0], &phi_f_f[ff][1], &phi_f_f[ff][2], 3);
1157  FTensor::Tensor2<double *, 3, 3> t_diff_face_face_base(
1158  &diff_phi_f_f[ff][0], &diff_phi_f_f[ff][3], &diff_phi_f_f[ff][6],
1159  &diff_phi_f_f[ff][1], &diff_phi_f_f[ff][4], &diff_phi_f_f[ff][7],
1160  &diff_phi_f_f[ff][2], &diff_phi_f_f[ff][5], &diff_phi_f_f[ff][8],
1161  9);
1162  for (int ii = 0; ii != nb_integration_pts; ii++) {
1163  int cc = 0;
1164  for (int oo = 0; oo <= p[ff]; oo++) {
1165  // Face-edge base
1166  if (oo > 1) {
1167  for (int ee = 0; ee != 3; ee++) {
1168  for (int ll = NBFACETRI_AINSWORTH_EDGE_HCURL(oo - 1);
1169  ll != NBFACETRI_AINSWORTH_EDGE_HCURL(oo); ll++) {
1170  t_face_base(i) = t_face_edge_base[ee](i);
1171  ++cc;
1172  ++t_face_base;
1173  ++t_face_edge_base[ee];
1174  t_diff_face_base(i, j) = t_diff_face_edge_base[ee](i, j);
1175  ++t_diff_face_base;
1176  ++t_diff_face_edge_base[ee];
1177  // cerr << oo << " " << ll << " " << cc << " " <<
1178  // NBFACETRI_AINSWORTH_EDGE_HCURL(oo) << endl;
1179  }
1180  }
1181  }
1182  // Face-face base
1183  if (oo > 2) {
1184  for (int ll = NBFACETRI_AINSWORTH_FACE_HCURL(oo - 1);
1185  ll != NBFACETRI_AINSWORTH_FACE_HCURL(oo); ll++) {
1186  t_face_base(i) = t_face_face_base(i);
1187  ++cc;
1188  ++t_face_base;
1189  ++t_face_face_base;
1190  t_diff_face_base(i, j) = t_diff_face_face_base(i, j);
1191  ++t_diff_face_base;
1192  ++t_diff_face_face_base;
1193  }
1194  }
1195  }
1196  // check consistency
1197  const int nb_base_fun_on_face = NBFACETRI_AINSWORTH_HCURL(p[ff]);
1198  if (cc != nb_base_fun_on_face) {
1199  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1200  "Wrong number of base functions %d != %d", cc,
1201  nb_base_fun_on_face);
1202  }
1203  }
1204  } else {
1205  for (int ii = 0; ii != nb_integration_pts; ii++) {
1206  int cc = 0;
1207  for (int oo = 0; oo <= p[ff]; oo++) {
1208  // Face-edge base
1209  if (oo > 1) {
1210  for (int ee = 0; ee != 3; ee++) {
1211  for (int ll = NBFACETRI_AINSWORTH_EDGE_HCURL(oo - 1);
1212  ll != NBFACETRI_AINSWORTH_EDGE_HCURL(oo); ll++) {
1213  t_face_base(i) = t_face_edge_base[ee](i);
1214  ++cc;
1215  ++t_face_base;
1216  ++t_face_edge_base[ee];
1217  t_diff_face_base(i, j) = t_diff_face_edge_base[ee](i, j);
1218  ++t_diff_face_base;
1219  ++t_diff_face_edge_base[ee];
1220  // cerr << oo << " " << ll << " " << cc << " " <<
1221  // NBFACETRI_AINSWORTH_EDGE_HCURL(oo) << endl;
1222  }
1223  }
1224  }
1225  }
1226  // check consistency
1227  const int nb_base_fun_on_face = NBFACETRI_AINSWORTH_HCURL(p[ff]);
1228  if (cc != nb_base_fun_on_face) {
1229  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1230  "Wrong number of base functions %d != %d", cc,
1231  nb_base_fun_on_face);
1232  }
1233  }
1234  }
1235  }
1236 
1237  } catch (MoFEMException const &e) {
1238  SETERRQ(PETSC_COMM_SELF, e.errorCode, e.errorMessage);
1239  } catch (std::exception &ex) {
1240  std::ostringstream ss;
1241  ss << "thorw in method: " << ex.what() << " at line " << __LINE__
1242  << " in file " << __FILE__;
1243  SETERRQ(PETSC_COMM_SELF, MOFEM_STD_EXCEPTION_THROW, ss.str().c_str());
1244  }
1245 
1247 }

◆ Hcurl_Ainsworth_FaceFunctions_MBTET_ON_FACE()

MoFEMErrorCode MoFEM::Hcurl_Ainsworth_FaceFunctions_MBTET_ON_FACE ( int *  faces_nodes,
int  p,
double N,
double diffN,
double phi_f,
double diff_phi_f,
int  nb_integration_pts,
PetscErrorCode(*)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)  base_polynomials 
)

Face H-curl functions.

Face H-curl functions are set of Eddge-Based Face functions (Hcurl_Ainsworth_EdgeBasedFaceFunctions_MBTET) and Bubble-Face functions (Hcurl_Ainsworth_BubbleFaceFunctions_MBTET).

See NBVOLUMETET_AINSWORTH_FACE_HCURL

Parameters
face_nodesarray [4*3] of local indices of face nodes
papproximation order
Nnodal shape functions
diffNderivatives of nodal shape functions
phi_f[4]calculated shape functions for each face
diff_phi_v[4]derivatives of shape functions for each face
nb_integration_ptsnumber of shape functions
base_polynomialspolynomial base function (f.e. Legendre of Lobatto)
Returns
error code

Definition at line 1249 of file Hcurl.cpp.

1254  {
1255 
1257 
1258  if (NBFACETRI_AINSWORTH_EDGE_HCURL(p) == 0)
1260 
1261  MatrixDouble base_face_edge_functions, diff_base_face_edge_functions;
1262  double *phi_f_e[3];
1263  double *diff_phi_f_e[3];
1264  base_face_edge_functions.resize(3, 3 * NBFACETRI_AINSWORTH_EDGE_HCURL(p) *
1265  nb_integration_pts);
1266  diff_base_face_edge_functions.resize(
1267  3, 2 * 3 * NBFACETRI_AINSWORTH_EDGE_HCURL(p) * nb_integration_pts);
1268  // base_face_edge_functions.clear();
1269  for (int ee = 0; ee != 3; ee++) {
1270  phi_f_e[ee] = &base_face_edge_functions(ee, 0);
1271  diff_phi_f_e[ee] = &diff_base_face_edge_functions(ee, 0);
1272  }
1274  faces_nodes, p, N, diffN, phi_f_e, diff_phi_f_e, nb_integration_pts,
1275  base_polynomials);
1276 
1277  VectorDouble base_face_bubble_functions;
1278  VectorDouble diff_base_face_bubble_functions;
1279  double *phi_f_f, *diff_phi_f_f;
1280  base_face_bubble_functions.resize(3 * NBFACETRI_AINSWORTH_FACE_HCURL(p) *
1281  nb_integration_pts);
1282  diff_base_face_bubble_functions.resize(
1283  2 * 3 * NBFACETRI_AINSWORTH_FACE_HCURL(p) * nb_integration_pts);
1284  phi_f_f = &*base_face_bubble_functions.data().begin();
1285  diff_phi_f_f = &*diff_base_face_bubble_functions.data().begin();
1287  faces_nodes, p, N, diffN, phi_f_f, diff_phi_f_f, nb_integration_pts,
1288  base_polynomials);
1289 
1290  // cerr << diff_base_face_bubble_functions << endl;
1291 
1294 
1295  FTensor::Tensor1<double *, 3> t_face_edge_base[] = {
1296  FTensor::Tensor1<double *, 3>(&phi_f_e[0][HVEC0], &phi_f_e[0][HVEC1],
1297  &phi_f_e[0][HVEC2], 3),
1298  FTensor::Tensor1<double *, 3>(&phi_f_e[1][HVEC0], &phi_f_e[1][HVEC1],
1299  &phi_f_e[1][HVEC2], 3),
1300  FTensor::Tensor1<double *, 3>(&phi_f_e[2][HVEC0], &phi_f_e[2][HVEC1],
1301  &phi_f_e[2][HVEC2], 3)};
1303  t_diff_face_edge_base[] = {
1305  &diff_phi_f_e[0][HVEC0_0], &diff_phi_f_e[0][HVEC0_1],
1306  &diff_phi_f_e[0][HVEC1_0], &diff_phi_f_e[0][HVEC1_1],
1307  &diff_phi_f_e[0][HVEC2_0], &diff_phi_f_e[0][HVEC2_1]),
1309  &diff_phi_f_e[1][HVEC0_0], &diff_phi_f_e[1][HVEC0_1],
1310  &diff_phi_f_e[1][HVEC1_0], &diff_phi_f_e[1][HVEC1_1],
1311  &diff_phi_f_e[1][HVEC2_0], &diff_phi_f_e[1][HVEC2_1]),
1313  &diff_phi_f_e[2][HVEC0_0], &diff_phi_f_e[2][HVEC0_1],
1314  &diff_phi_f_e[2][HVEC1_0], &diff_phi_f_e[2][HVEC1_1],
1315  &diff_phi_f_e[2][HVEC2_0], &diff_phi_f_e[2][HVEC2_1])};
1316 
1317  FTensor::Tensor1<double *, 3> t_face_base(&phi_f[0], &phi_f[1], &phi_f[2], 3);
1318  FTensor::Tensor2<FTensor::PackPtr<double *, 6>, 3, 2> t_diff_face_base(
1319  &diff_phi_f[HVEC0_0], &diff_phi_f[HVEC0_1], &diff_phi_f[HVEC1_0],
1320  &diff_phi_f[HVEC1_1], &diff_phi_f[HVEC2_0], &diff_phi_f[HVEC2_1]);
1321 
1322  if (NBFACETRI_AINSWORTH_FACE_HCURL(p) > 0) {
1323  FTensor::Tensor1<double *, 3> t_face_face_base(
1324  &phi_f_f[HVEC0], &phi_f_f[HVEC1], &phi_f_f[HVEC2], 3);
1325  FTensor::Tensor2<FTensor::PackPtr<double *, 6>, 3, 2> t_diff_face_face_base(
1326  &diff_phi_f_f[HVEC0_0], &diff_phi_f_f[HVEC0_1], &diff_phi_f_f[HVEC1_0],
1327  &diff_phi_f_f[HVEC1_1], &diff_phi_f_f[HVEC2_0], &diff_phi_f_f[HVEC2_1]);
1328  for (int ii = 0; ii != nb_integration_pts; ii++) {
1329  int cc = 0;
1330  for (int oo = 0; oo <= p; oo++) {
1331  // Face-edge base
1332  if (oo > 1) {
1333  for (int ee = 0; ee != 3; ee++) {
1334  for (int ll = NBFACETRI_AINSWORTH_EDGE_HCURL(oo - 1);
1335  ll != NBFACETRI_AINSWORTH_EDGE_HCURL(oo); ll++) {
1336  t_face_base(i) = t_face_edge_base[ee](i);
1337  t_diff_face_base(i, j) = t_diff_face_edge_base[ee](i, j);
1338  ++cc;
1339  ++t_face_base;
1340  ++t_face_edge_base[ee];
1341  ++t_diff_face_base;
1342  ++t_diff_face_edge_base[ee];
1343  }
1344  }
1345  }
1346  // Face-face base
1347  if (oo > 2) {
1348  for (int ll = NBFACETRI_AINSWORTH_FACE_HCURL(oo - 1);
1349  ll != NBFACETRI_AINSWORTH_FACE_HCURL(oo); ll++) {
1350  t_face_base(i) = t_face_face_base(i);
1351  t_diff_face_base(i, j) = t_diff_face_face_base(i, j);
1352  ++cc;
1353  ++t_face_base;
1354  ++t_face_face_base;
1355  ++t_diff_face_base;
1356  ++t_diff_face_face_base;
1357  }
1358  }
1359  }
1360  // check consistency
1361  const int nb_base_fun_on_face = NBFACETRI_AINSWORTH_HCURL(p);
1362  if (cc != nb_base_fun_on_face) {
1363  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1364  "Wrong number of base functions %d != %d", cc,
1365  nb_base_fun_on_face);
1366  }
1367  }
1368  } else {
1369  for (int ii = 0; ii != nb_integration_pts; ii++) {
1370  int cc = 0;
1371  for (int oo = 0; oo <= p; oo++) {
1372  // Face-edge base
1373  if (oo > 1) {
1374  for (int ee = 0; ee != 3; ee++) {
1375  for (int ll = NBFACETRI_AINSWORTH_EDGE_HCURL(oo - 1);
1376  ll != NBFACETRI_AINSWORTH_EDGE_HCURL(oo); ll++) {
1377  t_face_base(i) = t_face_edge_base[ee](i);
1378  t_diff_face_base(i, j) = t_diff_face_edge_base[ee](i, j);
1379  ++cc;
1380  ++t_face_base;
1381  ++t_face_edge_base[ee];
1382  ++t_diff_face_base;
1383  ++t_diff_face_edge_base[ee];
1384  // cerr << oo << " " << ll << " " << cc << " " <<
1385  // NBFACETRI_AINSWORTH_EDGE_HCURL(oo) << endl;
1386  }
1387  }
1388  }
1389  }
1390  // check consistency
1391  const int nb_base_fun_on_face = NBFACETRI_AINSWORTH_HCURL(p);
1392  if (cc != nb_base_fun_on_face) {
1393  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1394  "Wrong number of base functions %d != %d", cc,
1395  nb_base_fun_on_face);
1396  }
1397  }
1398  }
1399 
1401 }

◆ Hcurl_Ainsworth_FaceInteriorFunctions_MBTET()

MoFEMErrorCode MoFEM::Hcurl_Ainsworth_FaceInteriorFunctions_MBTET ( int *  faces_nodes,
int  p,
double N,
double diffN,
double phi_v,
double diff_phi_v,
int  nb_integration_pts,
PetscErrorCode(*)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)  base_polynomials 
)

Face base interior function.

On each face we have P*(P-1)/2 and are 4 faces on Tetrahedral.

See NBFACETRI_AINSWORTH_FACE_HCURL

Parameters
face_nodesarray [4*3] of local indices of face nodes
papproximation order
Nnodal shape functions
diffNderivatives of nodal shape functions
phi_vcalculated shape functions
diff_phi_vderivatives of shape functions
nb_integration_ptsnumber of shape functions
base_polynomialspolynomial base function (f.e. Legendre of Lobatto)
Returns
error code

Definition at line 775 of file Hcurl.cpp.

780  {
781 
783 
786 
787  const int face_opposite_nodes[] = {2, 0, 1, 3};
788 
791 
792  FTensor::Tensor1<double *, 3> t_node_diff_ksi[4] = {
793  FTensor::Tensor1<double *, 3>(&diffN[0], &diffN[1], &diffN[2]),
794  FTensor::Tensor1<double *, 3>(&diffN[3], &diffN[4], &diffN[5]),
795  FTensor::Tensor1<double *, 3>(&diffN[6], &diffN[7], &diffN[8]),
796  FTensor::Tensor1<double *, 3>(&diffN[9], &diffN[10], &diffN[11])};
797  FTensor::Tensor1<double, 3> t_diff_ksi0i, t_diff_ksi0j;
798 
799  MatrixDouble m_psi_l_0i(4, p + 1);
800  MatrixDouble m_psi_l_0j(4, p + 1);
801  MatrixDouble m_diff_psi_l_0i(4, 3 * p + 3);
802  MatrixDouble m_diff_psi_l_0j(4, 3 * p + 3);
803 
804  double *psi_l_0i[] = {&m_psi_l_0i(0, 0), &m_psi_l_0i(1, 0), &m_psi_l_0i(2, 0),
805  &m_psi_l_0i(3, 0)};
806  double *psi_l_0j[] = {&m_psi_l_0j(0, 0), &m_psi_l_0j(1, 0), &m_psi_l_0j(2, 0),
807  &m_psi_l_0j(3, 0)};
808  double *diff_psi_l_0i[] = {&m_diff_psi_l_0i(0, 0), &m_diff_psi_l_0i(1, 0),
809  &m_diff_psi_l_0i(2, 0), &m_diff_psi_l_0i(3, 0)};
810  double *diff_psi_l_0j[] = {&m_diff_psi_l_0j(0, 0), &m_diff_psi_l_0j(1, 0),
811  &m_diff_psi_l_0j(2, 0), &m_diff_psi_l_0j(3, 0)};
812  double beta_f[4];
813 
814  FTensor::Tensor1<double, 3> t_diff_beta_f[4];
815 
816  FTensor::Tensor1<double *, 3> t_phi_v(&phi_v[0], &phi_v[1], &phi_v[2], 3);
818  &diff_phi_v[0], &diff_phi_v[3], &diff_phi_v[6], &diff_phi_v[1],
819  &diff_phi_v[4], &diff_phi_v[7], &diff_phi_v[2], &diff_phi_v[5],
820  &diff_phi_v[8], 9);
821 
822  for (int ii = 0; ii != nb_integration_pts; ii++) {
823 
824  for (int ff = 0; ff != 4; ff++) {
825 
826  t_diff_ksi0i(i) = t_node_diff_ksi[faces_nodes[3 * ff + 1]](i) -
827  t_node_diff_ksi[faces_nodes[3 * ff + 0]](i);
828  t_diff_ksi0j(i) = t_node_diff_ksi[faces_nodes[3 * ff + 2]](i) -
829  t_node_diff_ksi[faces_nodes[3 * ff + 0]](i);
830 
831  const int node_shift = ii * 4;
832 
833  beta_f[ff] = N[node_shift + faces_nodes[3 * ff + 0]] *
834  N[node_shift + faces_nodes[3 * ff + 1]] *
835  N[node_shift + faces_nodes[3 * ff + 2]];
836 
837  t_diff_beta_f[ff](j) = t_node_diff_ksi[faces_nodes[3 * ff + 0]](j) *
838  N[node_shift + faces_nodes[3 * ff + 1]] *
839  N[node_shift + faces_nodes[3 * ff + 2]] +
840  N[node_shift + faces_nodes[3 * ff + 0]] *
841  t_node_diff_ksi[faces_nodes[3 * ff + 1]](j) *
842  N[node_shift + faces_nodes[3 * ff + 2]] +
843  N[node_shift + faces_nodes[3 * ff + 0]] *
844  N[node_shift + faces_nodes[3 * ff + 1]] *
845  t_node_diff_ksi[faces_nodes[3 * ff + 2]](j);
846 
847  const double ksi_0i = N[node_shift + faces_nodes[3 * ff + 1]] -
848  N[node_shift + faces_nodes[3 * ff + 0]];
849  CHKERR base_polynomials(p, ksi_0i, &t_diff_ksi0i(0), psi_l_0i[ff],
850  diff_psi_l_0i[ff], 3);
851 
852  const double ksi_0j = N[node_shift + faces_nodes[3 * ff + 2]] -
853  N[node_shift + faces_nodes[3 * ff + 0]];
854  CHKERR base_polynomials(p, ksi_0j, &t_diff_ksi0j(0), psi_l_0j[ff],
855  diff_psi_l_0j[ff], 3);
856  }
857 
858  int cc = 0;
859  for (int oo = 0; oo <= (p - 3); oo++) {
860  FTensor::Tensor1<double *, 3> t_diff_psi_l_0i[] = {
861  FTensor::Tensor1<double *, 3>(&diff_psi_l_0i[0][0],
862  &diff_psi_l_0i[0][p + 1],
863  &diff_psi_l_0i[0][2 * p + 2], 1),
864  FTensor::Tensor1<double *, 3>(&diff_psi_l_0i[1][0],
865  &diff_psi_l_0i[1][p + 1],
866  &diff_psi_l_0i[1][2 * p + 2], 1),
867  FTensor::Tensor1<double *, 3>(&diff_psi_l_0i[2][0],
868  &diff_psi_l_0i[2][p + 1],
869  &diff_psi_l_0i[2][2 * p + 2], 1),
870  FTensor::Tensor1<double *, 3>(&diff_psi_l_0i[3][0],
871  &diff_psi_l_0i[3][p + 1],
872  &diff_psi_l_0i[3][2 * p + 2], 1),
873  };
874  for (int pp0 = 0; pp0 <= oo; pp0++) {
875  const int pp1 = oo - pp0;
876  if (pp1 >= 0) {
877  for (int ff = 0; ff != 4; ff++) {
878  FTensor::Tensor1<double *, 3> t_diff_psi_l_0j(
879  &m_diff_psi_l_0j(ff, pp1), &m_diff_psi_l_0j(ff, p + 1 + pp1),
880  &m_diff_psi_l_0j(ff, 2 * p + 2 + pp1), 1);
881  const double t = psi_l_0i[ff][pp0] * psi_l_0j[ff][pp1];
882  const double a = beta_f[ff] * t;
883  t_phi_v(i) = a * t_node_diff_ksi[face_opposite_nodes[ff]](i);
884  ++t_phi_v;
885  ++cc;
886  t_diff_phi_v(i, j) =
887  (t_diff_beta_f[ff](j) * t +
888  beta_f[ff] * t_diff_psi_l_0i[ff](j) * psi_l_0j[ff][pp1] +
889  beta_f[ff] * psi_l_0i[ff][pp0] * t_diff_psi_l_0j(j)) *
890  t_node_diff_ksi[face_opposite_nodes[ff]](i);
891  ++t_diff_phi_v;
892  ++t_diff_psi_l_0i[ff];
893  }
894  }
895  }
896  }
897 
898  const int nb_base_fun_on_face = NBVOLUMETET_AINSWORTH_FACE_HCURL(p);
899  if (cc != nb_base_fun_on_face) {
900  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
901  "Wrong number of base functions %d != %d", cc,
902  nb_base_fun_on_face);
903  }
904  }
905 
907 }

◆ Hcurl_Ainsworth_VolumeFunctions_MBTET()

MoFEMErrorCode MoFEM::Hcurl_Ainsworth_VolumeFunctions_MBTET ( int  p,
double N,
double diffN,
double phi_v,
double diff_phi_v,
int  nb_integration_pts,
PetscErrorCode(*)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)  base_polynomials 
)

H-curl volume base functions.

Volume base functions are collection of iace interior base functions and volume interior base functions.

Parameters
papproximation order
Nnodal shape functions
diffNderivatives of nodal shape functions
phi_vcalculated shape functions
diff_phi_vderivatives of shape functions
nb_integration_ptsnumber of shape functions
base_polynomialspolynomial base function (f.e. Legendre of Lobatto)
Returns
error code

Definition at line 1403 of file Hcurl.cpp.

1408  {
1409 
1411 
1412  VectorDouble base_face_inetrior_functions(
1413  3 * NBVOLUMETET_AINSWORTH_FACE_HCURL(p) * nb_integration_pts);
1414  VectorDouble diff_base_face_inetrior_functions(
1415  9 * NBVOLUMETET_AINSWORTH_FACE_HCURL(p) * nb_integration_pts);
1416  // base_face_inetrior_functions.clear();
1417  // diff_base_face_inetrior_functions.clear();
1418  double *phi_v_f = &*base_face_inetrior_functions.data().begin();
1419  double *diff_phi_v_f = &*diff_base_face_inetrior_functions.data().begin();
1420  int faces_nodes[] = {0, 1, 3, 1, 2, 3, 0, 2, 3, 0, 1, 2};
1422  faces_nodes, p, N, diffN, phi_v_f, diff_phi_v_f, nb_integration_pts,
1423  base_polynomials);
1424 
1425  VectorDouble base_interior_functions(3 * NBVOLUMETET_AINSWORTH_TET_HCURL(p) *
1426  nb_integration_pts);
1427  VectorDouble diff_base_interior_functions(
1428  9 * NBVOLUMETET_AINSWORTH_TET_HCURL(p) * nb_integration_pts);
1429  // base_interior_functions.clear();
1430  // diff_base_interior_functions.clear();
1431  double *phi_v_v = &*base_interior_functions.data().begin();
1432  double *diff_phi_v_v = &*diff_base_interior_functions.data().begin();
1434  p, N, diffN, phi_v_v, diff_phi_v_v, nb_integration_pts, base_polynomials);
1435 
1438 
1439  FTensor::Tensor1<double *, 3> t_face_interior(&phi_v_f[0], &phi_v_f[1],
1440  &phi_v_f[2], 3);
1441  FTensor::Tensor2<double *, 3, 3> t_diff_face_interior(
1442  &diff_phi_v_f[0], &diff_phi_v_f[3], &diff_phi_v_f[6], &diff_phi_v_f[1],
1443  &diff_phi_v_f[4], &diff_phi_v_f[7], &diff_phi_v_f[2], &diff_phi_v_f[5],
1444  &diff_phi_v_f[8], 9);
1445 
1446  FTensor::Tensor1<double *, 3> t_phi_v(&phi_v[0], &phi_v[1], &phi_v[2], 3);
1447  FTensor::Tensor2<double *, 3, 3> t_diff_phi_v(
1448  &diff_phi_v[0], &diff_phi_v[3], &diff_phi_v[6], &diff_phi_v[1],
1449  &diff_phi_v[4], &diff_phi_v[7], &diff_phi_v[2], &diff_phi_v[5],
1450  &diff_phi_v[8], 9);
1451 
1452  if (NBVOLUMETET_AINSWORTH_TET_HCURL(p) > 0) {
1453  FTensor::Tensor1<double *, 3> t_volume_interior(&phi_v_v[0], &phi_v_v[1],
1454  &phi_v_v[2], 3);
1455  FTensor::Tensor2<double *, 3, 3> t_diff_volume_interior(
1456  &diff_phi_v_v[0], &diff_phi_v_v[3], &diff_phi_v_v[6], &diff_phi_v_v[1],
1457  &diff_phi_v_v[4], &diff_phi_v_v[7], &diff_phi_v_v[2], &diff_phi_v_v[5],
1458  &diff_phi_v_v[8], 9);
1459  for (int ii = 0; ii != nb_integration_pts; ii++) {
1460  int cc = 0;
1461  for (int oo = 0; oo <= p; oo++) {
1462  for (int ll = NBVOLUMETET_AINSWORTH_FACE_HCURL(oo - 1);
1463  ll != NBVOLUMETET_AINSWORTH_FACE_HCURL(oo); ll++) {
1464  t_phi_v(i) = t_face_interior(i);
1465  ++t_phi_v;
1466  ++t_face_interior;
1467  ++cc;
1468  t_diff_phi_v(i, j) = t_diff_face_interior(i, j);
1469  ++t_diff_phi_v;
1470  ++t_diff_face_interior;
1471  }
1472  for (int ll = NBVOLUMETET_AINSWORTH_TET_HCURL(oo - 1);
1473  ll != NBVOLUMETET_AINSWORTH_TET_HCURL(oo); ll++) {
1474  t_phi_v(i) = t_volume_interior(i);
1475  ++t_phi_v;
1476  ++t_volume_interior;
1477  ++cc;
1478  t_diff_phi_v(i, j) = t_diff_volume_interior(i, j);
1479  ++t_diff_phi_v;
1480  ++t_diff_volume_interior;
1481  }
1482  }
1483  // check consistency
1484  const int nb_base_fun_on_face = NBVOLUMETET_AINSWORTH_HCURL(p);
1485  if (cc != nb_base_fun_on_face) {
1486  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1487  "Wrong number of base functions %d != %d", cc,
1488  nb_base_fun_on_face);
1489  }
1490  }
1491  } else {
1492  for (int ii = 0; ii != nb_integration_pts; ii++) {
1493  int cc = 0;
1494  for (int oo = 0; oo <= p; oo++) {
1495  for (int ll = NBVOLUMETET_AINSWORTH_FACE_HCURL(oo - 1);
1496  ll != NBVOLUMETET_AINSWORTH_FACE_HCURL(oo); ll++) {
1497  t_phi_v(i) = t_face_interior(i);
1498  ++t_phi_v;
1499  ++t_face_interior;
1500  ++cc;
1501  t_diff_phi_v(i, j) = t_diff_face_interior(i, j);
1502  ++t_diff_phi_v;
1503  ++t_diff_face_interior;
1504  }
1505  }
1506  // check consistency
1507  const int nb_base_fun_on_face = NBVOLUMETET_AINSWORTH_HCURL(p);
1508  if (cc != nb_base_fun_on_face) {
1509  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1510  "Wrong number of base functions %d != %d", cc,
1511  nb_base_fun_on_face);
1512  }
1513  }
1514  }
1515 
1517 }

◆ Hcurl_Ainsworth_VolumeInteriorFunctions_MBTET()

MoFEMErrorCode MoFEM::Hcurl_Ainsworth_VolumeInteriorFunctions_MBTET ( int  p,
double N,
double diffN,
double phi_v,
double diff_phi_v,
int  nb_integration_pts,
PetscErrorCode(*)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)  base_polynomials 
)

Volume interior function.

On volume have (P-3)*(P-2)*(P-1)/2.

See NBVOLUMETET_AINSWORTH_TET_HCURL

Parameters
papproximation order
Nnodal shape functions
diffNderivatives of nodal shape functions
phi_vcalculated shape functions
diff_phi_vderivatives of shape functions
nb_integration_ptsnumber of shape functions
base_polynomialspolynomial base function (f.e. Legendre of Lobatto)
Returns
error code

Definition at line 909 of file Hcurl.cpp.

914  {
915 
917 
920 
926 
927  FTensor::Tensor1<double *, 3> t_node_diff_ksi[4] = {
928  FTensor::Tensor1<double *, 3>(&diffN[0], &diffN[1], &diffN[2]),
929  FTensor::Tensor1<double *, 3>(&diffN[3], &diffN[4], &diffN[5]),
930  FTensor::Tensor1<double *, 3>(&diffN[6], &diffN[7], &diffN[8]),
931  FTensor::Tensor1<double *, 3>(&diffN[9], &diffN[10], &diffN[11])};
932 
933  double diff_ksi0i[3], diff_ksi0j[3], diff_ksi0k[3];
934  FTensor::Tensor1<double *, 3> t_diff_ksi0i(diff_ksi0i, &diff_ksi0i[1],
935  &diff_ksi0i[2]);
936  FTensor::Tensor1<double *, 3> t_diff_ksi0j(diff_ksi0j, &diff_ksi0j[1],
937  &diff_ksi0j[2]);
938  FTensor::Tensor1<double *, 3> t_diff_ksi0k(diff_ksi0k, &diff_ksi0k[1],
939  &diff_ksi0k[2]);
940  t_diff_ksi0i(i) = t_node_diff_ksi[1](i) - t_node_diff_ksi[0](i);
941  t_diff_ksi0j(i) = t_node_diff_ksi[2](i) - t_node_diff_ksi[0](i);
942  t_diff_ksi0k(i) = t_node_diff_ksi[3](i) - t_node_diff_ksi[0](i);
943 
944  std::vector<double> v_psi_l_0i(p + 1), v_diff_psi_l_0i(3 * p + 3);
945  std::vector<double> v_psi_l_0j(p + 1), v_diff_psi_l_0j(3 * p + 3);
946  std::vector<double> v_psi_l_0k(p + 1), v_diff_psi_l_0k(3 * p + 3);
947  double *psi_l_0i = &*v_psi_l_0i.begin();
948  double *diff_psi_l_0i = &*v_diff_psi_l_0i.begin();
949  double *psi_l_0j = &*v_psi_l_0j.begin();
950  double *diff_psi_l_0j = &*v_diff_psi_l_0j.begin();
951  double *psi_l_0k = &*v_psi_l_0k.begin();
952  double *diff_psi_l_0k = &*v_diff_psi_l_0k.begin();
953 
954  FTensor::Tensor1<double *, 3> t_phi_v(&phi_v[0], &phi_v[1], &phi_v[2], 3);
956  &diff_phi_v[0], &diff_phi_v[3], &diff_phi_v[6], &diff_phi_v[1],
957  &diff_phi_v[4], &diff_phi_v[7], &diff_phi_v[2], &diff_phi_v[5],
958  &diff_phi_v[8], 9);
960 
961  for (int ii = 0; ii != nb_integration_pts; ii++) {
962 
963  const int node_shift = ii * 4;
964  const int n0 = node_shift + 0;
965  const int n1 = node_shift + 1;
966  const int n2 = node_shift + 2;
967  const int n3 = node_shift + 3;
968 
969  const double beta_v = N[n0] * N[n1] * N[n2] * N[n3];
970 
971  const double ksi_0i = N[n1] - N[n0];
972  CHKERR base_polynomials(p, ksi_0i, diff_ksi0i, psi_l_0i, diff_psi_l_0i, 3);
973 
974  const double ksi_0j = N[n2] - N[n0];
975  CHKERR base_polynomials(p, ksi_0j, diff_ksi0j, psi_l_0j, diff_psi_l_0j, 3);
976 
977  const double ksi_0k = N[n3] - N[n0];
978  CHKERR base_polynomials(p, ksi_0k, diff_ksi0k, psi_l_0k, diff_psi_l_0k, 3);
979 
980  FTensor::Tensor1<double, 3> t_diff_beta_v;
981  t_diff_beta_v(j) = t_node_diff_ksi[0](j) * N[n1] * N[n2] * N[n3] +
982  N[n0] * t_node_diff_ksi[1](j) * N[n2] * N[n3] +
983  N[n0] * N[n1] * t_node_diff_ksi[2](j) * N[n3] +
984  N[n0] * N[n1] * N[n2] * t_node_diff_ksi[3](j);
985 
986  int cc = 0;
987  for (int oo = 0; oo <= (p - 4); oo++) {
988  FTensor::Tensor1<double *, 3> t_diff_psi_l_0i(
989  &diff_psi_l_0i[0], &diff_psi_l_0i[p + 1], &diff_psi_l_0i[2 * p + 2],
990  1);
991  for (int pp0 = 0; pp0 <= oo; pp0++) {
992  FTensor::Tensor1<double *, 3> t_diff_psi_l_0j(
993  &diff_psi_l_0j[0], &diff_psi_l_0j[p + 1], &diff_psi_l_0j[2 * p + 2],
994  1);
995  for (int pp1 = 0; (pp0 + pp1) <= oo; pp1++) {
996  const int pp2 = oo - pp0 - pp1;
997  if (pp2 >= 0) {
998  FTensor::Tensor1<double *, 3> t_diff_psi_l_0k(
999  &diff_psi_l_0k[0 + pp2], &diff_psi_l_0k[p + 1 + pp2],
1000  &diff_psi_l_0k[2 * p + 2 + pp2], 1);
1001  const double t = psi_l_0i[pp0] * psi_l_0j[pp1] * psi_l_0k[pp2];
1002  const double a = beta_v * t;
1003  t_phi_v(0) = a;
1004  t_phi_v(1) = 0;
1005  t_phi_v(2) = 0;
1006  ++t_phi_v;
1007  ++cc;
1008  t_phi_v(0) = 0;
1009  t_phi_v(1) = a;
1010  t_phi_v(2) = 0;
1011  ++t_phi_v;
1012  ++cc;
1013  t_phi_v(0) = 0;
1014  t_phi_v(1) = 0;
1015  t_phi_v(2) = a;
1016  ++t_phi_v;
1017  ++cc;
1018  t_b(j) =
1019  t_diff_beta_v(j) * t +
1020  beta_v * (t_diff_psi_l_0i(j) * psi_l_0j[pp1] * psi_l_0k[pp2] +
1021  psi_l_0i[pp0] * t_diff_psi_l_0j(j) * psi_l_0k[pp2] +
1022  psi_l_0i[pp0] * psi_l_0j[pp1] * t_diff_psi_l_0k(j));
1023  t_diff_phi_v(N0, j) = t_b(j);
1024  t_diff_phi_v(N1, j) = 0;
1025  t_diff_phi_v(N2, j) = 0;
1026  ++t_diff_phi_v;
1027  t_diff_phi_v(N0, j) = 0;
1028  t_diff_phi_v(N1, j) = t_b(j);
1029  t_diff_phi_v(N2, j) = 0;
1030  ++t_diff_phi_v;
1031  t_diff_phi_v(N0, j) = 0;
1032  t_diff_phi_v(N1, j) = 0;
1033  t_diff_phi_v(N2, j) = t_b(j);
1034  ++t_diff_phi_v;
1035  }
1036  ++t_diff_psi_l_0j;
1037  }
1038  ++t_diff_psi_l_0i;
1039  }
1040  }
1041 
1042  const int nb_base_fun_on_face = NBVOLUMETET_AINSWORTH_TET_HCURL(p);
1043  if (cc != nb_base_fun_on_face) {
1044  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1045  "Wrong number of base functions %d != %d", cc,
1046  nb_base_fun_on_face);
1047  }
1048  }
1050 }

◆ Hcurl_Demkowicz_EdgeBaseFunctions_MBEDGE()

MoFEMErrorCode MoFEM::Hcurl_Demkowicz_EdgeBaseFunctions_MBEDGE ( int  sense,
int  p,
double n,
double diff_n,
double phi,
double diff_phi,
int  nb_integration_pts 
)

Edge based H-curl base functions on edge.

Function generates hierarchical base of h-curl comforting functions on tetrahedral edge. For more details see [3].

Parameters
sensesense fo edge (i.e. unique orientation)
parray of oder for each edge
narray shape functions evaluated at each integration point
diff_nderivatives of shape functions
phibase functions on edges
diff_phiderivatives of edge shape functions
nb_integration_ptsnumber of integration points
Returns
error code

Definition at line 2144 of file Hcurl.cpp.

2146  {
2148 
2149  FTensor::Tensor1<double, 3> t_grad_n[2];
2150  for (int nn = 0; nn != 2; ++nn)
2151  t_grad_n[nn] = FTensor::Tensor1<double, 3>(diff_n[nn], 0., 0.);
2152 
2153  HcurlEdgeBase h_curl_base_on_edge;
2154 
2156  &phi[HVEC0], &phi[HVEC1], &phi[HVEC2]);
2157 
2158  if (diff_phi != NULL)
2159  SETERRQ(PETSC_COMM_WORLD, MOFEM_DATA_INCONSISTENCY,
2160  "Not implemented derivatives for edge for Hcurl Demkowicz base");
2161 
2162  int n0_idx = 0;
2163  int n1_idx = 1;
2164  if (sense == -1) {
2165  int n_tmp = n0_idx;
2166  n0_idx = n1_idx;
2167  n1_idx = n_tmp;
2168  }
2169 
2170  CHKERR h_curl_base_on_edge.calculate<1, false>(
2171  p, nb_integration_pts, n0_idx, n1_idx, n, t_grad_n, t_phi, nullptr);
2172 
2174 }

◆ Hcurl_Demkowicz_EdgeBaseFunctions_MBTET()

MoFEMErrorCode MoFEM::Hcurl_Demkowicz_EdgeBaseFunctions_MBTET ( int *  sense,
int *  p,
double n,
double diff_n,
double phi[],
double diff_phi[],
int  nb_integration_pts 
)

Edge based H-curl base functions on tetrahedral.

Function generates hierarchical base of h-curl comforting functions on tetrahedral edge. For more details see [3].

Parameters
sensesense fo edge (i.e. unique orientation)
parray of oder for each edge
narray shape functions evaluated at each integration point
diff_nderivatives of shape functions
phibase functions on edges
diff_phiderivatives of edge shape functions
nb_integration_ptsnumber of integration points
Returns
error code

Definition at line 2068 of file Hcurl.cpp.

2070  {
2071 
2072  constexpr int e_nodes[6][2] = {{0, 1}, {1, 2}, {2, 0},
2073  {0, 3}, {1, 3}, {2, 3}};
2074 
2076 
2077  FTensor::Tensor1<double, 3> t_grad_n[4];
2078  for (int nn = 0; nn != 4; ++nn)
2079  t_grad_n[nn] = FTensor::Tensor1<double, 3>(
2080  diff_n[3 * nn + 0], diff_n[3 * nn + 1], diff_n[3 * nn + 2]);
2081 
2082  HcurlEdgeBase h_curl_base_on_edge;
2083 
2084  for (int ee = 0; ee != 6; ++ee) {
2085 
2086  auto t_phi = getFTensor1FromPtr<3>(phi[ee]);
2087  auto t_diff_phi = getFTensor2HVecFromPtr<3, 3>(diff_phi[ee]);
2088 
2089  int n0_idx = e_nodes[ee][0];
2090  int n1_idx = e_nodes[ee][1];
2091  if (sense[ee] == -1) {
2092  int n_tmp = n0_idx;
2093  n0_idx = n1_idx;
2094  n1_idx = n_tmp;
2095  }
2096 
2097  CHKERR h_curl_base_on_edge.calculate<3, true>(p[ee], nb_integration_pts,
2098  n0_idx, n1_idx, n, t_grad_n,
2099  t_phi, &t_diff_phi);
2100  }
2101 
2103 }

◆ Hcurl_Demkowicz_EdgeBaseFunctions_MBTRI()

MoFEMErrorCode MoFEM::Hcurl_Demkowicz_EdgeBaseFunctions_MBTRI ( int *  sense,
int *  p,
double n,
double diff_n,
double phi[],
double diff_phi[],
int  nb_integration_pts 
)

Edge based H-curl base functions on teriangle.

Function generates hierarchical base of h-curl comforting functions on tetrahedral edge. For more details see [3].

Parameters
sensesense fo edge (i.e. unique orientation)
parray of oder for each edge
narray shape functions evaluated at each integration point
diff_nderivatives of shape functions
phibase functions on edges
diff_phiderivatives of edge shape functions
nb_integration_ptsnumber of integration points
Returns
error code

Definition at line 2105 of file Hcurl.cpp.

2107  {
2108 
2109  constexpr int e_nodes[3][2] = {{0, 1}, {1, 2}, {2, 0}};
2110 
2112 
2113  FTensor::Tensor1<double, 3> t_grad_n[3];
2114  for (int nn = 0; nn != 3; ++nn)
2115  t_grad_n[nn] =
2116  FTensor::Tensor1<double, 3>(diff_n[2 * nn + 0], diff_n[2 * nn + 1], 0.);
2117 
2118  HcurlEdgeBase h_curl_base_on_edge;
2119 
2120  for (int ee = 0; ee != 3; ++ee) {
2121 
2122  if (p[ee]) {
2123 
2124  auto t_phi = getFTensor1FromPtr<3>(phi[ee]);
2125  auto t_diff_phi = getFTensor2HVecFromPtr<3, 2>(diff_phi[ee]);
2126 
2127  int n0_idx = e_nodes[ee][0];
2128  int n1_idx = e_nodes[ee][1];
2129  if (sense[ee] == -1) {
2130  int n_tmp = n0_idx;
2131  n0_idx = n1_idx;
2132  n1_idx = n_tmp;
2133  }
2134 
2135  CHKERR h_curl_base_on_edge.calculate<2, true>(p[ee], nb_integration_pts,
2136  n0_idx, n1_idx, n, t_grad_n,
2137  t_phi, &t_diff_phi);
2138  }
2139  }
2140 
2142 }

◆ Hcurl_Demkowicz_FaceBaseFunctions_MBTET()

MoFEMErrorCode MoFEM::Hcurl_Demkowicz_FaceBaseFunctions_MBTET ( int *  faces_nodes,
int *  p,
double n,
double diff_n,
double phi[],
double diff_phi[],
int  nb_integration_pts 
)

Face base interior function.

Parameters
face_nodesarray [4*3] of local indices of face nodes
papproximation order
nnodal shape functions
diff_nderivatives of nodal shape functions
phicalculated shape functions
diff_phiderivatives of shape functions
nb_integration_ptsnumber of shape functions
Returns
error code

Definition at line 2395 of file Hcurl.cpp.

2397  {
2399 
2400  FTensor::Tensor1<double, 3> t_grad_n[4];
2401  for (int nn = 0; nn != 4; ++nn) {
2402  t_grad_n[nn] = FTensor::Tensor1<double, 3>(
2403  diff_n[3 * nn + 0], diff_n[3 * nn + 1], diff_n[3 * nn + 2]);
2404  };
2405 
2406  HcurlFaceBase h_curl_face_base;
2407 
2408  for (int ff = 0; ff != 4; ++ff) {
2409 
2410  if (p[ff] > 1) {
2411 
2412  auto t_phi = getFTensor1FromPtr<3>(phi[ff]);
2413  auto t_diff_phi = getFTensor2HVecFromPtr<3, 3>(diff_phi[ff]);
2414 
2415  // f0, f1 - family I and family II
2416  const int n0f0_idx = faces_nodes[3 * ff + 0];
2417  const int n1f0_idx = faces_nodes[3 * ff + 1];
2418  const int n2f0_idx = faces_nodes[3 * ff + 2];
2419  // family II
2420  const int n0f1_idx = faces_nodes[3 * ff + 1];
2421  const int n1f1_idx = faces_nodes[3 * ff + 2];
2422  const int n2f1_idx = faces_nodes[3 * ff + 0];
2423 
2424  CHKERR h_curl_face_base.calculateTwoFamily<3>(
2425  p[ff], nb_integration_pts, n0f0_idx, n1f0_idx, n2f0_idx, n0f1_idx,
2426  n1f1_idx, n2f1_idx, n, t_grad_n, t_phi, t_diff_phi);
2427  }
2428  }
2429 
2431 }

◆ Hcurl_Demkowicz_FaceBaseFunctions_MBTRI()

MoFEMErrorCode MoFEM::Hcurl_Demkowicz_FaceBaseFunctions_MBTRI ( int *  faces_nodes,
int  p,
double n,
double diff_n,
double phi,
double diff_phi,
int  nb_integration_pts 
)

Face base interior function.

Parameters
face_nodesarray [4*3] of local indices of face nodes
papproximation order
nnodal shape functions
diff_nderivatives of nodal shape functions
phicalculated shape functions
diff_phiderivatives of shape functions
nb_integration_ptsnumber of shape functions
Returns
error code

Definition at line 2433 of file Hcurl.cpp.

2435  {
2437 
2438  FTensor::Tensor1<double, 3> t_grad_n[3];
2439  for (int nn = 0; nn != 3; ++nn) {
2440  t_grad_n[nn] =
2441  FTensor::Tensor1<double, 3>(diff_n[2 * nn + 0], diff_n[2 * nn + 1], 0.);
2442  };
2443 
2444  HcurlFaceBase h_curl_face_base;
2445 
2446  if (p > 1) {
2447 
2448  auto t_phi = getFTensor1FromPtr<3>(phi);
2449  auto t_diff_phi = getFTensor2HVecFromPtr<3, 2>(diff_phi);
2450 
2451  // f0, f1 - family I and family II
2452  const int n0f0_idx = faces_nodes[0];
2453  const int n1f0_idx = faces_nodes[1];
2454  const int n2f0_idx = faces_nodes[2];
2455  // family II
2456  const int n0f1_idx = faces_nodes[1];
2457  const int n1f1_idx = faces_nodes[2];
2458  const int n2f1_idx = faces_nodes[0];
2459 
2460  CHKERR h_curl_face_base.calculateTwoFamily<2>(
2461  p, nb_integration_pts, n0f0_idx, n1f0_idx, n2f0_idx, n0f1_idx, n1f1_idx,
2462  n2f1_idx, n, t_grad_n, t_phi, t_diff_phi);
2463  }
2464 
2466 }

◆ Hcurl_Demkowicz_VolumeBaseFunctions_MBTET()

MoFEMErrorCode MoFEM::Hcurl_Demkowicz_VolumeBaseFunctions_MBTET ( int  p,
double n,
double diff_n,
double phi,
double diff_phi,
int  nb_integration_pts 
)

Volume base interior function.

Parameters
papproximation order
nnodal shape functions
diff_nderivatives of nodal shape functions
phicalculated shape functions
diff_phiderivatives of shape functions
nb_integration_ptsnumber of shape functions
Returns
error code

Definition at line 2468 of file Hcurl.cpp.

2470  {
2471 
2472  constexpr int family[3][4] = {{0, 1, 2, 3}, {1, 2, 3, 0}, {2, 3, 0, 1}};
2475 
2477 
2478  if (p > 2) {
2479 
2480  auto t_phi = getFTensor1FromPtr<3>(phi);
2481  auto t_diff_phi = getFTensor2HVecFromPtr<3, 3>(diff_phi);
2482 
2483  FTensor::Tensor1<double, 3> t_grad_n[4];
2484  for (int nn = 0; nn != 4; ++nn) {
2485  t_grad_n[nn] = FTensor::Tensor1<double, 3>(
2486  diff_n[3 * nn + 0], diff_n[3 * nn + 1], diff_n[3 * nn + 2]);
2487  };
2488 
2489  int nb_face_functions = (NBFACETRI_DEMKOWICZ_HCURL(p - 1)) / 2;
2490  MatrixDouble phi_ij(3, 3 * nb_face_functions * nb_integration_pts);
2491  MatrixDouble diff_phi_ij(3, 9 * nb_face_functions * nb_integration_pts);
2492  MatrixDouble fi_k(3, p + 1);
2493  MatrixDouble diff_fi_k(3, 3 * p + 3);
2494  HcurlFaceBase h_curl_face_base;
2495 
2496  // calate face base for each family
2497  for (int ff = 0; ff != 3; ++ff) {
2498  double *phi_ij_ptr = &phi_ij(ff, 0);
2499  double *diff_phi_ij_ptr = &diff_phi_ij(ff, 0);
2500 
2501  auto t_phi_ij = getFTensor1FromPtr<3>(phi_ij_ptr);
2502  auto t_diff_phi_ij = getFTensor2HVecFromPtr<3, 3>(diff_phi_ij_ptr);
2503 
2504  const int n0_idx = family[ff][0];
2505  const int n1_idx = family[ff][1];
2506  const int n2_idx = family[ff][2];
2507 
2508  CHKERR h_curl_face_base.calculateOneFamily<3>(
2509  p - 1, nb_integration_pts, n0_idx, n1_idx, n2_idx, n, t_grad_n,
2510  t_phi_ij, t_diff_phi_ij);
2511  }
2512 
2513  FTensor::Tensor1<double, 3> &t_grad_n3f0 = t_grad_n[family[0][3]];
2514  FTensor::Tensor1<double, 3> &t_grad_n3f1 = t_grad_n[family[1][3]];
2515  FTensor::Tensor1<double, 3> &t_grad_n3f2 = t_grad_n[family[2][3]];
2516 
2517  FTensor::Tensor1<double, 3> t_sum_f0;
2518  t_sum_f0(i) = -t_grad_n3f0(i);
2519  FTensor::Tensor1<double, 3> t_sum_f1;
2520  t_sum_f1(i) = -t_grad_n3f1(i);
2521  FTensor::Tensor1<double, 3> t_sum_f2;
2522  t_sum_f2(i) = -t_grad_n3f2(i);
2523 
2524  for (int gg = 0; gg != nb_integration_pts; ++gg) {
2525 
2526  int shift_n = 4 * gg;
2527 
2528  double n3f0 = n[shift_n + family[0][3]];
2529  double n3f1 = n[shift_n + family[1][3]];
2530  double n3f2 = n[shift_n + family[2][3]];
2531 
2532  int kk = 0;
2533  for (int oo = 3; oo <= p; ++oo) {
2534 
2535  int phi_shift = 3 * nb_face_functions * gg;
2536  int diff_phi_shift = 9 * nb_face_functions * gg;
2537 
2538  auto t_phi_face_f0 = getFTensor1FromPtr<3>(&phi_ij(0, phi_shift));
2539  auto t_diff_phi_face_f0 =
2540  getFTensor2HVecFromPtr<3, 3>(&diff_phi_ij(0, diff_phi_shift));
2541  auto t_phi_face_f1 = getFTensor1FromPtr<3>(&phi_ij(1, phi_shift));
2542  auto t_diff_phi_face_f1 =
2543  getFTensor2HVecFromPtr<3, 3>(&diff_phi_ij(1, diff_phi_shift));
2544  auto t_phi_face_f2 = getFTensor1FromPtr<3>(&phi_ij(2, phi_shift));
2545  auto t_diff_phi_face_f2 =
2546  getFTensor2HVecFromPtr<3, 3>(&diff_phi_ij(2, diff_phi_shift));
2547 
2548  int ij = 0;
2549  for (int oo_ij = 2; oo_ij != oo; ++oo_ij) {
2550  int k = oo - oo_ij;
2551 
2552  CHKERR IntegratedJacobi_polynomials(k, 2 * oo_ij, n3f0, 1 - n3f0,
2553  &t_grad_n3f0(0), &t_sum_f0(0),
2554  &fi_k(0, 0), &diff_fi_k(0, 0), 3);
2555  CHKERR IntegratedJacobi_polynomials(k, 2 * oo_ij, n3f1, 1 - n3f1,
2556  &t_grad_n3f1(0), &t_sum_f1(0),
2557  &fi_k(1, 0), &diff_fi_k(1, 0), 3);
2558  CHKERR IntegratedJacobi_polynomials(k, 2 * oo_ij, n3f2, 1 - n3f2,
2559  &t_grad_n3f2(0), &t_sum_f2(0),
2560  &fi_k(2, 0), &diff_fi_k(2, 0), 3);
2561 
2562  FTensor::Tensor1<double, 3> t_diff_fi_k_f0(
2563  diff_fi_k(0, 0 + k - 1), diff_fi_k(0, k + k - 1),
2564  diff_fi_k(0, 2 * k + k - 1));
2565  FTensor::Tensor1<double, 3> t_diff_fi_k_f1(
2566  diff_fi_k(1, 0 + k - 1), diff_fi_k(1, k + k - 1),
2567  diff_fi_k(1, 2 * k + k - 1));
2568  FTensor::Tensor1<double, 3> t_diff_fi_k_f2(
2569  diff_fi_k(2, 0 + k - 1), diff_fi_k(2, k + k - 1),
2570  diff_fi_k(2, 2 * k + k - 1));
2571 
2572  for (; ij != NBFACETRI_DEMKOWICZ_HCURL(oo_ij) / 2; ++ij) {
2573  t_phi(i) = fi_k(0, k - 1) * t_phi_face_f0(i);
2574  t_diff_phi(i, j) = t_diff_fi_k_f0(j) * t_phi_face_f0(i) +
2575  fi_k(0, k - 1) * t_diff_phi_face_f0(i, j);
2576  ++t_phi;
2577  ++t_diff_phi;
2578  ++t_phi_face_f0;
2579  ++t_diff_phi_face_f0;
2580  ++kk;
2581 
2582  t_phi(i) = fi_k(1, k - 1) * t_phi_face_f1(i);
2583  t_diff_phi(i, j) = t_diff_fi_k_f1(j) * t_phi_face_f1(i) +
2584  fi_k(1, k - 1) * t_diff_phi_face_f1(i, j);
2585  ++t_phi;
2586  ++t_diff_phi;
2587  ++t_phi_face_f1;
2588  ++t_diff_phi_face_f1;
2589  ++kk;
2590 
2591  t_phi(i) = fi_k(2, k - 1) * t_phi_face_f2(i);
2592  t_diff_phi(i, j) = t_diff_fi_k_f2(j) * t_phi_face_f2(i) +
2593  fi_k(2, k - 1) * t_diff_phi_face_f2(i, j);
2594  ++t_phi;
2595  ++t_diff_phi;
2596  ++t_phi_face_f2;
2597  ++t_diff_phi_face_f2;
2598  ++kk;
2599  }
2600  }
2601  }
2602  if (kk != NBVOLUMETET_DEMKOWICZ_HCURL(p))
2603  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
2604  "Wrong number of base functions");
2605  }
2606  }
2607 
2609 }

◆ Hdiv_Ainsworth_EdgeBasedVolumeShapeFunctions_MBTET()

MoFEMErrorCode MoFEM::Hdiv_Ainsworth_EdgeBasedVolumeShapeFunctions_MBTET ( int  p,
double N,
double diffN,
double phi_v_e[6],
double diff_phi_v_e[6],
int  gdim,
PetscErrorCode(*)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)  base_polynomials 
)

Hdiv base function, Edge-based interior (volume) functions by Ainsworth [1].

Parameters
pvolume approx. order
Nshape functions
diffNderivatives of shape functions
phi_v_ebase functions (return)
diff_phi_v_ederivatives of base functions (returned)
gdimnumber of integration points
base_polynomialsbase function (Legendre/Lobbatto-Gauss)
Returns
error code

Definition at line 307 of file Hdiv.cpp.

312  {
313 
314  constexpr int edges_nodes[6][2] = {{0, 1}, {1, 2}, {2, 0},
315  {0, 3}, {1, 3}, {2, 3}};
316 
318  if (p < 2)
320  if (diffN == NULL) {
321  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
322  }
323 
324  FTensor::Tensor1<double, 3> t_coords[4] = {
325  FTensor::Tensor1<double, 3>(0., 0., 0.),
326  FTensor::Tensor1<double, 3>(1., 0., 0.),
327  FTensor::Tensor1<double, 3>(0., 1., 0.),
328  FTensor::Tensor1<double, 3>(0., 0., 1.)};
329  FTensor::Tensor1<double *, 3> t_node_diff_ksi[4] = {
330  FTensor::Tensor1<double *, 3>(&diffN[0], &diffN[1], &diffN[2]),
331  FTensor::Tensor1<double *, 3>(&diffN[3], &diffN[4], &diffN[5]),
332  FTensor::Tensor1<double *, 3>(&diffN[6], &diffN[7], &diffN[8]),
333  FTensor::Tensor1<double *, 3>(&diffN[9], &diffN[10], &diffN[11])};
334 
335  FTENSOR_INDEX(3, i);
336  FTENSOR_INDEX(3, j);
337 
339  FTensor::Tensor1<double, 3> t_diff_ksi0i;
340  FTensor::Tensor1<double, 3> t_diff_beta_e;
341 
342  double psi_l[p + 1];
343  double diff_psi_l[3 * (p + 1)];
344 
345  for (int ee = 0; ee != 6; ee++) {
346  t_tou_e(i) =
347  t_coords[edges_nodes[ee][1]](i) - t_coords[edges_nodes[ee][0]](i);
348  t_diff_ksi0i(i) = t_node_diff_ksi[edges_nodes[ee][1]](i) -
349  t_node_diff_ksi[edges_nodes[ee][0]](i);
350  auto t_phi_v_e = getFTensor1FromPtr<3>(phi_v_e[ee]);
351  for (int ii = 0; ii != gdim; ii++) {
352  const int node_shift = ii * 4;
353  const double ni = N[node_shift + edges_nodes[ee][1]];
354  const double n0 = N[node_shift + edges_nodes[ee][0]];
355  const double beta_e = ni * n0;
356  const double ksi0i = ni - n0;
357  base_polynomials(p, ksi0i, NULL, psi_l, NULL, 3);
358  auto t_psi_l = FTensor::Tensor0<FTensor::PackPtr<double *, 1>>(psi_l);
359  for (int l = 0; l <= p - 2; l++) {
360  t_phi_v_e(i) = (beta_e * t_psi_l) * t_tou_e(i);
361  ++t_phi_v_e;
362  ++t_psi_l;
363  }
364  }
365  }
366 
367  if (diff_phi_v_e) {
368  for (int ee = 0; ee != 6; ee++) {
369  t_tou_e(i) =
370  t_coords[edges_nodes[ee][1]](i) - t_coords[edges_nodes[ee][0]](i);
371  t_diff_ksi0i(i) = t_node_diff_ksi[edges_nodes[ee][1]](i) -
372  t_node_diff_ksi[edges_nodes[ee][0]](i);
373  auto t_diff_phi_v_e = getFTensor2HVecFromPtr<3, 3>(diff_phi_v_e[ee]);
374  for (int ii = 0; ii != gdim; ii++) {
375  const int node_shift = ii * 4;
376  const double ni = N[node_shift + edges_nodes[ee][1]];
377  const double n0 = N[node_shift + edges_nodes[ee][0]];
378  const double beta_e = ni * n0;
379  const double ksi0i = ni - n0;
380  t_diff_beta_e(i) = ni * t_node_diff_ksi[edges_nodes[ee][0]](i) +
381  t_node_diff_ksi[edges_nodes[ee][1]](i) * n0;
382  base_polynomials(p, ksi0i, &t_diff_ksi0i(0), psi_l, diff_psi_l, 3);
383  auto t_psi_l = FTensor::Tensor0<FTensor::PackPtr<double *, 1>>(psi_l);
384  auto t_diff_psi_l = FTensor::Tensor1<FTensor::PackPtr<double *, 1>, 3>(
385  diff_psi_l, &diff_psi_l[p + 1], &diff_psi_l[2 * p + 2]);
386  for (int l = 0; l <= p - 2; l++) {
387  t_diff_phi_v_e(i, j) =
388  (t_diff_beta_e(j) * t_psi_l + beta_e * t_diff_psi_l(j)) *
389  t_tou_e(i);
390  ++t_diff_phi_v_e;
391  ++t_diff_psi_l;
392  ++t_psi_l;
393  }
394  }
395  }
396  }
397 
399 }

◆ Hdiv_Ainsworth_EdgeFaceShapeFunctions_MBTET()

MoFEMErrorCode MoFEM::Hdiv_Ainsworth_EdgeFaceShapeFunctions_MBTET ( int *  faces_nodes,
int *  p,
double N,
double diffN,
double phi_f_e[4][3],
double diff_phi_f_e[4][3],
int  gdim,
PetscErrorCode(*)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)  base_polynomials 
)

Hdiv base functions, Edge-based face functions by Ainsworth [1].

Parameters
faces_nodesFace nodes on tetrahedral
pApproximation order on faces
NShape functions
diffNDerivatives of shape functions
phi_f_eBase functions (returned)
diff_phi_f_eDerivatives of base functions (returned)
gdimNumber of integration pts
base_polynomialsbase function (Legendre/Lobbatto-Gauss)
Returns
error code

Definition at line 24 of file Hdiv.cpp.

29  {
30 
32 #ifdef NDEBUG
33  if (!diff_phi_f_e)
34  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
35  "expected to return derivatives");
36 #endif
37 
38  for (int ff = 0; ff < 4; ff++) {
40  &faces_nodes[3 * ff], p[ff], N, diffN, phi_f_e[ff], diff_phi_f_e[ff],
41  gdim, 4, base_polynomials);
42  }
43 
45 }

◆ Hdiv_Ainsworth_EdgeFaceShapeFunctions_MBTET_ON_FACE()

MoFEMErrorCode MoFEM::Hdiv_Ainsworth_EdgeFaceShapeFunctions_MBTET_ON_FACE ( int *  faces_nodes,
int  p,
double N,
double diffN,
double phi_f_e[3],
double diff_phi_f_e[3],
int  gdim,
int  nb,
PetscErrorCode(*)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)  base_polynomials 
)

Hdiv base functions, Edge-based face functions by Ainsworth [1].

Parameters
faces_nodesFace nodes on face
pApproximation order on faces
NShape functions
diffNDerivatives of shape functions
phi_f_eBase functions (returned)
diff_phi_f_eDerivatives of base functions (returned)
gdimNumber of integration pts
base_polynomialsbase function (Legendre/Lobbatto-Gauss)
nbNumber of nodes on entity (4 if tet, 3 if triangle)
Returns
error code

Definition at line 47 of file Hdiv.cpp.

52  {
53 
54  constexpr int face_edges_nodes[3][2] = {{0, 1}, {1, 2}, {2, 0}};
55  constexpr int face_opposite_edges_node[] = {2, 0, 1};
56  FTENSOR_INDEX(3, i);
57  FTENSOR_INDEX(3, j);
58  FTENSOR_INDEX(3, k);
59 
61  if (p < 1)
63 
64  FTensor::Tensor1<double, 3> t_edge_cross[3];
65  FTensor::Tensor1<double, 3> t_node_diff_ksi[4];
66  FTensor::Tensor1<double, 3> t_diff_ksi[3];
67  if (diffN) {
68  t_node_diff_ksi[0] =
69  FTensor::Tensor1<double, 3>(diffN[0], diffN[1], diffN[2]);
70  t_node_diff_ksi[1] =
71  FTensor::Tensor1<double, 3>(diffN[3], diffN[4], diffN[5]);
72  t_node_diff_ksi[2] =
73  FTensor::Tensor1<double, 3>(diffN[6], diffN[7], diffN[8]);
74  t_node_diff_ksi[3] =
75  FTensor::Tensor1<double, 3>(diffN[9], diffN[10], diffN[11]);
76  for (int ee = 0; ee < 3; ee++) {
77  const int n0 = faces_nodes[face_edges_nodes[ee][0]];
78  const int n1 = faces_nodes[face_edges_nodes[ee][1]];
79  t_diff_ksi[ee](i) = t_node_diff_ksi[n1](i) - t_node_diff_ksi[n0](i);
80  t_edge_cross[ee](i) = levi_civita(i, j, k) * t_node_diff_ksi[n0](j) *
81  t_node_diff_ksi[n1](k);
82  }
83  } else {
84  for (int ee = 0; ee < 3; ee++) {
85  t_edge_cross[ee](0) = 1;
86  t_edge_cross[ee](1) = 0;
87  t_edge_cross[ee](2) = 0;
88  }
89  }
90  double psi_l[p + 1];
91 
92  for (int ee = 0; ee != 3; ee++) {
93  const int i0 = faces_nodes[face_edges_nodes[ee][0]];
94  const int i1 = faces_nodes[face_edges_nodes[ee][1]];
95  const int iO = faces_nodes[face_opposite_edges_node[ee]];
96  auto t_psi_f_e = getFTensor1FromPtr<3>(phi_f_e[ee]);
97  for (int ii = 0; ii != nb * gdim; ii += nb) {
98  const double n0 = N[ii + i0];
99  const double n1 = N[ii + i1];
100  const double lambda = N[ii + iO];
101  const double ksi = n1 - n0;
102  base_polynomials(p, ksi, NULL, psi_l, NULL, 3);
103  auto t_psi_l = FTensor::Tensor0<FTensor::PackPtr<double *, 1>>(psi_l);
104  int jj = 0;
105  for (int l = 0; l <= p - 1; l++) {
106  t_psi_f_e(i) = (lambda * t_psi_l) * t_edge_cross[ee](i);
107  ++t_psi_f_e;
108  ++t_psi_l;
109  ++jj;
110  }
111 #ifdef NDEBUG
112  if (jj != NBFACETRI_AINSWORTH_EDGE_HDIV(p)) {
113  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
114  "wrong order %d != %d", jj, NBFACETRI_AINSWORTH_EDGE_HDIV(p));
115  }
116 #endif
117  }
118  }
119 
120  if (diff_phi_f_e) {
121  double diff_psi_l[3 * (p + 1)];
122  for (int ee = 0; ee != 3; ee++) {
123  const int i0 = faces_nodes[face_edges_nodes[ee][0]];
124  const int i1 = faces_nodes[face_edges_nodes[ee][1]];
125  const int iO = faces_nodes[face_opposite_edges_node[ee]];
126  auto t_diff_phi_f_e = getFTensor2HVecFromPtr<3, 3>(diff_phi_f_e[ee]);
127  for (int ii = 0; ii != nb * gdim; ii += nb) {
128  const double n0 = N[ii + i0];
129  const double n1 = N[ii + i1];
130  const double lambda = N[ii + iO];
131  const double ksi = n1 - n0;
132  base_polynomials(p, ksi, &t_diff_ksi[ee](0), psi_l, diff_psi_l, 3);
133  auto t_psi_l = FTensor::Tensor0<FTensor::PackPtr<double *, 1>>(psi_l);
134  auto t_diff_psi_l = FTensor::Tensor1<FTensor::PackPtr<double *, 1>, 3>{
135  &diff_psi_l[0], &diff_psi_l[p + 1], &diff_psi_l[2 * p + 2]};
136  for (int l = 0; l <= p - 1; l++) {
137  t_diff_phi_f_e(i, j) =
138  (t_node_diff_ksi[iO](j) * t_psi_l + lambda * t_diff_psi_l(j)) *
139  t_edge_cross[ee](i);
140  ++t_diff_psi_l;
141  ++t_diff_phi_f_e;
142  ++t_psi_l;
143  }
144  }
145  }
146  }
147 
149 }

◆ Hdiv_Ainsworth_FaceBasedVolumeShapeFunctions_MBTET()

MoFEMErrorCode MoFEM::Hdiv_Ainsworth_FaceBasedVolumeShapeFunctions_MBTET ( int  p,
double N,
double diffN,
double phi_v_f[],
double diff_phi_v_f[],
int  gdim,
PetscErrorCode(*)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)  base_polynomials 
)

Hdiv Face-based interior functions by Ainsworth [1]

Parameters
pApproximation order on face
NShape functions on face
diffNDerivatives of shape functions of face
phi_v_fBase functions (returned)
diff_phi_v_fDerivatives of base functions (returned)
gdimNumber of integration points
base_polynomialsBase function (Legendre/Lobbatto-Gauss)
Returns
Error code

Definition at line 401 of file Hdiv.cpp.

406  {
407 
408  constexpr int faces_nodes[4][3] = {
409  {0, 1, 3}, {1, 2, 3}, {0, 3, 2}, {0, 2, 1}};
410 
412  if (p < 3)
414 
415  FTensor::Tensor1<double, 3> t_coords[4] = {
416  FTensor::Tensor1<double, 3>(0., 0., 0.),
417  FTensor::Tensor1<double, 3>(1., 0., 0.),
418  FTensor::Tensor1<double, 3>(0., 1., 0.),
419  FTensor::Tensor1<double, 3>(0., 0., 1.)};
420 
421  FTensor::Tensor1<double *, 3> t_node_diff_ksi[4] = {
422  FTensor::Tensor1<double *, 3>(&diffN[0], &diffN[1], &diffN[2]),
423  FTensor::Tensor1<double *, 3>(&diffN[3], &diffN[4], &diffN[5]),
424  FTensor::Tensor1<double *, 3>(&diffN[6], &diffN[7], &diffN[8]),
425  FTensor::Tensor1<double *, 3>(&diffN[9], &diffN[10], &diffN[11])};
426 
427  FTENSOR_INDEX(3, i);
428  FTENSOR_INDEX(3, j);
429 
430  FTensor::Tensor1<double, 3> t_tau0i[4], t_tau0j[4];
431  FTensor::Tensor1<double, 3> t_diff_ksi0i[4], t_diff_ksi0j[4];
432  for (int ff = 0; ff != 4; ff++) {
433  const int v0 = faces_nodes[ff][0];
434  const int vi = faces_nodes[ff][1];
435  const int vj = faces_nodes[ff][2];
436  t_tau0i[ff](i) = t_coords[vi](i) - t_coords[v0](i);
437  t_tau0j[ff](i) = t_coords[vj](i) - t_coords[v0](i);
438  t_diff_ksi0i[ff](i) = t_node_diff_ksi[vi](i) - t_node_diff_ksi[v0](i);
439  t_diff_ksi0j[ff](i) = t_node_diff_ksi[vj](i) - t_node_diff_ksi[v0](i);
440  }
441 
442  double psi_l[p + 1], psi_m[p + 1];
443  double diff_psi_l[3 * (p + 1)], diff_psi_m[3 * (p + 1)];
444  for (int ff = 0; ff != 4; ff++) {
445  const int v0 = faces_nodes[ff][0];
446  const int vi = faces_nodes[ff][1];
447  const int vj = faces_nodes[ff][2];
448  auto t_phi_v_f = getFTensor1FromPtr<3>(phi_v_f[ff]);
449  auto t_diff_phi_v_f = getFTensor2HVecFromPtr<3, 3>(diff_phi_v_f[ff]);
450  for (int ii = 0; ii < gdim; ii++) {
451  const int node_shift = 4 * ii;
452  const double n0 = N[node_shift + v0];
453  const double ni = N[node_shift + vi];
454  const double nj = N[node_shift + vj];
455  const double beta_f = n0 * ni * nj;
456  FTensor::Tensor1<double, 3> t_diff_beta_f;
457  t_diff_beta_f(i) = (ni * nj) * t_node_diff_ksi[v0](i) +
458  (n0 * nj) * t_node_diff_ksi[vi](i) +
459  (n0 * ni) * t_node_diff_ksi[vj](i);
460  const double ksi0i = ni - n0;
461  const double ksi0j = nj - n0;
462  base_polynomials(p, ksi0i, &t_diff_ksi0i[ff](0), psi_l, diff_psi_l, 3);
463  base_polynomials(p, ksi0j, &t_diff_ksi0j[ff](0), psi_m, diff_psi_m, 3);
465  int jj = 0;
466  for (int oo = 0; oo <= p - 3; oo++) {
467  auto t_psi_l = FTensor::Tensor0<FTensor::PackPtr<double *, 1>>(psi_l);
468  auto t_diff_psi_l = FTensor::Tensor1<FTensor::PackPtr<double *, 1>, 3>(
469  diff_psi_l, &diff_psi_l[p + 1], &diff_psi_l[2 * p + 2]);
470  for (int l = 0; l <= oo; l++) {
471  int m = oo - l;
472  if (m >= 0) {
473  auto t_diff_psi_m = FTensor::Tensor1<double, 3>{
474  diff_psi_m[m], diff_psi_m[p + 1 + m],
475  diff_psi_m[2 * p + 2 + m]};
476  const double a = beta_f * t_psi_l * psi_m[m];
477  t_phi_v_f(i) = a * t_tau0i[ff](i);
478  ++t_phi_v_f;
479  ++jj;
480  t_phi_v_f(i) = a * t_tau0j[ff](i);
481  ++t_phi_v_f;
482  ++jj;
483 
484  t_diff_a(j) = (t_psi_l * psi_m[m]) * t_diff_beta_f(j) +
485  (beta_f * psi_m[m]) * t_diff_psi_l(j) +
486  (beta_f * t_psi_l) * t_diff_psi_m(j);
487  t_diff_phi_v_f(i, j) = t_diff_a(j) * t_tau0i[ff](i);
488  ++t_diff_phi_v_f;
489  t_diff_phi_v_f(i, j) = t_diff_a(j) * t_tau0j[ff](i);
490  ++t_diff_phi_v_f;
491 
492  ++t_psi_l;
493  ++t_diff_psi_l;
494  }
495  }
496  }
497  if (jj != NBVOLUMETET_AINSWORTH_FACE_HDIV(p)) {
498  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
499  "wrong order %d != %d", jj,
501  }
502  }
503  }
505 }

◆ Hdiv_Ainsworth_FaceBubbleShapeFunctions()

MoFEMErrorCode MoFEM::Hdiv_Ainsworth_FaceBubbleShapeFunctions ( int *  faces_nodes,
int *  p,
double N,
double diffN,
double phi_f[],
double diff_phi_f[],
int  gdim,
PetscErrorCode(*)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)  base_polynomials 
)

Face bubble functions by Ainsworth [1].

Parameters
faces_nodesFace nodes on tetrahedral
pApprox. order on faces
NShape function
diffNDerivatives of shape functions
phi_fBase functions
diff_phi_fDerivatives of base functions
gdimNumber of integration pts
base_polynomialsBase function (Legendre/Lobbatto-Gauss)
Returns
error code

Definition at line 151 of file Hdiv.cpp.

156  {
157 
159 
160 #ifdef NDEBUG
161  if (!diff_phi_f)
162  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
163  "expected to return derivatives");
164 #endif
165 
166  for (int ff = 0; ff < 4; ff++) {
168  &faces_nodes[3 * ff], p[ff], N, diffN, phi_f[ff], diff_phi_f[ff], gdim,
169  4, base_polynomials);
170  }
172 }

◆ Hdiv_Ainsworth_FaceBubbleShapeFunctions_ON_FACE()

MoFEMErrorCode MoFEM::Hdiv_Ainsworth_FaceBubbleShapeFunctions_ON_FACE ( int *  faces_nodes,
int  p,
double N,
double diffN,
double phi_f,
double diff_phi_f,
int  gdim,
int  nb,
PetscErrorCode(*)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)  base_polynomials 
)

Face bubble functions by Ainsworth [1].

Parameters
faces_nodesFace nodes on face
pApprox. order on face
NShape function
diffNDerivatives of shape functions
phi_fBase functions
diff_phi_fDerivatives of base functions
gdimNumber of integration pts
nbNumber of nodes on entity (4 if tet, 3 if triangle)
base_polynomialsBase function (Legendre/Lobbatto-Gauss)
Returns
error code

Definition at line 174 of file Hdiv.cpp.

179  {
180  FTENSOR_INDEX(3, i);
181  FTENSOR_INDEX(3, j);
182  FTENSOR_INDEX(3, k);
183 
185  if (p < 3)
187 
188  const int vert_i = face_nodes[1];
189  const int vert_j = face_nodes[2];
190  const int i0 = face_nodes[0];
192  FTensor::Tensor1<double, 3> t_node_diff_ksi[4];
193  FTensor::Tensor1<double, 3> t_diff_ksi0i;
194  FTensor::Tensor1<double, 3> t_diff_ksi0j;
195 
196  if (diffN) {
197  t_node_diff_ksi[0] =
198  FTensor::Tensor1<double, 3>(diffN[0], diffN[1], diffN[2]);
199  t_node_diff_ksi[1] =
200  FTensor::Tensor1<double, 3>(diffN[3], diffN[4], diffN[5]);
201  t_node_diff_ksi[2] =
202  FTensor::Tensor1<double, 3>(diffN[6], diffN[7], diffN[8]);
203  t_node_diff_ksi[3] =
204  FTensor::Tensor1<double, 3>(diffN[9], diffN[10], diffN[11]);
205  t_diff_ksi0i(i) = t_node_diff_ksi[vert_i](i) - t_node_diff_ksi[i0](i);
206  t_diff_ksi0j(i) = t_node_diff_ksi[vert_j](i) - t_node_diff_ksi[i0](i);
207  t_cross(i) = levi_civita(i, j, k) * t_node_diff_ksi[vert_i](j) *
208  t_node_diff_ksi[vert_j](k);
209  } else {
210  t_cross(0) = 1;
211  t_cross(1) = 0;
212  t_cross(2) = 0;
213  }
214 
215  double psi_l[p + 1], diff_psi_l[3 * (p + 1)];
216  double psi_m[p + 1], diff_psi_m[3 * (p + 1)];
217  auto t_psi_f = getFTensor1FromPtr<3>(phi_f);
218 
219  for (int ii = 0; ii < gdim; ii++) {
220 
221  const int node_shift = ii * nb;
222  const double ni = N[node_shift + vert_i];
223  const double nj = N[node_shift + vert_j];
224  const double n0 = N[node_shift + i0];
225  const double ksi0i = ni - n0;
226  const double ksi0j = nj - n0;
227  double beta_0ij = n0 * ni * nj;
228  base_polynomials(p, ksi0i, NULL, psi_l, NULL, 3);
229  base_polynomials(p, ksi0j, NULL, psi_m, NULL, 3);
230 
231  int jj = 0;
232  int oo = 0;
233  for (; oo <= p - 3; oo++) {
234  auto t_psi_l = FTensor::Tensor0<FTensor::PackPtr<double *, 1>>(psi_l);
235  for (int l = 0; l <= oo; l++) {
236  int m = oo - l;
237  if (m >= 0) {
238  t_psi_f(i) = (beta_0ij * t_psi_l * psi_m[m]) * t_cross(i);
239  ++t_psi_f;
240  }
241  ++t_psi_l;
242  ++jj;
243  }
244  }
245 #ifdef NDEBUG
246  if (jj != NBFACETRI_AINSWORTH_FACE_HDIV(p)) {
247  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
248  "wrong order %d != %d", jj, NBFACETRI_AINSWORTH_FACE_HDIV(p));
249  }
250 #endif
251  }
252 
253  if (diff_phi_f) {
254  auto t_diff_phi_f = getFTensor2HVecFromPtr<3, 3>(diff_phi_f);
255 
256  for (int ii = 0; ii < gdim; ii++) {
257 
258  const int node_shift = ii * nb;
259  const double ni = N[node_shift + vert_i];
260  const double nj = N[node_shift + vert_j];
261  const double n0 = N[node_shift + i0];
262  const double ksi0i = ni - n0;
263  const double ksi0j = nj - n0;
264  double beta_0ij = n0 * ni * nj;
265  FTensor::Tensor1<double, 3> t_diff_beta_0ij;
266  t_diff_beta_0ij(i) = (ni * nj) * t_node_diff_ksi[i0](i) +
267  (n0 * nj) * t_node_diff_ksi[vert_i](i) +
268  (n0 * ni) * t_node_diff_ksi[vert_j](i);
269  base_polynomials(p, ksi0i, &t_diff_ksi0i(0), psi_l, diff_psi_l, 3);
270  base_polynomials(p, ksi0j, &t_diff_ksi0j(0), psi_m, diff_psi_m, 3);
271 
272  int jj = 0;
273  int oo = 0;
274  for (; oo <= p - 3; oo++) {
275  auto t_psi_l = FTensor::Tensor0<FTensor::PackPtr<double *, 1>>(psi_l);
276  auto t_diff_psi_l = FTensor::Tensor1<FTensor::PackPtr<double *, 1>, 3>{
277  &diff_psi_l[0], &diff_psi_l[p + 1], &diff_psi_l[2 * p + 2]};
278  for (int l = 0; l <= oo; l++) {
279  int m = oo - l;
280  if (m >= 0) {
281  auto t_diff_psi_m =
283  &diff_psi_m[m], &diff_psi_m[p + 1 + m],
284  &diff_psi_m[2 * p + 2 + m]};
285  t_diff_phi_f(i, j) = ((t_psi_l * psi_m[m]) * t_diff_beta_0ij(j) +
286  (beta_0ij * psi_m[m]) * t_diff_psi_l(j) +
287  (beta_0ij * t_psi_l) * t_diff_psi_m(j)) *
288  t_cross(i);
289  ++t_diff_phi_f;
290  }
291  ++t_psi_l;
292  ++t_diff_psi_l;
293  ++jj;
294  }
295  }
296 #ifndef NDEBUG
297  if (jj != NBFACETRI_AINSWORTH_FACE_HDIV(p)) {
298  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
299  "wrong order %d != %d", jj, NBFACETRI_AINSWORTH_FACE_HDIV(p));
300  }
301 #endif
302  }
303  }
305 }

◆ Hdiv_Ainsworth_VolumeBubbleShapeFunctions_MBTET()

MoFEMErrorCode MoFEM::Hdiv_Ainsworth_VolumeBubbleShapeFunctions_MBTET ( int  p,
double N,
double diffN,
double phi_v,
double diff_phi_v,
int  gdim,
PetscErrorCode(*)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)  base_polynomials 
)

Interior bubble functions by Ainsworth [1].

Parameters
pVolume order
NShape functions
diffNDerivatives of shape functions
phi_vBase functions
diff_phi_vDerivatives of shape functions
gdimNumber of integration points
base_polynomialsBase function (Legendre/Lobbatto-Gauss)
Returns
Error code

Definition at line 507 of file Hdiv.cpp.

512  {
513 
515  if (p < 4)
517 
518  FTensor::Tensor1<double *, 3> t_node_diff_ksi[4] = {
519  FTensor::Tensor1<double *, 3>(&diffN[0], &diffN[1], &diffN[2]),
520  FTensor::Tensor1<double *, 3>(&diffN[3], &diffN[4], &diffN[5]),
521  FTensor::Tensor1<double *, 3>(&diffN[6], &diffN[7], &diffN[8]),
522  FTensor::Tensor1<double *, 3>(&diffN[9], &diffN[10], &diffN[11])};
523 
529 
530  FTensor::Tensor1<double, 3> t_diff_ksi0i;
531  FTensor::Tensor1<double, 3> t_diff_ksi0j;
532  FTensor::Tensor1<double, 3> t_diff_ksi0k;
533 
534  t_diff_ksi0i(i) = t_node_diff_ksi[1](i) - t_node_diff_ksi[0](i);
535  t_diff_ksi0j(i) = t_node_diff_ksi[2](i) - t_node_diff_ksi[0](i);
536  t_diff_ksi0k(i) = t_node_diff_ksi[3](i) - t_node_diff_ksi[0](i);
537 
538  double psi_l[p + 1];
539  double diff_psi_l[3 * (p + 1)];
540  double psi_m[p + 1];
541  double diff_psi_m[3 * (p + 1)];
542  double psi_n[p + 1];
543  double diff_psi_n[3 * (p + 1)];
544 
545  auto t_phi_v = getFTensor1FromPtr<3>(phi_v);
546  auto t_diff_phi_v = getFTensor2HVecFromPtr<3, 3>(diff_phi_v);
547 
548  FTensor::Tensor1<double, 3> t_diff_beta_v;
549  for (int ii = 0; ii < gdim; ii++) {
550  const int node_shift = ii * 4;
551  const double n0 = N[node_shift + 0];
552  const double ni = N[node_shift + 1];
553  const double nj = N[node_shift + 2];
554  const double nk = N[node_shift + 3];
555  const double ksi0i = ni - n0;
556  const double ksi0j = nj - n0;
557  const double ksi0k = nk - n0;
558  const double beta_v = n0 * ni * nj * nk;
559  t_diff_beta_v(i) = (ni * nj * nk) * t_node_diff_ksi[0](i) +
560  (n0 * nj * nk) * t_node_diff_ksi[1](i) +
561  (n0 * ni * nk) * t_node_diff_ksi[2](i) +
562  (n0 * ni * nj) * t_node_diff_ksi[3](i);
563  base_polynomials(p, ksi0i, &t_diff_ksi0i(0), psi_l, diff_psi_l, 3);
564  base_polynomials(p, ksi0j, &t_diff_ksi0j(0), psi_m, diff_psi_m, 3);
565  base_polynomials(p, ksi0k, &t_diff_ksi0k(0), psi_n, diff_psi_n, 3);
566 
568 
569  int jj = 0;
570  for (int oo = 0; oo <= p - 4; oo++) {
571  auto t_psi_l = FTensor::Tensor0<FTensor::PackPtr<double *, 1>>(psi_l);
572  auto t_diff_psi_l = FTensor::Tensor1<FTensor::PackPtr<double *, 1>, 3>(
573  diff_psi_l, &diff_psi_l[p + 1], &diff_psi_l[2 * p + 2]);
574  for (int l = 0; l <= oo; l++) {
575  auto t_psi_m = FTensor::Tensor0<FTensor::PackPtr<double *, 1>>(psi_m);
576  auto t_diff_psi_m = FTensor::Tensor1<FTensor::PackPtr<double *, 1>, 3>(
577  diff_psi_m, &diff_psi_m[p + 1], &diff_psi_m[2 * p + 2]);
578  for (int m = 0; (l + m) <= oo; m++) {
579  int n = oo - l - m;
580  if (n >= 0) {
581  FTensor::Tensor1<double, 3> t_diff_psi_n(diff_psi_n[n],
582  diff_psi_n[p + 1 + n],
583  diff_psi_n[2 * p + 2 + n]);
584  const double a = beta_v * t_psi_l * t_psi_m * psi_n[n];
585  t_phi_v(0) = a;
586  t_phi_v(1) = 0;
587  t_phi_v(2) = 0;
588  ++t_phi_v;
589  t_phi_v(0) = 0;
590  t_phi_v(1) = a;
591  t_phi_v(2) = 0;
592  ++t_phi_v;
593  t_phi_v(0) = 0;
594  t_phi_v(1) = 0;
595  t_phi_v(2) = a;
596  ++t_phi_v;
597  t_diff_a(j) = (t_psi_l * t_psi_m * psi_n[n]) * t_diff_beta_v(j) +
598  (beta_v * t_psi_m * psi_n[n]) * t_diff_psi_l(j) +
599  (beta_v * t_psi_l * psi_n[n]) * t_diff_psi_m(j) +
600  (beta_v * t_psi_l * t_psi_m) * t_diff_psi_n(j);
601  t_diff_phi_v(N0, j) = t_diff_a(j);
602  t_diff_phi_v(N1, j) = 0;
603  t_diff_phi_v(N2, j) = 0;
604  ++t_diff_phi_v;
605  t_diff_phi_v(N0, j) = 0;
606  t_diff_phi_v(N1, j) = t_diff_a(j);
607  t_diff_phi_v(N2, j) = 0;
608  ++t_diff_phi_v;
609  t_diff_phi_v(N0, j) = 0;
610  t_diff_phi_v(N1, j) = 0;
611  t_diff_phi_v(N2, j) = t_diff_a(j);
612  ++t_diff_phi_v;
613  ++jj;
614  }
615  ++t_psi_m;
616  ++t_diff_psi_m;
617  }
618  ++t_psi_l;
619  ++t_diff_psi_l;
620  }
621  }
622 
623  if (3 * jj != NBVOLUMETET_AINSWORTH_VOLUME_HDIV(p)) {
624  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
625  "wrong order %d != %d", jj,
627  }
628  }
629 
631 }

◆ Hdiv_Demkowicz_Face_MBTET_ON_FACE()

MoFEMErrorCode MoFEM::Hdiv_Demkowicz_Face_MBTET_ON_FACE ( int *  faces_nodes,
int  p,
double N,
double diffN,
double phi_f,
double diff_phi_f,
int  gdim,
int  nb 
)

\brirf HDiv base finuctions on triangle by Demkowicz [29]

Parameters
faces_nodesNodes on face
pApprox. order
NShape functions
diffNDerivatives of shape functions
phi_fReturned base functions on face
diff_phi_fReturned derivatives of base functions on face
gdimNumber of integration points
nbnb is 4 for face on tetrahedral and 3 for face
Returns
error code
Examples
forces_and_sources_testing_users_base.cpp.

Definition at line 634 of file Hdiv.cpp.

636  {
637  const int face_edges_nodes[3][2] = {{0, 1}, {1, 2}, {2, 0}};
638  const int face_opposite_edges_node[] = {2, 0, 1};
639 
641 
644 
645  FTensor::Tensor1<double, 3> t_cross[3];
646  FTensor::Tensor2<double, 3, 3> t_diff_cross(0., 0., 0., 0., 0., 0., 0., 0.,
647  0.);
648  FTensor::Tensor1<double, 3> t_node_diff_ksi[4];
649  FTensor::Tensor1<double, 3> t_node_diff_sum_n0_n1;
650 
651  const int i0 = faces_nodes[0];
652  const int i1 = faces_nodes[1];
653  const int i2 = faces_nodes[2];
654  const int o[] = {faces_nodes[face_opposite_edges_node[0]],
655  faces_nodes[face_opposite_edges_node[1]],
656  faces_nodes[face_opposite_edges_node[2]]};
657 
658  FTensor::Tensor1<double, 3> t_diff_n0_p_n1;
659  FTensor::Tensor1<double, 3> t_diff_n0_p_n1_p_n2;
660 
661  if (diff_phi_f) {
662  t_node_diff_ksi[0] =
663  FTensor::Tensor1<double, 3>(diffN[0], diffN[1], diffN[2]);
664  t_node_diff_ksi[1] =
665  FTensor::Tensor1<double, 3>(diffN[3], diffN[4], diffN[5]);
666  t_node_diff_ksi[2] =
667  FTensor::Tensor1<double, 3>(diffN[6], diffN[7], diffN[8]);
668  t_node_diff_ksi[3] =
669  FTensor::Tensor1<double, 3>(diffN[9], diffN[10], diffN[11]);
670  t_diff_cross(i, j) = 0;
671  for (int ee = 0; ee != 3; ee++) {
672  int ei0 = faces_nodes[face_edges_nodes[ee][0]];
673  int ei1 = faces_nodes[face_edges_nodes[ee][1]];
674  t_cross[ee](0) = t_node_diff_ksi[ei0](1) * t_node_diff_ksi[ei1](2) -
675  t_node_diff_ksi[ei0](2) * t_node_diff_ksi[ei1](1);
676  t_cross[ee](1) = t_node_diff_ksi[ei0](2) * t_node_diff_ksi[ei1](0) -
677  t_node_diff_ksi[ei0](0) * t_node_diff_ksi[ei1](2);
678  t_cross[ee](2) = t_node_diff_ksi[ei0](0) * t_node_diff_ksi[ei1](1) -
679  t_node_diff_ksi[ei0](1) * t_node_diff_ksi[ei1](0);
681  diffN[3 * o[ee] + 0], diffN[3 * o[ee] + 1], diffN[3 * o[ee] + 2]);
682  t_diff_cross(i, j) += t_cross[ee](i) * t_diff_o(j);
683  // cerr << t_cross[ee](0) << " " << t_cross[ee](1) << " " <<
684  // t_cross[ee](2) << endl;
685  }
686  // cerr << endl << endl;
687  t_diff_n0_p_n1(i) = t_node_diff_ksi[i0](i) + t_node_diff_ksi[i1](i);
688  t_diff_n0_p_n1_p_n2(i) = t_diff_n0_p_n1(i) + t_node_diff_ksi[i2](i);
689  } else {
690  for (int ee = 0; ee != 3; ee++) {
691  t_cross[ee](0) = 1;
692  t_cross[ee](1) = 0;
693  t_cross[ee](2) = 0;
694  }
695  }
696 
697  FTensor::Tensor1<double *, 3> t_phi(&phi_f[HVEC0], &phi_f[HVEC1],
698  &phi_f[HVEC2], 3);
699  boost::shared_ptr<FTensor::Tensor2<double *, 3, 3>> t_diff_phi_ptr;
700  if (diff_phi_f) {
701  t_diff_phi_ptr = boost::shared_ptr<FTensor::Tensor2<double *, 3, 3>>(
703  &diff_phi_f[HVEC0_0], &diff_phi_f[HVEC0_1], &diff_phi_f[HVEC0_2],
704  &diff_phi_f[HVEC1_0], &diff_phi_f[HVEC1_1], &diff_phi_f[HVEC1_2],
705  &diff_phi_f[HVEC2_0], &diff_phi_f[HVEC2_1], &diff_phi_f[HVEC2_2],
706  9));
707  }
708 
709  double fi[p + 1], diff_fi[3 * p + 3];
710  double fj[p + 1], diff_fj[3 * p + 3];
711  double tmp_fj[p + 1], tmp_diff_fj[3 * p + 3];
712  for (int ii = 0; ii != gdim; ii++) {
713  const int shift = ii * nb;
714  double n0 = N[shift + i0];
715  double n1 = N[shift + i1];
716  double n2 = N[shift + i2];
717  double *diff_n1 = (diff_phi_f) ? &t_node_diff_ksi[i1](0) : NULL;
718  double *diff_n0_p_n1 = (diff_phi_f) ? &t_diff_n0_p_n1(0) : NULL;
719  ierr = Jacobi_polynomials(p, 0, n1, n0 + n1, diff_n1, diff_n0_p_n1, fi,
720  diff_phi_f ? diff_fi : NULL, 3);
721  CHKERRG(ierr);
722  for (int pp = 0; pp <= p; pp++) {
723  double *diff_n2 = (diff_phi_f) ? &t_node_diff_ksi[i2](0) : NULL;
724  double *diff_n0_p_n1_p_n2 = (diff_phi_f) ? &t_diff_n0_p_n1_p_n2(0) : NULL;
725  ierr = Jacobi_polynomials(pp, 2 * pp + 1, n2, n0 + n1 + n2, diff_n2,
726  diff_n0_p_n1_p_n2, tmp_fj,
727  diff_phi_f ? tmp_diff_fj : NULL, 3);
728  CHKERRG(ierr);
729  fj[pp] = tmp_fj[pp];
730  if (diff_phi_f) {
731  diff_fj[0 * (p + 1) + pp] = tmp_diff_fj[0 * (pp + 1) + pp];
732  diff_fj[1 * (p + 1) + pp] = tmp_diff_fj[1 * (pp + 1) + pp];
733  diff_fj[2 * (p + 1) + pp] = tmp_diff_fj[2 * (pp + 1) + pp];
734  }
735  }
736  double no0 = N[shift + o[0]];
737  double no1 = N[shift + o[1]];
738  double no2 = N[shift + o[2]];
740  base0(i) = no0 * t_cross[0](i) + no1 * t_cross[1](i) + no2 * t_cross[2](i);
741  int jj = 0;
742  for (int oo = 0; oo < p; oo++) {
744  FTensor::Tensor1<double *, 3> t_diff_fi(&diff_fi[0], &diff_fi[p + 1],
745  &diff_fi[2 * p + 2], 1);
746  for (int ll = 0; ll <= oo; ll++) {
747  const int mm = oo - ll;
748  if (mm >= 0) {
749  const double a = t_fi * fj[mm];
750  // cerr << ll << " " << mm << " " << a << endl;
751  t_phi(i) = a * base0(i);
752  if (diff_phi_f) {
754  &diff_fj[0 + mm], &diff_fj[p + 1 + mm],
755  &diff_fj[2 * p + 2 + mm], 1);
756  (*t_diff_phi_ptr)(i, j) =
757  a * t_diff_cross(i, j) +
758  (t_diff_fi(j) * fj[mm] + t_fi * t_diff_fj(j)) * base0(i);
759  ++(*t_diff_phi_ptr);
760  ++t_diff_fi;
761  }
762  ++t_fi;
763  ++t_phi;
764  ++jj;
765  }
766  }
767  }
768  if (jj != NBFACETRI_DEMKOWICZ_HDIV(p)) {
769  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
770  "wrong number of base functions "
771  "jj!=NBFACETRI_DEMKOWICZ_HDIV(p) "
772  "%d!=%d",
773  jj, NBFACETRI_DEMKOWICZ_HDIV(p));
774  }
775  }
776 
778 }

◆ Hdiv_Demkowicz_Interior_MBTET()

MoFEMErrorCode MoFEM::Hdiv_Demkowicz_Interior_MBTET ( int  p,
double N,
double diffN,
int  p_face[],
double phi_f[4],
double diff_phi_f[4],
double phi_v,
double diff_phi_v,
int  gdim 
)

\brirf HDiv base finuctions in tetrahedral interior by Demkowicz [29]

Parameters
pApproximation order
NShape functions
diffNDerivatives of base functions
p_faceMax order on faces
phi_fPrecalculated face base functions
diff_phi_fPrecalculated derivatives of face base functions
phi_vReturned base functions in volume
diff_phi_vReturned derivatives of base functions in volume
gdimNumber of integration points
Returns
error code
Examples
forces_and_sources_testing_users_base.cpp.

Definition at line 780 of file Hdiv.cpp.

782  {
783 
784  const int opposite_face_node[4] = {2, 0, 1, 3};
785  // list of zero node faces
786  const int znf[] = {0, 2, 3};
788 
791 
792  FTensor::Tensor1<double, 3> t_node_diff_ksi[4];
793  t_node_diff_ksi[0] =
794  FTensor::Tensor1<double, 3>(diffN[0], diffN[1], diffN[2]);
795  t_node_diff_ksi[1] =
796  FTensor::Tensor1<double, 3>(diffN[3], diffN[4], diffN[5]);
797  t_node_diff_ksi[2] =
798  FTensor::Tensor1<double, 3>(diffN[6], diffN[7], diffN[8]);
799  t_node_diff_ksi[3] =
800  FTensor::Tensor1<double, 3>(diffN[9], diffN[10], diffN[11]);
801  FTensor::Tensor1<double, 3> t_m_node_diff_ksi[4];
802  for (int ff = 0; ff != 4; ++ff) {
803  t_m_node_diff_ksi[ff](i) = -t_node_diff_ksi[ff](i);
804  }
805 
806  FTensor::Tensor1<double *, 3> t_phi_v(&phi_v[HVEC0], &phi_v[HVEC1],
807  &phi_v[HVEC2], 3);
809  &diff_phi_v[HVEC0_0], &diff_phi_v[HVEC0_1], &diff_phi_v[HVEC0_2],
810  &diff_phi_v[HVEC1_0], &diff_phi_v[HVEC1_1], &diff_phi_v[HVEC1_2],
811  &diff_phi_v[HVEC2_0], &diff_phi_v[HVEC2_1], &diff_phi_v[HVEC2_2], 9);
812 
813  MatrixDouble fk(3, p + 1), diff_fk(3, 3 * p + 3);
814 
815  for (int ii = 0; ii != gdim; ii++) {
816  const int shift = 4 * ii;
817 
818  for (int ff = 0; ff != 3; ff++) {
819  const int fff = znf[ff];
820  const int iO = opposite_face_node[fff];
821  const double nO = N[shift + iO];
822  for (int pp = 1; pp <= p; pp++) {
824  pp, 2 * pp + 2, nO, 1 - nO, &t_node_diff_ksi[iO](0),
825  &t_m_node_diff_ksi[iO](0), &fk(ff, 0), &diff_fk(ff, 0), 3);
826  }
827  }
828 
829  int jj = 0;
830  for (int oo = 2; oo <= p; oo++) {
831  for (int k = 1; k != oo; k++) {
832  int OO = oo - k;
833  if (OO >= 0) {
834  int s = NBFACETRI_DEMKOWICZ_HDIV(OO - 1);
835  // Note that we do faces 0,2,3, skipping 1. All the faces which have
836  // zero node in it.
837  int nb_dofs = NBFACETRI_DEMKOWICZ_HDIV(p_f[znf[0]]);
838  int sp[] = {ii * 3 * nb_dofs + 3 * s, ii * 3 * nb_dofs + 3 * s,
839  ii * 3 * nb_dofs + 3 * s};
840  FTensor::Tensor1<double *, 3> t_phi_f[] = {
841  FTensor::Tensor1<double *, 3>(&phi_f[znf[0]][sp[0] + HVEC0],
842  &phi_f[znf[0]][sp[0] + HVEC1],
843  &phi_f[znf[0]][sp[0] + HVEC2], 3),
844  FTensor::Tensor1<double *, 3>(&phi_f[znf[1]][sp[1] + HVEC0],
845  &phi_f[znf[1]][sp[1] + HVEC1],
846  &phi_f[znf[1]][sp[1] + HVEC2], 3),
847  FTensor::Tensor1<double *, 3>(&phi_f[znf[2]][sp[2] + HVEC0],
848  &phi_f[znf[2]][sp[2] + HVEC1],
849  &phi_f[znf[2]][sp[2] + HVEC2], 3)};
850  int sdp[] = {ii * 9 * nb_dofs + 9 * s, ii * 9 * nb_dofs + 9 * s,
851  ii * 9 * nb_dofs + 9 * s};
852  FTensor::Tensor2<double *, 3, 3> t_diff_phi_f[] = {
854  &diff_phi_f[znf[0]][sdp[0] + HVEC0_0],
855  &diff_phi_f[znf[0]][sdp[0] + HVEC0_1],
856  &diff_phi_f[znf[0]][sdp[0] + HVEC0_2],
857  &diff_phi_f[znf[0]][sdp[0] + HVEC1_0],
858  &diff_phi_f[znf[0]][sdp[0] + HVEC1_1],
859  &diff_phi_f[znf[0]][sdp[0] + HVEC1_2],
860  &diff_phi_f[znf[0]][sdp[0] + HVEC2_0],
861  &diff_phi_f[znf[0]][sdp[0] + HVEC2_1],
862  &diff_phi_f[znf[0]][sdp[0] + HVEC2_2], 9),
864  &diff_phi_f[znf[1]][sdp[1] + HVEC0_0],
865  &diff_phi_f[znf[1]][sdp[1] + HVEC0_1],
866  &diff_phi_f[znf[1]][sdp[1] + HVEC0_2],
867  &diff_phi_f[znf[1]][sdp[1] + HVEC1_0],
868  &diff_phi_f[znf[1]][sdp[1] + HVEC1_1],
869  &diff_phi_f[znf[1]][sdp[1] + HVEC1_2],
870  &diff_phi_f[znf[1]][sdp[1] + HVEC2_0],
871  &diff_phi_f[znf[1]][sdp[1] + HVEC2_1],
872  &diff_phi_f[znf[1]][sdp[1] + HVEC2_2], 9),
874  &diff_phi_f[znf[2]][sdp[2] + HVEC0_0],
875  &diff_phi_f[znf[2]][sdp[2] + HVEC0_1],
876  &diff_phi_f[znf[2]][sdp[2] + HVEC0_2],
877  &diff_phi_f[znf[2]][sdp[2] + HVEC1_0],
878  &diff_phi_f[znf[2]][sdp[2] + HVEC1_1],
879  &diff_phi_f[znf[2]][sdp[2] + HVEC1_2],
880  &diff_phi_f[znf[2]][sdp[2] + HVEC2_0],
881  &diff_phi_f[znf[2]][sdp[2] + HVEC2_1],
882  &diff_phi_f[znf[2]][sdp[2] + HVEC2_2], 9)};
883  for (int ij = s; ij != NBFACETRI_DEMKOWICZ_HDIV(OO); ij++) {
884  for (int ff = 0; ff != 3; ff++) {
885  FTensor::Tensor1<double, 3> t_diff_fk(diff_fk(ff, 0 * p + k - 1),
886  diff_fk(ff, 1 * p + k - 1),
887  diff_fk(ff, 2 * p + k - 1));
888  t_phi_v(i) = fk(ff, k - 1) * t_phi_f[ff](i);
889  t_diff_phi_v(i, j) = t_diff_fk(j) * t_phi_f[ff](i) +
890  fk(ff, k - 1) * t_diff_phi_f[ff](i, j);
891  ++t_phi_v;
892  ++t_diff_phi_v;
893  ++t_phi_f[ff];
894  ++t_diff_phi_f[ff];
895  ++jj;
896  }
897  }
898  }
899  }
900  }
901  if (jj != NBVOLUMETET_DEMKOWICZ_HDIV(p)) {
902  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
903  "wrong number of base functions "
904  "jj!=NBVOLUMETET_DEMKOWICZ_HDIV(p) "
905  "%d!=%d",
907  }
908  }
909 
911 }

◆ id_from_handle()

auto MoFEM::id_from_handle ( const EntityHandle  h)
inline

Definition at line 1890 of file Templates.hpp.

1890  {
1891  return static_cast<EntityID>(h & MB_ID_MASK);
1892 };

◆ insertOrdered()

template<typename Extractor , typename Iterator >
moab::Range::iterator MoFEM::insertOrdered ( Range r,
Extractor  ,
Iterator  begin_iter,
Iterator  end_iter 
)

Insert ordered mofem multi-index into range.

Note
Inserted range has to be ordered.
auto hi_rit = refEntsPtr->upper_bound(start);
auto hi_rit = refEntsPtr->upper_bound(end);
Range to_erase;
insertOrdered(to_erase, RefEntExtractor(), rit, hi_rit);
Template Parameters
Iterator
Parameters
r
begin_iter
end_iter
Returns
moab::Range::iterator

Definition at line 1817 of file Templates.hpp.

1818  {
1819  moab::Range::iterator hint = r.begin();
1820  while (begin_iter != end_iter) {
1821  size_t j = 0;
1822  auto bi = Extractor::extract(begin_iter);
1823  Iterator pj = begin_iter;
1824  while (pj != end_iter && (bi + j) == Extractor::extract(pj)) {
1825  ++pj;
1826  ++j;
1827  }
1828  hint = r.insert(hint, bi, bi + (j - 1));
1829  begin_iter = pj;
1830  }
1831  return hint;
1832 };

◆ invertTensor() [1/2]

template<typename T1 , typename T2 , typename T3 , int DIM>
static MoFEMErrorCode MoFEM::invertTensor ( FTensor::Tensor2< T1, DIM, DIM > &  t,
T2 &  det,
FTensor::Tensor2< T3, DIM, DIM > &  inv_t 
)
inlinestatic
Examples
ContactOps.hpp.

Definition at line 1771 of file Templates.hpp.

1772  {
1773  return InvertTensorImpl<FTensor::Tensor2<T1, DIM, DIM>, T2,
1774  FTensor::Tensor2<T3, DIM, DIM>, DIM>::invert(t, det,
1775  inv_t);
1776 }

◆ invertTensor() [2/2]

template<typename T1 , typename T2 , typename T3 , int DIM>
static MoFEMErrorCode MoFEM::invertTensor ( FTensor::Tensor2_symmetric< T1, DIM > &  t,
T2 &  det,
FTensor::Tensor2_symmetric< T3, DIM > &  inv_t 
)
inlinestatic

Definition at line 1780 of file Templates.hpp.

1781  {
1782  return InvertTensorImpl<FTensor::Tensor2_symmetric<T1, DIM>, T2,
1784  DIM>::invert(t, det, inv_t);
1785 }

◆ invertTensor2by2()

template<class T1 , class T2 , class T3 >
MoFEMErrorCode MoFEM::invertTensor2by2 ( T1 &  t,
T2 &  det,
T3 &  inv_t 
)
inline

Calculate matrix inverse 2 by 2.

Definition at line 1649 of file Templates.hpp.

1649  {
1651  const auto inv_det = 1. / det;
1652  inv_t(0, 0) = t(1, 1) * inv_det;
1653  inv_t(0, 1) = -t(0, 1) * inv_det;
1654  inv_t(1, 0) = -t(1, 0) * inv_det;
1655  inv_t(1, 1) = t(0, 0) * inv_det;
1657 }

◆ invertTensor3by3() [1/2]

template<class T1 , class T2 , class T3 >
MoFEMErrorCode MoFEM::invertTensor3by3 ( T1 &  t,
T2 &  det,
T3 &  inv_t 
)
inline

Calculate matrix inverse 3 by 3.

Definition at line 1629 of file Templates.hpp.

1629  {
1631  const auto inv_det = 1. / det;
1632  inv_t(0, 0) = (t(1, 1) * t(2, 2) - t(1, 2) * t(2, 1)) * inv_det;
1633  inv_t(0, 1) = (t(0, 2) * t(2, 1) - t(0, 1) * t(2, 2)) * inv_det;
1634  inv_t(0, 2) = (t(0, 1) * t(1, 2) - t(0, 2) * t(1, 1)) * inv_det;
1635  inv_t(1, 0) = (t(1, 2) * t(2, 0) - t(1, 0) * t(2, 2)) * inv_det;
1636  inv_t(1, 1) = (t(0, 0) * t(2, 2) - t(0, 2) * t(2, 0)) * inv_det;
1637  inv_t(1, 2) = (t(0, 2) * t(1, 0) - t(0, 0) * t(1, 2)) * inv_det;
1638  inv_t(2, 0) = (t(1, 0) * t(2, 1) - t(1, 1) * t(2, 0)) * inv_det;
1639  inv_t(2, 1) = (t(0, 1) * t(2, 0) - t(0, 0) * t(2, 1)) * inv_det;
1640  inv_t(2, 2) = (t(0, 0) * t(1, 1) - t(0, 1) * t(1, 0)) * inv_det;
1642 }

◆ invertTensor3by3() [2/2]

template<int Tensor_Dim, class T , class L , class A >
MoFEMErrorCode MoFEM::invertTensor3by3 ( ublas::matrix< T, L, A > &  jac_data,
ublas::vector< T, A > &  det_data,
ublas::matrix< T, L, A > &  inv_jac_data 
)
inline

Calculate inverse of tensor rank 2 at integration points.

Examples
HookeElement.cpp, HookeElement.hpp, HookeInternalStressElement.hpp, lorentz_force.cpp, NeoHookean.hpp, and Remodeling.cpp.

Definition at line 1588 of file Templates.hpp.

1590  {
1592  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
1593  "Specialization for this template not yet implemented");
1595 }

◆ invertTensor3by3< 3, double, ublas::row_major, DoubleAllocator >()

template<>
MoFEMErrorCode MoFEM::invertTensor3by3< 3, double, ublas::row_major, DoubleAllocator > ( MatrixDouble jac_data,
VectorDouble det_data,
MatrixDouble inv_jac_data 
)
inline

Definition at line 149 of file DataOperators.cpp.

151  {
153  auto A = getFTensor2FromMat<3, 3>(jac_data);
154  int nb_gauss_pts = jac_data.size2();
155  det_data.resize(nb_gauss_pts, false);
156  inv_jac_data.resize(3, nb_gauss_pts, false);
157  auto det = getFTensor0FromVec(det_data);
158  auto I = getFTensor2FromMat<3, 3>(inv_jac_data);
159  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
161  CHKERR invertTensor3by3(A, det, I);
162  ++A;
163  ++det;
164  ++I;
165  }
167 }

◆ isAllGather()

auto MoFEM::isAllGather ( IS  is)
inline

IS All gather.

Parameters
is
Returns
auto

Definition at line 300 of file PetscSmartObj.hpp.

300  {
301  IS isout;
302  CHK_THROW_MESSAGE(ISAllGather(is, &isout), "Failed to create ISAllGather");
303  return SmartPetscObj<IS>(isout);
304 }

◆ isDifference()

auto MoFEM::isDifference ( IS  is1,
IS  is2 
)
inline

Get ISDifference.

ISDifference.

Parameters
is1first index, to have items removed from it
is2index values to be removed
Returns
is1 - is2

Definition at line 377 of file PetscSmartObj.hpp.

377  {
378  IS is_raw;
379  CHK_THROW_MESSAGE(ISDifference(is1, is2, &is_raw), "create difference");
380  return SmartPetscObj<IS>(is_raw);
381 }

◆ isDuplicate()

auto MoFEM::isDuplicate ( IS  is)
inline

Definition at line 396 of file PetscSmartObj.hpp.

396  {
397  IS is_raw;
398  CHK_THROW_MESSAGE(ISDuplicate(is, &is_raw), "duplicate IS");
399  return SmartPetscObj<IS>(is_raw);
400 }

◆ ksp_set_operators()

static MoFEMErrorCode MoFEM::ksp_set_operators ( KSP  ksp,
Mat  A,
Mat  B,
void *  ctx 
)
static

Definition at line 308 of file PCMGSetUpViaApproxOrders.cpp.

308  {
311 }

◆ KspMat()

PetscErrorCode MoFEM::KspMat ( KSP  ksp,
Mat  A,
Mat  B,
void *  ctx 
)

Run over elements in the list.

Parameters
kspKSP solver
Amatrix
BPreconditioned matrix
ctxdata context, i.e. KspCtx
Returns
error code

Definition at line 86 of file KspCtx.cpp.

86  {
87  // PetscValidHeaderSpecific(ksp,KSP_CLASSID,1);
89  KspCtx *ksp_ctx = static_cast<KspCtx *>(ctx);
90  PetscLogEventBegin(ksp_ctx->MOFEM_EVENT_KspMat, 0, 0, 0, 0);
91 
92  ksp_ctx->matAssembleSwitch = boost::movelib::make_unique<bool>(true);
93  auto cache_ptr = boost::make_shared<CacheTuple>();
94  CHKERR ksp_ctx->mField.cache_problem_entities(ksp_ctx->problemName,
95  cache_ptr);
96 
97  auto set = [&](auto &fe) {
98  fe.ksp = ksp;
99  fe.ksp_A = A;
100  fe.ksp_B = B;
101  fe.ksp_ctx = KspMethod::CTX_OPERATORS;
102  fe.data_ctx = PetscData::CtxSetA | PetscData::CtxSetB;
103  fe.cacheWeakPtr = cache_ptr;
104  };
105 
106  auto unset = [&](auto &fe) {
107  fe.ksp_ctx = KspMethod::CTX_KSPNONE;
108  fe.data_ctx = PetscData::CtxSetNone;
109  };
110 
111  auto ent_data_cache = boost::make_shared<std::vector<EntityCacheDofs>>();
112  auto ent_row_cache =
113  boost::make_shared<std::vector<EntityCacheNumeredDofs>>();
114  auto ent_col_cache =
115  boost::make_shared<std::vector<EntityCacheNumeredDofs>>();
116 
117  // pre-procsess
118  for (auto &bit : ksp_ctx->preProcess_Mat) {
119  bit->matAssembleSwitch = boost::move(ksp_ctx->matAssembleSwitch);
120  set(*bit);
121  CHKERR ksp_ctx->mField.problem_basic_method_preProcess(ksp_ctx->problemName,
122  *bit);
123  unset(*bit);
124  ksp_ctx->matAssembleSwitch = boost::move(bit->matAssembleSwitch);
125  }
126 
127  // operators
128  for (auto &lit : ksp_ctx->loops_to_do_Mat) {
129  lit.second->matAssembleSwitch = boost::move(ksp_ctx->matAssembleSwitch);
130  set(*lit.second);
131  CHKERR ksp_ctx->mField.loop_finite_elements(ksp_ctx->problemName, lit.first,
132  *(lit.second), nullptr,
133  ksp_ctx->bH, cache_ptr);
134  unset(*lit.second);
135  ksp_ctx->matAssembleSwitch = boost::move(lit.second->matAssembleSwitch);
136  }
137 
138  // post-process
139  for (auto &bit : ksp_ctx->postProcess_Mat) {
140  bit->matAssembleSwitch = boost::move(ksp_ctx->matAssembleSwitch);
141  set(*bit);
142  CHKERR ksp_ctx->mField.problem_basic_method_postProcess(
143  ksp_ctx->problemName, *bit);
144  unset(*bit);
145  ksp_ctx->matAssembleSwitch = boost::move(bit->matAssembleSwitch);
146  }
147 
148  if (ksp_ctx->matAssembleSwitch) {
149  CHKERR MatAssemblyBegin(B, MAT_FINAL_ASSEMBLY);
150  CHKERR MatAssemblyEnd(B, MAT_FINAL_ASSEMBLY);
151  }
152  PetscLogEventEnd(ksp_ctx->MOFEM_EVENT_KspMat, 0, 0, 0, 0);
154 }

◆ KspRhs()

PetscErrorCode MoFEM::KspRhs ( KSP  ksp,
Vec  f,
void *  ctx 
)

Run over elements in the lists.

Parameters
kspKSP solver
fthe right hand side vector
ctxdata context, i.e. KspCtx
Returns
error code

Definition at line 21 of file KspCtx.cpp.

21  {
22  // PetscValidHeaderSpecific(ksp,KSP_CLASSID,1);
24  KspCtx *ksp_ctx = static_cast<KspCtx *>(ctx);
25  PetscLogEventBegin(ksp_ctx->MOFEM_EVENT_KspRhs, 0, 0, 0, 0);
26 
27  ksp_ctx->vecAssembleSwitch = boost::movelib::make_unique<bool>(true);
28 
29  auto cache_ptr = boost::make_shared<CacheTuple>();
30  CHKERR ksp_ctx->mField.cache_problem_entities(ksp_ctx->problemName,
31  cache_ptr);
32 
33  auto set = [&](auto &fe) {
34  fe.ksp = ksp;
35  fe.ksp_ctx = KspMethod::CTX_SETFUNCTION;
36  fe.data_ctx = PetscData::CtxSetF;
37  fe.ksp_f = f;
38  fe.cacheWeakPtr = cache_ptr;
39  };
40 
41  auto unset = [&](auto &fe) {
42  fe.ksp_ctx = KspMethod::CTX_KSPNONE;
43  fe.data_ctx = PetscData::CtxSetNone;
44  };
45 
46  // pre-process
47  for (auto &bit : ksp_ctx->preProcess_Rhs) {
48  bit->vecAssembleSwitch = boost::move(ksp_ctx->vecAssembleSwitch);
49  set(*bit);
50  CHKERR ksp_ctx->mField.problem_basic_method_preProcess(ksp_ctx->problemName,
51  *bit);
52  unset(*bit);
53  ksp_ctx->vecAssembleSwitch = boost::move(bit->vecAssembleSwitch);
54  }
55 
56  // operators
57  for (auto &lit : ksp_ctx->loops_to_do_Rhs) {
58  lit.second->vecAssembleSwitch = boost::move(ksp_ctx->vecAssembleSwitch);
59  set(*lit.second);
60  CHKERR ksp_ctx->mField.loop_finite_elements(ksp_ctx->problemName, lit.first,
61  *(lit.second), nullptr,
62  ksp_ctx->bH, cache_ptr);
63  unset(*lit.second);
64  ksp_ctx->vecAssembleSwitch = boost::move(lit.second->vecAssembleSwitch);
65  }
66 
67  // post-process
68  for (auto &bit : ksp_ctx->postProcess_Rhs) {
69  bit->vecAssembleSwitch = boost::move(ksp_ctx->vecAssembleSwitch);
70  set(*bit);
71  CHKERR ksp_ctx->mField.problem_basic_method_postProcess(
72  ksp_ctx->problemName, *bit);
73  unset(*bit);
74  ksp_ctx->vecAssembleSwitch = boost::move(bit->vecAssembleSwitch);
75  }
76 
77  if (*ksp_ctx->vecAssembleSwitch) {
78  CHKERR VecGhostUpdateBegin(f, ADD_VALUES, SCATTER_REVERSE);
79  CHKERR VecGhostUpdateEnd(f, ADD_VALUES, SCATTER_REVERSE);
80  CHKERR VecAssemblyBegin(f);
81  CHKERR VecAssemblyEnd(f);
82  }
83  PetscLogEventEnd(ksp_ctx->MOFEM_EVENT_KspRhs, 0, 0, 0, 0);
85 }

◆ make_array()

template<typename Dest = void, typename... Arg>
constexpr auto MoFEM::make_array ( Arg &&...  arg)
constexpr

Create Array.

See: See stack overflow

Template Parameters
Dest
Arg
Parameters
arg
Returns
constexpr auto
Examples
level_set.cpp.

Definition at line 1990 of file Templates.hpp.

1990  {
1991  if constexpr (std::is_same<void, Dest>::value)
1992  return std::array<std::common_type_t<std::decay_t<Arg>...>, sizeof...(Arg)>{
1993  {std::forward<Arg>(arg)...}};
1994  else
1995  return std::array<Dest, sizeof...(Arg)>{{std::forward<Arg>(arg)...}};
1996 }

◆ mat_zero()

static PetscErrorCode MoFEM::mat_zero ( Mat  m)
static

Definition at line 1350 of file Schur.cpp.

1350  {
1352  BlockStructure *ctx;
1353  CHKERR MatShellGetContext(m, (void **)&ctx);
1354  if (ctx->dataBlocksPtr)
1355  std::fill(ctx->dataBlocksPtr->begin(), ctx->dataBlocksPtr->end(), 0.);
1356  if (ctx->preconditionerBlocksPtr)
1357  std::fill(ctx->preconditionerBlocksPtr->begin(),
1358  ctx->preconditionerBlocksPtr->end(), 0.);
1360 }

◆ matCreateVecs()

auto MoFEM::matCreateVecs ( Mat  mat)
inline

Definition at line 390 of file PetscSmartObj.hpp.

390  {
391  Vec x, y;
392  CHK_THROW_MESSAGE(MatCreateVecs(mat, &x, &y), "create vecs");
393  return std::make_pair(SmartPetscObj<Vec>(x), SmartPetscObj<Vec>(y));
394 }

◆ matDuplicate()

SmartPetscObj<Mat> MoFEM::matDuplicate ( Mat  mat,
MatDuplicateOption  op 
)
inline
Examples
eigen_elastic.cpp, and elasticity.cpp.

Definition at line 234 of file PetscSmartObj.hpp.

234  {
235  Mat duplicate;
236  CHK_THROW_MESSAGE(MatDuplicate(mat, op, &duplicate),
237  "Failed to duplicate Mat");
238  return SmartPetscObj<Mat>(duplicate);
239 };

◆ MatSetValues() [1/2]

template<typename T = EntityStorage>
MoFEMErrorCode MoFEM::MatSetValues ( Mat  M,
const EntitiesFieldData::EntData row_data,
const EntitiesFieldData::EntData col_data,
const double ptr,
InsertMode  iora 
)
inline

Assemble PETSc matrix.

Function extract indices from entity data and assemble vector

See PETSc documentation

Parameters
M
row_data
col_data
ptr
iora
Returns
MoFEMErrorCode
Examples
analytical_poisson_field_split.cpp, ElasticityMixedFormulation.hpp, HookeElement.cpp, HookeElement.hpp, level_set.cpp, MagneticElement.hpp, NavierStokesElement.cpp, plate.cpp, PoissonDiscontinousGalerkin.hpp, PoissonOperators.hpp, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, reaction_diffusion.cpp, Remodeling.cpp, simple_elasticity.cpp, and UnsaturatedFlow.hpp.

Definition at line 1644 of file EntitiesFieldData.hpp.

1647  {
1648  static_assert(!std::is_same<T, T>::value,
1649  "MatSetValues value for this data storage is not implemented");
1650  return MOFEM_NOT_IMPLEMENTED;
1651 }

◆ MatSetValues() [2/2]

template<typename T = EntityStorage>
MoFEMErrorCode MoFEM::MatSetValues ( Mat  M,
const EntitiesFieldData::EntData row_data,
const EntitiesFieldData::EntData col_data,
const MatrixDouble mat,
InsertMode  iora 
)
inline

Assemble PETSc matrix.

Function extract indices from entity data and assemble vector

See PETSc documentation

Parameters
M
row_data
col_data
mat
iora
Returns
MoFEMErrorCode

Definition at line 1670 of file EntitiesFieldData.hpp.

1673  {
1674  return MatSetValues<T>(M, row_data, col_data, &*mat.data().begin(), iora);
1675 }

◆ MatSetValues< AssemblyTypeSelector< BLOCK_MAT > >()

template<>
MoFEMErrorCode MoFEM::MatSetValues< AssemblyTypeSelector< BLOCK_MAT > > ( Mat  M,
const EntitiesFieldData::EntData row_data,
const EntitiesFieldData::EntData col_data,
const MatrixDouble mat,
InsertMode  iora 
)
inline

Definition at line 238 of file Schur.hpp.

241  {
242  return MatSetValues<BlockStructure>(M, row_data, col_data, mat, iora);
243 }

◆ MatSetValues< AssemblyTypeSelector< BLOCK_PRECONDITIONER_SCHUR > >()

template<>
MoFEMErrorCode MoFEM::MatSetValues< AssemblyTypeSelector< BLOCK_PRECONDITIONER_SCHUR > > ( Mat  M,
const EntitiesFieldData::EntData row_data,
const EntitiesFieldData::EntData col_data,
const MatrixDouble mat,
InsertMode  iora 
)
inline

Definition at line 311 of file Schur.hpp.

314  {
315  return MatSetValues<SchurElemMatsPreconditionedBlock>(M, row_data, col_data,
316  mat, iora);
317 }

◆ MatSetValues< AssemblyTypeSelector< BLOCK_SCHUR > >()

template<>
MoFEMErrorCode MoFEM::MatSetValues< AssemblyTypeSelector< BLOCK_SCHUR > > ( Mat  M,
const EntitiesFieldData::EntData row_data,
const EntitiesFieldData::EntData col_data,
const MatrixDouble mat,
InsertMode  iora 
)
inline

Definition at line 279 of file Schur.hpp.

282  {
283  return MatSetValues<SchurElemMatsBlock>(M, row_data, col_data, mat, iora);
284 }

◆ MatSetValues< AssemblyTypeSelector< PETSC > >()

template<>
MoFEMErrorCode MoFEM::MatSetValues< AssemblyTypeSelector< PETSC > > ( Mat  M,
const EntitiesFieldData::EntData row_data,
const EntitiesFieldData::EntData col_data,
const double ptr,
InsertMode  iora 
)
inline

Definition at line 117 of file FormsIntegrators.hpp.

120  {
121  return MatSetValues<EssentialBcStorage>(M, row_data, col_data, ptr, iora);
122 }

◆ MatSetValues< AssemblyTypeSelector< SCHUR > >()

template<>
MoFEMErrorCode MoFEM::MatSetValues< AssemblyTypeSelector< SCHUR > > ( Mat  M,
const EntitiesFieldData::EntData row_data,
const EntitiesFieldData::EntData col_data,
const MatrixDouble mat,
InsertMode  iora 
)

Definition at line 2283 of file Schur.cpp.

2286  {
2287  return MatSetValues<SchurElemMats>(M, row_data, col_data, mat, iora);
2288 }

◆ MatSetValues< BlockStructure >()

template<>
MoFEMErrorCode MoFEM::MatSetValues< BlockStructure > ( Mat  M,
const EntitiesFieldData::EntData row_data,
const EntitiesFieldData::EntData col_data,
const MatrixDouble mat,
InsertMode  iora 
)

Definition at line 2293 of file Schur.cpp.

2295  {
2296  return shell_block_mat_asmb_wrap(M, row_data, col_data, mat, iora);
2297 }

◆ MatSetValues< EntityStorage >()

template<>
MoFEMErrorCode MoFEM::MatSetValues< EntityStorage > ( Mat  M,
const EntitiesFieldData::EntData row_data,
const EntitiesFieldData::EntData col_data,
const double ptr,
InsertMode  iora 
)
inline

Definition at line 1679 of file EntitiesFieldData.hpp.

1681  {
1682  return MatSetValues(
1683  M, row_data.getIndices().size(), &*row_data.getIndices().begin(),
1684  col_data.getIndices().size(), &*col_data.getIndices().begin(), ptr, iora);
1685 }

◆ MatSetValues< EssentialBcStorage >()

template<>
MoFEMErrorCode MoFEM::MatSetValues< EssentialBcStorage > ( Mat  M,
const EntitiesFieldData::EntData row_data,
const EntitiesFieldData::EntData col_data,
const double ptr,
InsertMode  iora 
)

Set values to matrix in operator.

See MoFEM::VecSetValues<EssentialBcStorage> for explanation.

Parameters
M
row_data
col_data
ptr
iora
Returns
MoFEMErrorCode
Parameters
M
row_data
col_data
ptr
iora
Returns
MoFEMErrorCode

Definition at line 112 of file FormsIntegrators.cpp.

115  {
116 
117  if(!M)
118  SETERRQ(PETSC_COMM_SELF, MOFEM_INVALID_DATA,
119  "Pointer to PETSc matrix is null");
120 
121  if (!row_data.getFieldEntities().empty()) {
122  if (auto e_ptr = row_data.getFieldEntities()[0]) {
123  if (auto stored_data_ptr =
124  e_ptr->getSharedStoragePtr<EssentialBcStorage>()) {
125  return ::MatSetValues(M, stored_data_ptr->entityIndices.size(),
126  &*stored_data_ptr->entityIndices.begin(),
127  col_data.getIndices().size(),
128  &*col_data.getIndices().begin(), ptr, iora);
129  }
130  }
131  }
133  M, row_data.getIndices().size(), &*row_data.getIndices().begin(),
134  col_data.getIndices().size(), &*col_data.getIndices().begin(), ptr, iora);
135 }

◆ MatSetValues< SchurElemMats >()

template<>
MoFEMErrorCode MoFEM::MatSetValues< SchurElemMats > ( Mat  M,
const EntitiesFieldData::EntData row_data,
const EntitiesFieldData::EntData col_data,
const MatrixDouble mat,
InsertMode  iora 
)

Definition at line 2249 of file Schur.cpp.

2251  {
2252  return SchurElemMats::MatSetValues(M, row_data, col_data, mat, iora);
2253 }

◆ MatSetValues< SchurElemMatsBlock >()

template<>
MoFEMErrorCode MoFEM::MatSetValues< SchurElemMatsBlock > ( Mat  M,
const EntitiesFieldData::EntData row_data,
const EntitiesFieldData::EntData col_data,
const MatrixDouble mat,
InsertMode  iora 
)

Definition at line 2325 of file Schur.cpp.

2328  {
2329  return SchurElemMatsBlock::MatSetValues(M, row_data, col_data, mat, iora);
2330 }

◆ MatSetValues< SchurElemMatsPreconditionedBlock >()

template<>
MoFEMErrorCode MoFEM::MatSetValues< SchurElemMatsPreconditionedBlock > ( Mat  M,
const EntitiesFieldData::EntData row_data,
const EntitiesFieldData::EntData col_data,
const MatrixDouble mat,
InsertMode  iora 
)

Definition at line 2356 of file Schur.cpp.

2359  {
2360  return SchurElemMatsPreconditionedBlock::MatSetValues(M, row_data, col_data,
2361  mat, iora);
2362 }

◆ min_non_abs()

static auto MoFEM::min_non_abs ( const double  a,
const double  b 
)
static

Definition at line 16 of file NodeMerger.cpp.

16  {
17  return std::min(a, b);
18 };

◆ moab2med_element_type()

static std::vector<med_geometrie_element> MoFEM::moab2med_element_type ( const EntityType  type)
static

Definition at line 213 of file MedInterface.cpp.

213  {
214 
215  std::vector<med_geometrie_element> types;
216 
217  switch (type) {
218  case MBEDGE:
219  types.push_back(MED_SEG2);
220  types.push_back(MED_SEG3);
221  break;
222  case MBTRI:
223  types.push_back(MED_TRIA3);
224  types.push_back(MED_TRIA6);
225  break;
226  case MBQUAD:
227  types.push_back(MED_QUAD4);
228  break;
229  case MBTET:
230  types.push_back(MED_TETRA4);
231  types.push_back(MED_TETRA10);
232  break;
233  case MBHEX:
234  types.push_back(MED_HEXA8);
235  break;
236  case MBPRISM:
237  types.push_back(MED_PENTA6);
238  break;
239  case MBPYRAMID:
240  types.push_back(MED_PYRA5);
241  break;
242  case MBVERTEX:
243  // Not Currently Used
244  //types.push_back(MED_POINT1);
245  break;
246  default:
247  break;
248  }
249 
250  return types;
251 }

◆ MoFEMSNESMonitorFields()

MoFEMErrorCode MoFEM::MoFEMSNESMonitorFields ( SNES  snes,
PetscInt  its,
PetscReal  fgnorm,
SnesCtx snes_ctx 
)

Sens monitor printing residual field by field.

Examples
adolc_plasticity.cpp, free_surface.cpp, plastic.cpp, seepage.cpp, and thermo_elastic.cpp.

Definition at line 232 of file SnesCtx.cpp.

233  {
235  auto &m_field = snes_ctx->mField;
236  auto problem_ptr = m_field.get_problem(snes_ctx->problemName);
237  auto fields_ptr = m_field.get_fields();
238  auto dofs = problem_ptr->numeredRowDofsPtr;
239 
240  std::vector<double> lnorms(fields_ptr->size(), 0),
241  norms(fields_ptr->size(), 0);
242 
243  Vec res;
244  CHKERR SNESGetFunction(snes, &res, NULL, NULL);
245 
246  const double *r;
247  CHKERR VecGetArrayRead(res, &r);
248  {
249  int f = 0;
250  for (auto fi : *fields_ptr) {
251  const auto lo_uid = FieldEntity::getLoBitNumberUId(fi->bitNumber);
252  const auto hi_uid = FieldEntity::getHiBitNumberUId(fi->bitNumber);
253  const auto hi = dofs->get<Unique_mi_tag>().upper_bound(hi_uid);
254  for (auto lo = dofs->get<Unique_mi_tag>().lower_bound(lo_uid); lo != hi;
255  ++lo) {
256  const DofIdx loc_idx = (*lo)->getPetscLocalDofIdx();
257  if (loc_idx >= 0 && loc_idx < problem_ptr->nbLocDofsRow) {
258  lnorms[f] += PetscRealPart(PetscSqr(r[loc_idx]));
259  }
260  }
261  ++f;
262  }
263  }
264  CHKERR VecRestoreArrayRead(res, &r);
265 
266  MPIU_Allreduce(&*lnorms.begin(), &*norms.begin(), lnorms.size(), MPIU_REAL,
267  MPIU_SUM, PetscObjectComm((PetscObject)snes));
268 
269  std::stringstream s;
270  int tl;
271  CHKERR PetscObjectGetTabLevel((PetscObject)snes, &tl);
272  for (auto t = 0; t != tl; ++t)
273  s << " ";
274  s << its << " Function norm " << boost::format("%14.12e") % (double)fgnorm
275  << " [";
276  {
277  int f = 0;
278  for (auto fi : *fields_ptr) {
279  if (f > 0)
280  s << ", ";
281  s << boost::format("%14.12e") % (double)PetscSqrtReal(norms[f]);
282  ++f;
283  }
284  s << "]";
285  }
286 
287  MOFEM_LOG("SNES_WORLD", Sev::inform) << s.str();
288 
290 }

◆ mult()

static PetscErrorCode MoFEM::mult ( Mat  mat,
Vec  x,
Vec  y 
)
static

Definition at line 1199 of file Schur.cpp.

1199  {
1200  BlockStructure *ctx;
1201  CHKERR MatShellGetContext(mat, (void **)&ctx);
1202  return mult_schur_block_shell(
1203  mat, x, y, INSERT_VALUES,
1204 
1205  [](DiagBlockIndex::BlockIndex::nth_index<0>::type::iterator it) {
1206  return it->getMatShift();
1207  },
1208 
1209  ctx->dataBlocksPtr, true);
1210 }

◆ mult_add()

static PetscErrorCode MoFEM::mult_add ( Mat  mat,
Vec  x,
Vec  y 
)
static

Definition at line 1211 of file Schur.cpp.

1211  {
1212  BlockStructure *ctx;
1213  CHKERR MatShellGetContext(mat, (void **)&ctx);
1214  return mult_schur_block_shell(
1215  mat, x, y, ADD_VALUES,
1216 
1217  [](DiagBlockIndex::BlockIndex::nth_index<0>::type::iterator it) {
1218  return it->getMatShift();
1219  },
1220 
1221  ctx->dataBlocksPtr, true);
1222 }

◆ mult_schur_block_shell()

static MoFEMErrorCode MoFEM::mult_schur_block_shell ( Mat  mat,
Vec  x,
Vec  y,
InsertMode  iora,
boost::function< int(DiagBlockIndex::BlockIndex::nth_index< 0 >::type::iterator)>  shift_extractor,
boost::shared_ptr< std::vector< double >>  data_blocks_ptr,
bool  multiply_by_preconditioner 
)
static

Definition at line 1415 of file Schur.cpp.

1423  {
1425  BlockStructure *ctx;
1426  CHKERR MatShellGetContext(mat, (void **)&ctx);
1427 
1428  PetscLogEventBegin(SchurEvents::MOFEM_EVENT_BlockStructureMult, 0, 0, 0, 0);
1429 
1430  int x_loc_size;
1431  CHKERR VecGetLocalSize(x, &x_loc_size);
1432  int y_loc_size;
1433  CHKERR VecGetLocalSize(y, &y_loc_size);
1434 
1435  Vec ghost_x = ctx->ghostX;
1436  Vec ghost_y = ctx->ghostY;
1437 
1438  CHKERR VecCopy(x, ghost_x);
1439 
1440  double *y_array;
1441  Vec loc_ghost_y;
1442  CHKERR VecGhostGetLocalForm(ghost_y, &loc_ghost_y);
1443  int nb_y;
1444  CHKERR VecGetLocalSize(loc_ghost_y, &nb_y);
1445  CHKERR VecGetArray(loc_ghost_y, &y_array);
1446  for (auto i = 0; i != nb_y; ++i)
1447  y_array[i] = 0.;
1448  CHKERR VecRestoreArray(loc_ghost_y, &y_array);
1449  CHKERR VecGhostRestoreLocalForm(ghost_y, &loc_ghost_y);
1450 
1451  auto mult = [&](int low_x, int hi_x, int low_y, int hi_y) {
1453 
1454  double *x_array;
1455  Vec loc_ghost_x;
1456  CHKERR VecGhostGetLocalForm(ghost_x, &loc_ghost_x);
1457  CHKERR VecGetArray(loc_ghost_x, &x_array);
1458 
1459  double *y_array;
1460  Vec loc_ghost_y;
1461  CHKERR VecGhostGetLocalForm(ghost_y, &loc_ghost_y);
1462  int nb_y;
1463  CHKERR VecGetLocalSize(loc_ghost_y, &nb_y);
1464  CHKERR VecGetArray(loc_ghost_y, &y_array);
1465 
1466  double *block_ptr = &*data_blocks_ptr->begin();
1467  auto it = ctx->blockIndex.get<0>().begin();
1468  auto hi = ctx->blockIndex.get<0>().end();
1469 
1470  while (it != hi) {
1471  if (it->getLocRow() < low_y || it->getLocRow() >= hi_y ||
1472  it->getLocCol() < low_x || it->getLocCol() >= hi_x) {
1473  ++it;
1474  continue;
1475  }
1476 
1477  auto nb_rows = it->getNbRows();
1478  auto nb_cols = it->getNbCols();
1479  auto x_ptr = &x_array[it->getLocCol()];
1480  auto y_ptr = &y_array[it->getLocRow()];
1481  auto ptr = &block_ptr[shift_extractor(it)];
1482 
1483  if (std::min(nb_rows, nb_cols) > max_gemv_size) {
1484  cblas_dgemv(CblasRowMajor, CblasNoTrans, nb_rows, nb_cols, 1.0, ptr,
1485  nb_cols, x_ptr, 1, 1.0, y_ptr, 1);
1486  } else {
1487  for (auto r = 0; r != nb_rows; ++r) {
1488  for (auto c = 0; c != nb_cols; ++c) {
1489  y_ptr[r] += ptr[r * nb_cols + c] * x_ptr[c];
1490  }
1491  }
1492  }
1493  ++it;
1494  }
1495 
1496  if (multiply_by_preconditioner && ctx->multiplyByPreconditioner) {
1497 
1498  if (!ctx->preconditionerBlocksPtr)
1499  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1500  "No parentBlockStructurePtr");
1501 
1502  auto preconditioner_ptr = &*ctx->preconditionerBlocksPtr->begin();
1503 
1504  auto it = ctx->blockIndex.get<0>().begin();
1505  auto hi = ctx->blockIndex.get<0>().end();
1506 
1507  while (it != hi) {
1508  if (it->getLocRow() < low_y || it->getLocRow() >= hi_y ||
1509  it->getLocCol() < low_x || it->getLocCol() >= hi_x) {
1510  ++it;
1511  continue;
1512  }
1513 
1514  if (it->getMatShift() != -1) {
1515  auto nb_rows = it->getNbRows();
1516  auto nb_cols = it->getNbCols();
1517  auto x_ptr = &x_array[it->getLocCol()];
1518  auto y_ptr = &y_array[it->getLocRow()];
1519  auto ptr = &preconditioner_ptr[it->getMatShift()];
1520  if (std::min(nb_rows, nb_cols) > max_gemv_size) {
1521  cblas_dgemv(CblasRowMajor, CblasNoTrans, nb_rows, nb_cols, 1.0, ptr,
1522  nb_cols, x_ptr, 1, 1.0, y_ptr, 1);
1523  } else {
1524  for (auto r = 0; r != nb_rows; ++r) {
1525  for (auto c = 0; c != nb_cols; ++c) {
1526  y_ptr[r] += ptr[r * nb_cols + c] * x_ptr[c];
1527  }
1528  }
1529  }
1530  }
1531 
1532  ++it;
1533  }
1534  }
1535 
1536  CHKERR VecRestoreArray(loc_ghost_x, &x_array);
1537  CHKERR VecRestoreArray(loc_ghost_y, &y_array);
1538  CHKERR VecGhostRestoreLocalForm(ghost_x, &loc_ghost_x);
1539  CHKERR VecGhostRestoreLocalForm(ghost_y, &loc_ghost_y);
1541  };
1542 
1543  constexpr auto max_int = std::numeric_limits<int>::max();
1544  CHKERR VecGhostUpdateBegin(ghost_x, INSERT_VALUES, SCATTER_FORWARD);
1545  CHKERR mult(0, x_loc_size, 0, max_int);
1546  CHKERR VecGhostUpdateEnd(ghost_x, INSERT_VALUES, SCATTER_FORWARD);
1547  CHKERR mult(x_loc_size, max_int, 0, max_int);
1548 
1549  CHKERR VecGhostUpdateBegin(ghost_y, ADD_VALUES, SCATTER_REVERSE);
1550  CHKERR VecGhostUpdateEnd(ghost_y, ADD_VALUES, SCATTER_REVERSE);
1551 
1552  switch (iora) {
1553  case INSERT_VALUES:
1554  CHKERR VecCopy(ghost_y, y);
1555  break;
1556  case ADD_VALUES:
1557  CHKERR VecAXPY(y, 1., ghost_y);
1558  break;
1559  default:
1560  CHK_MOAB_THROW(MOFEM_NOT_IMPLEMENTED, "Wrong InsertMode");
1561  }
1562 
1563 #ifndef NDEBUG
1564 
1565  auto print_norm = [&](auto msg, auto y) {
1567  PetscReal norm;
1568  CHKERR VecNorm(y, NORM_2, &norm);
1569  int nb_loc_y;
1570  CHKERR VecGetLocalSize(y, &nb_loc_y);
1571  int nb_y;
1572  CHKERR VecGetSize(y, &nb_y);
1573  MOFEM_LOG("WORLD", Sev::noisy)
1574  << msg << " " << nb_y << " " << nb_loc_y << " norm " << norm;
1576  };
1577 
1578  switch (iora) {
1579  case INSERT_VALUES:
1580  print_norm("mult_schur_block_shell insert x", x);
1581  print_norm("mult_schur_block_shell insert y", y);
1582  break;
1583  case ADD_VALUES:
1584  print_norm("mult_schur_block_shell add x", x);
1585  print_norm("mult_schur_block_shell add y", y);
1586  break;
1587  default:
1588  CHK_MOAB_THROW(MOFEM_NOT_IMPLEMENTED, "Wrong InsertMode");
1589  }
1590 
1591 #endif // NDEBUG
1592 
1593  // PetscLogFlops(xxx)
1594  PetscLogEventEnd(SchurEvents::MOFEM_EVENT_BlockStructureMult, 0, 0, 0, 0);
1595 
1597 }

◆ operator<<() [1/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const AccelerationCubitBcData e 
)

Definition at line 103 of file BCData.cpp.

103  {
104  os << "\n";
105  os << "A c c e l e r a t i o n \n \n";
106  if (e.data.flag1 == 1)
107  os << "Acceleration magnitude (X-Translation): " << e.data.value1 << "\n";
108  else
109  os << "Acceleration magnitude (X-Translation): N/A"
110  << "\n";
111  if (e.data.flag2 == 1)
112  os << "Acceleration magnitude (Y-Translation): " << e.data.value2 << "\n";
113  else
114  os << "Acceleration magnitude (Y-Translation): N/A"
115  << "\n";
116  if (e.data.flag3 == 1)
117  os << "Acceleration magnitude (Z-Translation): " << e.data.value3 << "\n";
118  else
119  os << "Acceleration magnitude (Z-Translation): N/A"
120  << "\n";
121  if (e.data.flag4 == 1)
122  os << "Acceleration magnitude (X-Rotation): " << e.data.value4 << "\n";
123  else
124  os << "Acceleration magnitude (X-Rotation): N/A"
125  << "\n";
126  if (e.data.flag5 == 1)
127  os << "Acceleration magnitude (Y-Rotation): " << e.data.value5 << "\n";
128  else
129  os << "Acceleration magnitude (Y-Rotation): N/A"
130  << "\n";
131  if (e.data.flag6 == 1)
132  os << "Acceleration magnitude (Z-Rotation): " << e.data.value6 << "\n \n";
133  else
134  os << "Acceleration magnitude (Z-Rotation): N/A"
135  << "\n \n";
136  return os;
137 }

◆ operator<<() [2/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const Block_BodyForces e 
)

Definition at line 87 of file MaterialBlocks.cpp.

87  {
88  os << std::endl << "Block Body Forces" << std::endl;
89  os << "-------------------" << std::endl;
90  os << "density = " << e.data.density << std::endl;
91  os << "acceleration_x = " << e.data.acceleration_x << std::endl;
92  os << "acceleration_y = " << e.data.acceleration_y << std::endl;
93  os << "acceleration_z = " << e.data.acceleration_z << std::endl;
94  os << "User attribute 4 = " << e.data.User4 << std::endl;
95  os << "User attribute 5 = " << e.data.User5 << std::endl;
96  os << "User attribute 6 = " << e.data.User6 << std::endl;
97  os << "User attribute 7 = " << e.data.User7 << std::endl;
98  os << "User attribute 8 = " << e.data.User8 << std::endl << std::endl;
99  return os;
100 }

◆ operator<<() [3/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const BlockSetAttributes e 
)

Definition at line 8 of file MaterialBlocks.cpp.

8  {
9  os << std::endl << "Blcok attributes" << std::endl;
10  os << "-------------------" << std::endl;
11  os << "User attribute 1 = " << e.data.User1 << std::endl;
12  os << "User attribute 2 = " << e.data.User2 << std::endl;
13  os << "User attribute 3 = " << e.data.User3 << std::endl;
14  os << "User attribute 4 = " << e.data.User4 << std::endl;
15  os << "User attribute 5 = " << e.data.User5 << std::endl;
16  os << "User attribute 6 = " << e.data.User6 << std::endl;
17  os << "User attribute 7 = " << e.data.User7 << std::endl;
18  os << "User attribute 8 = " << e.data.User7 << std::endl;
19  os << "User attribute 9 = " << e.data.User7 << std::endl;
20  os << "User attribute 10 = " << e.data.User10 << std::endl << std::endl;
21  return os;
22 }

◆ operator<<() [4/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const CfgCubitBcData e 
)

Definition at line 199 of file BCData.cpp.

199  {
200  os << "\n";
201  os << "CFD BC \n \n";
202  return os;
203 }

◆ operator<<() [5/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const CubitMeshSets e 
)

Definition at line 360 of file BCMultiIndices.cpp.

360  {
361  // get name of cubit meshset
362  std::ostringstream ss;
363  unsigned jj = 0;
364  while (1 << jj != LASTSET_BC) {
365  const CubitBCType jj_bc_type = 1 << jj;
366  if ((e.cubitBcType & jj_bc_type).any()) {
367  string bc_type_name;
368  ss << " " << string(CubitBCNames[jj + 1]);
369  }
370  ++jj;
371  }
372 
373  // push data to stream
374  os << "meshset " << e.meshset << " type" << ss.str();
375  if (e.msId != nullptr)
376  os << " msId " << *(e.msId);
377  if (e.tagName != nullptr) {
378  os << " name " << e.getName();
379  }
380  if (e.tagBlockHeaderData != nullptr) {
381  os << " block header: ";
382  os << " blockCol = " << e.tagBlockHeaderData[0];
383  os << " blockMat = " << e.tagBlockHeaderData[1];
384  os << " blockDimension = " << e.tagBlockHeaderData[2];
385  }
386  return os;
387 }

◆ operator<<() [6/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const DisplacementCubitBcData e 
)

Definition at line 10 of file BCData.cpp.

10  {
11  os << "\n";
12  os << "D i s p l a c e m e n t \n \n";
13  os << "Flag for X-Translation (0/1): " << (int)e.data.flag1 << "\n";
14  os << "Flag for Y-Translation (0/1): " << (int)e.data.flag2 << "\n";
15  os << "Flag for Z-Translation (0/1): " << (int)e.data.flag3 << "\n";
16  os << "Flag for X-Rotation (0/1): " << (int)e.data.flag4 << "\n";
17  os << "Flag for Y-Rotation (0/1): " << (int)e.data.flag5 << "\n";
18  os << "Flag for Z-Rotation (0/1): " << (int)e.data.flag6 << "\n \n";
19 
20  if (e.data.flag1 == 1)
21  os << "Displacement magnitude (X-Translation): " << e.data.value1 << "\n";
22  else
23  os << "Displacement magnitude (X-Translation): N/A"
24  << "\n";
25  if (e.data.flag2 == 1)
26  os << "Displacement magnitude (Y-Translation): " << e.data.value2 << "\n";
27  else
28  os << "Displacement magnitude (Y-Translation): N/A"
29  << "\n";
30  if (e.data.flag3 == 1)
31  os << "Displacement magnitude (Z-Translation): " << e.data.value3 << "\n";
32  else
33  os << "Displacement magnitude (Z-Translation): N/A"
34  << "\n";
35  if (e.data.flag4 == 1)
36  os << "Displacement magnitude (X-Rotation): " << e.data.value4 << "\n";
37  else
38  os << "Displacement magnitude (X-Rotation): N/A"
39  << "\n";
40  if (e.data.flag5 == 1)
41  os << "Displacement magnitude (Y-Rotation): " << e.data.value5 << "\n";
42  else
43  os << "Displacement magnitude (Y-Rotation): N/A"
44  << "\n";
45  if (e.data.flag6 == 1)
46  os << "Displacement magnitude (Z-Rotation): " << e.data.value6 << "\n \n";
47  else
48  os << "Displacement magnitude (Z-Rotation): N/A"
49  << "\n \n";
50  return os;
51 }

◆ operator<<() [7/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const DofEntity e 
)

Definition at line 39 of file DofsMultiIndices.cpp.

39  {
40  os << "dof_uid " << e.getLocalUniqueId() << " dof_order " << e.getDofOrder()
41  << " dof_rank " << e.getDofCoeffIdx() << " dof " << e.getEntDofIdx()
42  << " active " << (e.dof < 0 ? false : true) << " "
43  << *e.getFieldEntityPtr();
44  return os;
45 }

◆ operator<<() [8/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const EntFiniteElement e 
)

Definition at line 425 of file FEMultiIndices.cpp.

425  {
426  os << *e.getFiniteElementPtr() << std::endl;
427  os << *e.sPtr;
428  return os;
429 }

◆ operator<<() [9/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const EntitiesFieldData e 
)

Definition at line 270 of file EntitiesFieldData.cpp.

270  {
271  for (EntityType t = MBVERTEX; t != MBMAXTYPE; ++t) {
272  for (unsigned int nn = 0; nn < e.dataOnEntities[t].size(); nn++) {
273  os << "dataOnEntities[" << moab::CN::EntityTypeName(t) << "][" << nn
274  << "]" << std::endl
275  << e.dataOnEntities[t][nn] << std::endl;
276  }
277  }
278  return os;
279 }

◆ operator<<() [10/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const EntitiesFieldData::EntData e 
)

Definition at line 240 of file EntitiesFieldData.cpp.

241  {
242  os << "sEnse: " << e.getSense() << std::endl
243  << "oRder: " << e.getOrder() << std::endl
244  << "global indices: " << e.getIndices() << std::endl
245  << "local indices: " << e.getLocalIndices() << std::endl;
246  // FIXME: precision should not be set here
247  os << "fieldData: " << std::fixed << std::setprecision(2) << e.getFieldData()
248  << std::endl;
249  MatrixDouble base = const_cast<EntitiesFieldData::EntData &>(e).getN();
250  MatrixDouble diff_base =
251  const_cast<EntitiesFieldData::EntData &>(e).getDiffN();
252  const double eps = 1e-6;
253  for (unsigned int ii = 0; ii != base.size1(); ii++) {
254  for (unsigned int jj = 0; jj != base.size2(); jj++) {
255  if (fabs(base(ii, jj)) < eps)
256  base(ii, jj) = 0;
257  }
258  }
259  for (unsigned int ii = 0; ii != diff_base.size1(); ii++) {
260  for (unsigned int jj = 0; jj != diff_base.size2(); jj++) {
261  if (fabs(diff_base(ii, jj)) < eps)
262  diff_base(ii, jj) = 0;
263  }
264  }
265  os << "N: " << std::fixed << base << std::endl
266  << "diffN: " << std::fixed << diff_base;
267  return os;
268 }

◆ operator<<() [11/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const FEDofEntity e 
)

Definition at line 84 of file DofsMultiIndices.cpp.

84  {
85  os << "local dof FiniteElement idx "
86  << "side_number " << static_cast<int>(e.getSideNumberPtr()->side_number)
87  << " "
88  << "sense " << static_cast<int>(e.getSideNumberPtr()->sense) << " "
89  << *e.getFieldEntityPtr();
90  return os;
91 }

◆ operator<<() [12/40]

std::ostream & MoFEM::operator<< ( std::ostream &  os,
const FENumeredDofEntity e 
)

Definition at line 93 of file DofsMultiIndices.cpp.

93  {
94  os << "local dof FiniteElement idx "
95  << "side_number " << (int)e.getSideNumberPtr()->side_number << " "
96  << "sense " << (int)e.getSideNumberPtr()->sense << " "
97  << *e.getFieldEntityPtr();
98  return os;
99 }

◆ operator<<() [13/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const Field e 
)

Definition at line 551 of file FieldMultiIndices.cpp.

551  {
552  os << e.getNameRef() << " field_id " << e.getId().to_ulong() << " space "
553  << e.getSpaceName() << " field continuity " << e.getContinuityName()
554  << " approximation base " << e.getApproxBaseName() << " nb coefficients "
555  << e.getNbOfCoeffs() << " meshset " << e.meshSet;
556  return os;
557 }

◆ operator<<() [14/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const FieldEntity e 
)

Definition at line 54 of file FieldEntsMultiIndices.cpp.

54  {
55  os << "ent_global_uid " << e.getLocalUniqueId() << " entity " << e.getEnt()
56  << " type " << e.getEntTypeName() << " pstatus "
57  << std::bitset<8>(e.getPStatus()) << " owner handle " << e.getOwnerEnt()
58  << " owner proc " << e.getOwnerProc() << " order " << e.getMaxOrder()
59  << " " << *e.getFieldRawPtr();
60  return os;
61 }

◆ operator<<() [15/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const FieldEntityEntFiniteElementAdjacencyMap e 
)

Definition at line 566 of file FieldMultiIndices.cpp.

567  {
568  os << "byWhat " << std::bitset<3>(e.byWhat) << " " << *e.entFieldPtr
569  << std::endl
570  << *e.entFePtr->getFiniteElementPtr();
571  return os;
572 }

◆ operator<<() [16/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const FieldSeries e 
)

Definition at line 323 of file SeriesMultiIndices.cpp.

323  {
324  os << "name " << e.getName() << " meshset " << e.getMeshset();
325  return os;
326 }

◆ operator<<() [17/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const FieldSeriesStep e 
)

Definition at line 328 of file SeriesMultiIndices.cpp.

328  {
329  os << *(e.get_FieldSeries_ptr()) << " step number " << e.step_number
330  << " time " << e.get_time();
331  return os;
332 }

◆ operator<<() [18/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const FiniteElement e 
)

Definition at line 363 of file FEMultiIndices.cpp.

363  {
364  os << e.getNameRef() << " fe_id " << e.getId().to_ulong() << " f_id_row "
365  << e.getBitFieldIdRow() << " f_id_col " << e.getBitFieldIdCol()
366  << " BitFEId_data " << e.getBitFieldIdData();
367  return os;
368 }

◆ operator<<() [19/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const ForceCubitBcData e 
)

Definition at line 53 of file BCData.cpp.

53  {
54  os << "\n";
55  os << "F o r c e \n \n";
56  os << "Force magnitude: " << e.data.value1 << "\n";
57  os << "Moment magnitude: " << e.data.value2 << "\n";
58  os << "Force direction vector (X-component): " << e.data.value3 << "\n";
59  os << "Force direction vector (Y-component): " << e.data.value4 << "\n";
60  os << "Force direction vector (Z-component): " << e.data.value5 << "\n";
61  os << "Moment direction vector (X-component): " << e.data.value6 << "\n";
62  os << "Moment direction vector (Y-component): " << e.data.value7 << "\n";
63  os << "Moment direction vector (Z-component): " << e.data.value8 << "\n \n";
64  return os;
65 }

◆ operator<<() [20/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const HeatFluxCubitBcData e 
)

Definition at line 178 of file BCData.cpp.

178  {
179  os << "\n";
180  os << "H e a t F l u x \n \n";
181  if (e.data.flag1 == 1)
182  os << "Heat flux value: " << e.data.value1 << "\n";
183  else
184  os << "Heat flux is applied on thin shells"
185  << "\n";
186  if (e.data.flag2 == 1)
187  os << "Heat flux value (thin shell top): " << e.data.value2 << "\n";
188  else
189  os << "Heat flux value (thin shell top): N/A"
190  << "\n";
191  if (e.data.flag3 == 1)
192  os << "Heat flux value (thin shell bottom): " << e.data.value3 << "\n \n";
193  else
194  os << "Heat flux value (thin shell bottom): N/A"
195  << "\n \n";
196  return os;
197 }

◆ operator<<() [21/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const Mat_Elastic e 
)

Definition at line 24 of file MaterialBlocks.cpp.

24  {
25  os << std::endl << "Material Properties" << std::endl;
26  os << "-------------------" << std::endl;
27  os << "Young's modulus = " << e.data.Young << std::endl;
28  os << "Poisson's ratio = " << e.data.Poisson << std::endl;
29  os << "Thermal expansion = " << e.data.ThermalExpansion << std::endl;
30  os << "User attribute 1 = " << e.data.User1 << std::endl;
31  os << "User attribute 2 = " << e.data.User2 << std::endl;
32  os << "User attribute 3 = " << e.data.User3 << std::endl;
33  os << "User attribute 4 = " << e.data.User4 << std::endl;
34  os << "User attribute 5 = " << e.data.User5 << std::endl;
35  os << "User attribute 6 = " << e.data.User6 << std::endl;
36  os << "User attribute 7 = " << e.data.User7 << std::endl << std::endl;
37  return os;
38 }

◆ operator<<() [22/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const Mat_Elastic_EberleinHolzapfel1 e 
)

Definition at line 40 of file MaterialBlocks.cpp.

41  {
42  os << std::endl << "Material Properties" << std::endl;
43  os << "-------------------" << std::endl;
44  os << "Young's modulus = " << e.data.Young << std::endl;
45  os << "Poisson's ratio = " << e.data.Poisson << std::endl;
46  os << "k1 = " << e.data.k1 << std::endl;
47  os << "k2 = " << e.data.k2 << std::endl;
48  os << "a0_x = " << e.data.a0x << std::endl;
49  os << "a0_y = " << e.data.a0y << std::endl;
50  os << "a0_z = " << e.data.a0z << std::endl;
51  os << "a1_x = " << e.data.a1x << std::endl;
52  os << "a1_y = " << e.data.a1y << std::endl;
53  os << "a1_Z = " << e.data.a1z << std::endl << std::endl;
54  return os;
55 }

◆ operator<<() [23/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const Mat_Elastic_TransIso e 
)

Definition at line 102 of file MaterialBlocks.cpp.

102  {
103  os << std::endl << "Material Properties" << std::endl;
104  os << "-------------------" << std::endl;
105  os << "Young's modulus in xy plane (Ep) = " << e.data.Youngp << std::endl;
106  os << "Young's modulus in z-direction (Ez) = " << e.data.Youngz << std::endl;
107  os << "Poisson's ratio in xy plane (vp) = " << e.data.Poissonp
108  << std::endl;
109  os << "Poisson's ratio in z-direction (vpz) = " << e.data.Poissonpz
110  << std::endl;
111  os << "Shear modulus in z-direction (Gzp) = " << e.data.Shearzp << std::endl
112  << std::endl;
113  return os;
114 }

◆ operator<<() [24/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const Mat_Interf e 
)

Definition at line 116 of file MaterialBlocks.cpp.

116  {
117  os << std::endl << "Material Properties" << std::endl;
118  os << "-------------------" << std::endl;
119  os << "Elastic module = " << e.data.alpha << std::endl << std::endl;
120  os << "Damage coupling = " << e.data.beta << std::endl << std::endl;
121  os << "Strengh = " << e.data.ft << std::endl << std::endl;
122  os << "Fracture energy = " << e.data.Gf << std::endl << std::endl;
123 
124  return os;
125 }

◆ operator<<() [25/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const Mat_Moisture e 
)

Definition at line 72 of file MaterialBlocks.cpp.

72  {
73  os << std::endl << "Material Properties" << std::endl;
74  os << "-------------------" << std::endl;
75  os << "Diffusivity = " << e.data.Diffusivity << std::endl;
76  os << "Viscosity = " << e.data.Viscosity << std::endl;
77  os << "Permeability = " << e.data.Permeability << std::endl;
78  os << "User attribute 3 = " << e.data.User3 << std::endl;
79  os << "User attribute 4 = " << e.data.User4 << std::endl;
80  os << "User attribute 5 = " << e.data.User5 << std::endl;
81  os << "User attribute 6 = " << e.data.User6 << std::endl;
82  os << "User attribute 7 = " << e.data.User7 << std::endl;
83  os << "User attribute 8 = " << e.data.User8 << std::endl << std::endl;
84  return os;
85 }

◆ operator<<() [26/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const Mat_Thermal e 
)

Definition at line 57 of file MaterialBlocks.cpp.

57  {
58  os << std::endl << "Material Properties" << std::endl;
59  os << "-------------------" << std::endl;
60  os << "Conductivity = " << e.data.Conductivity << std::endl;
61  os << "User attribute 1 = " << e.data.HeatCapacity << std::endl;
62  os << "User attribute 2 = " << e.data.User2 << std::endl;
63  os << "User attribute 3 = " << e.data.User3 << std::endl;
64  os << "User attribute 4 = " << e.data.User4 << std::endl;
65  os << "User attribute 5 = " << e.data.User5 << std::endl;
66  os << "User attribute 6 = " << e.data.User6 << std::endl;
67  os << "User attribute 7 = " << e.data.User7 << std::endl;
68  os << "User attribute 8 = " << e.data.User8 << std::endl << std::endl;
69  return os;
70 }

◆ operator<<() [27/40]

std::ostream & MoFEM::operator<< ( std::ostream &  os,
const MedInterface::FieldData field_data 
)

Definition at line 1258 of file MedInterface.cpp.

1259  {
1260  os << "field name: " << field_data.fieldName;
1261  os << " mesh name: " << field_data.meshName;
1262  os << " local mesh: " << ((field_data.localMesh) ? "true" : "false");
1263  os << std::endl;
1264  // os << " field type: ";
1265  // switch (field_data.fieldType) {
1266  // case MED_FLOAT64: os << "MED_FLOAT64"; break;
1267  // case MED_INT32: os << "MED_INT32"; break;
1268  // case MED_INT64: os << "MED_INT64"; break;
1269  // case MED_INT: os << "MED_INT"; break;
1270  // };
1271  os << " componentNames:";
1272  for (unsigned int ff = 0; ff != field_data.componentNames.size(); ff++) {
1273  os << " " << field_data.componentNames[ff];
1274  }
1275  os << std::endl;
1276  os << " componentUnits:";
1277  for (unsigned int ff = 0; ff != field_data.componentUnits.size(); ff++) {
1278  os << " " << field_data.componentUnits[ff];
1279  }
1280  os << std::endl;
1281  os << " dtUnit: " << field_data.dtUnit << endl;
1282  os << " number of steps: " << field_data.ncSteps;
1283  return os;
1284 }

◆ operator<<() [28/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const NumeredDofEntity e 
)

Definition at line 77 of file DofsMultiIndices.cpp.

77  {
78  os << "idx " << e.dofIdx << " part " << e.pArt << " petsc idx "
79  << e.petscGloablDofIdx << " ( " << e.petscLocalDofIdx << " ) "
80  << *e.getFieldEntityPtr();
81  return os;
82 }

◆ operator<<() [29/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const NumeredEntFiniteElement e 
)

Definition at line 488 of file FEMultiIndices.cpp.

488  {
489  os << "part " << e.part << " " << *(e.getEntFiniteElement());
490  return os;
491 }

◆ operator<<() [30/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const PressureCubitBcData e 
)

Definition at line 170 of file BCData.cpp.

170  {
171  os << "\n";
172  os << "P r e s s u r e \n \n";
173  os << "Pressure flag2: " << (int)e.data.flag2 << "\n";
174  os << "Pressure value: " << e.data.value1 << "\n \n";
175  return os;
176 }

◆ operator<<() [31/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const Problem e 
)

Definition at line 37 of file ProblemsMultiIndices.cpp.

37  {
38  os << "Problem id " << e.getId() << " name " << e.getName() << endl;
39  os << "FiniteElement id " << e.getBitFEId() << endl;
40  os << "BitRefLevel " << e.getBitRefLevel() << endl;
41  os << "BitRefLevelMask " << e.getBitRefLevelMask();
42  return os;
43 }

◆ operator<<() [32/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const RefElement e 
)

Definition at line 18 of file RefElementMultiIndices.cpp.

18  {
19  os << " ref egdes " << e.getBitRefEdges();
20  os << " " << *(e.sPtr);
21  return os;
22 }

◆ operator<<() [33/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const RefElement_EDGE e 
)

Definition at line 452 of file RefElementMultiIndices.cpp.

452  {
453  os << *e.sPtr;
454  return os;
455 }

◆ operator<<() [34/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const RefElement_VERTEX e 
)

Definition at line 488 of file RefElementMultiIndices.cpp.

488  {
489  os << *e.sPtr;
490  return os;
491 }

◆ operator<<() [35/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const RefElementFace e 
)

Definition at line 408 of file RefElementMultiIndices.cpp.

408  {
409  os << *e.sPtr;
410  return os;
411 }

◆ operator<<() [36/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const RefElementVolume e 
)

Definition at line 332 of file RefElementMultiIndices.cpp.

332  {
333  os << " ref egdes " << e.getBitRefEdges();
334  os << " " << *e.sPtr;
335  return os;
336 }

◆ operator<<() [37/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const RefEntity e 
)

Definition at line 46 of file RefEntsMultiIndices.cpp.

46  {
47  os << "ent " << e.ent;
48  os << " pstatus " << std::bitset<8>(e.getPStatus());
49  os << " owner ent " << e.getOwnerEnt();
50  os << " owner proc " << e.getOwnerProc();
51  os << " parent ent " << e.getParentEnt();
52  os << " ent type " << e.getEntTypeName();
53  os << " ent parent type " << e.getParentEntType();
54  return os;
55 }

◆ operator<<() [38/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const TemperatureCubitBcData e 
)

Definition at line 139 of file BCData.cpp.

139  {
140  os << "\n";
141  os << "T e m p e r a t u r e \n \n";
142  if (e.data.flag1 == 1)
143  os << "Temperature: " << e.data.value1 << "\n";
144  else
145  os << "Temperature (default case): N/A"
146  << "\n";
147  if (e.data.flag2 == 1)
148  os << "Temperature (thin shell middle): " << e.data.value2 << "\n";
149  else
150  os << "Temperature (thin shell middle): N/A"
151  << "\n";
152  if (e.data.flag3 == 1)
153  os << "Temperature (thin shell gradient): " << e.data.value3 << "\n";
154  else
155  os << "Temperature (thin shell gradient): N/A"
156  << "\n";
157  if (e.data.flag4 == 1)
158  os << "Temperature (thin shell top): " << e.data.value4 << "\n";
159  else
160  os << "Temperature (thin shell top): N/A"
161  << "\n";
162  if (e.data.flag5 == 1)
163  os << "Temperature (thin shell bottom): " << e.data.value5 << "\n \n";
164  else
165  os << "Temperature (thin shell bottom): N/A"
166  << "\n \n";
167  return os;
168 }

◆ operator<<() [39/40]

std::ostream& MoFEM::operator<< ( std::ostream &  os,
const VelocityCubitBcData e 
)

Definition at line 67 of file BCData.cpp.

67  {
68  os << "\n";
69  os << "V e l o c i t y \n \n";
70  if (e.data.flag1 == 1)
71  os << "Velocity magnitude (X-Translation): " << e.data.value1 << "\n";
72  else
73  os << "Velocity magnitude (X-Translation): N/A"
74  << "\n";
75  if (e.data.flag2 == 1)
76  os << "Velocity magnitude (Y-Translation): " << e.data.value2 << "\n";
77  else
78  os << "Velocity magnitude (Y-Translation): N/A"
79  << "\n";
80  if (e.data.flag3 == 1)
81  os << "Velocity magnitude (Z-Translation): " << e.data.value3 << "\n";
82  else
83  os << "Velocity magnitude (Z-Translation): N/A"
84  << "\n";
85  if (e.data.flag4 == 1)
86  os << "Velocity magnitude (X-Rotation): " << e.data.value4 << "\n";
87  else
88  os << "Velocity magnitude (X-Rotation): N/A"
89  << "\n";
90  if (e.data.flag5 == 1)
91  os << "Velocity magnitude (Y-Rotation): " << e.data.value5 << "\n";
92  else
93  os << "Velocity magnitude (Y-Rotation): N/A"
94  << "\n";
95  if (e.data.flag6 == 1)
96  os << "Velocity magnitude (Z-Rotation): " << e.data.value6 << "\n \n";
97  else
98  os << "Velocity magnitude (Z-Rotation): N/A"
99  << "\n \n";
100  return os;
101 }

◆ operator<<() [40/40]

std::ostream & MoFEM::operator<< ( std::ostream &  strm,
const LogManager::SeverityLevel level 
)

Definition at line 26 of file LogManager.cpp.

27  {
28 
29  strm << "<" << LogManager::severityStrings[level] << "> ";
30 
31  return strm;
32 }

◆ PCMGSetUpViaApproxOrders()

MoFEMErrorCode MoFEM::PCMGSetUpViaApproxOrders ( PC  pc,
boost::shared_ptr< PCMGSetUpViaApproxOrdersCtx ctx,
int  verb = 0 
)

Function build MG structure.

Parameters
pcMG pre-conditioner http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCMG.html
ctxMoFEM data structure for MG
verbverbosity level
Returns
error code
Examples
elasticity.cpp, and test_broken_space.cpp.

Definition at line 634 of file PCMGSetUpViaApproxOrders.cpp.

635  {
636 
637  PetscValidHeaderSpecific(pc, PC_CLASSID, 1);
639 
640  auto core_log = logging::core::get();
641  core_log->add_sink(LogManager::createSink(LogManager::getStrmWorld(),
642  "PCMGViaApproximationOrders"));
643  LogManager::setLog("PCMGViaApproximationOrders");
644  MOFEM_LOG_TAG("PCMGViaApproximationOrders", "PCMGViaApproximationOrders");
645 
646  MOFEM_LOG("PCMGViaApproximationOrders", Sev::verbose)
647  << "Setup PCMGSetUpViaApproxOrders";
648 
649  CHKERR ctx->getOptions();
650  CHKERR ctx->buildProlongationOperator(true, verb);
651 
652 #if PETSC_VERSION_GE(3, 8, 0)
653  CHKERR PCMGSetGalerkin(pc, PC_MG_GALERKIN_NONE);
654 #else
655  CHKERR PCMGSetGalerkin(pc, PETSC_FALSE);
656 #endif
657 
658  CHKERR PCMGSetLevels(pc, ctx->nbLevels, NULL);
659 
660  MOFEM_LOG("PCMGViaApproximationOrders", Sev::noisy)
661  << "Setup PCMGSetUpViaApproxOrders <- end";
662 
664 }

◆ PetscOptionsGetBool()

PetscErrorCode MoFEM::PetscOptionsGetBool ( PetscOptions *  ,
const char  pre[],
const char  name[],
PetscBool *  bval,
PetscBool *  set 
)
inline

◆ PetscOptionsGetEList()

PetscErrorCode MoFEM::PetscOptionsGetEList ( PetscOptions *  ,
const char  pre[],
const char  name[],
const char *const *  list,
PetscInt  next,
PetscInt *  value,
PetscBool *  set 
)
inline

◆ PetscOptionsGetInt()

PetscErrorCode MoFEM::PetscOptionsGetInt ( PetscOptions *  ,
const char  pre[],
const char  name[],
PetscInt *  ivalue,
PetscBool *  set 
)
inline

◆ PetscOptionsGetIntArray()

PetscErrorCode MoFEM::PetscOptionsGetIntArray ( PetscOptions  options,
const char  pre[],
const char  name[],
PetscInt  dvalue[],
PetscInt *  nmax,
PetscBool *  set 
)
inline

Definition at line 215 of file DeprecatedPetsc.hpp.

219  {
220  PetscErrorCode ierr;
222  ierr = ::PetscOptionsGetIntArray(pre, name, dvalue, nmax, set);
223  CHKERRQ(ierr);
225 }

◆ PetscOptionsGetReal()

PetscErrorCode MoFEM::PetscOptionsGetReal ( PetscOptions *  ,
const char  pre[],
const char  name[],
PetscReal *  dval,
PetscBool *  set 
)
inline
Examples
dynamic_first_order_con_law.cpp, and mixed_poisson.cpp.

Definition at line 152 of file DeprecatedPetsc.hpp.

154  {
155  PetscErrorCode ierr;
157  ierr = ::PetscOptionsGetReal(pre, name, dval, set);
158  CHKERRQ(ierr);
160 }

◆ PetscOptionsGetRealArray()

PetscErrorCode MoFEM::PetscOptionsGetRealArray ( PetscOptions *  ,
const char  pre[],
const char  name[],
PetscReal  dval[],
PetscInt *  nmax,
PetscBool *  set 
)
inline
Examples
dynamic_first_order_con_law.cpp, elasticity.cpp, seepage.cpp, and thermo_elastic.cpp.

Definition at line 192 of file DeprecatedPetsc.hpp.

195  {
196  PetscErrorCode ierr;
198  ierr = ::PetscOptionsGetRealArray(pre, name, dval, nmax, set);
199  CHKERRQ(ierr);
201 }

◆ PetscOptionsGetScalar()

PetscErrorCode MoFEM::PetscOptionsGetScalar ( PetscOptions *  ,
const char  pre[],
const char  name[],
PetscScalar *  dval,
PetscBool *  set 
)
inline

◆ PetscOptionsGetScalarArray()

PetscErrorCode MoFEM::PetscOptionsGetScalarArray ( PetscOptions  options,
const char  pre[],
const char  name[],
PetscScalar  dvalue[],
PetscInt *  nmax,
PetscBool *  set 
)
inline

Definition at line 228 of file DeprecatedPetsc.hpp.

230  {
231  PetscErrorCode ierr;
233  ierr = ::PetscOptionsGetScalarArray(pre, name, dvalue, nmax, set);
234  CHKERRQ(ierr);
236 }

◆ PetscOptionsGetString()

PetscErrorCode MoFEM::PetscOptionsGetString ( PetscOptions *  ,
const char  pre[],
const char  name[],
char  str[],
size_t  size,
PetscBool *  set 
)
inline

◆ prism_type_1()

MoFEMErrorCode MoFEM::prism_type_1 ( const EntityHandle conn,
const BitRefEdges  split_edges,
const EntityHandle edge_new_nodes,
EntityHandle new_prism_conn 
)

Definition at line 1230 of file EntityRefine.cpp.

1233  {
1235  int ee = 0;
1236  for (; ee < 6; ee++) {
1237  if (split_edges.test(ee))
1238  break;
1239  }
1240  if (ee > 2)
1241  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
1242  const int cycle_edges[3][6] = {
1243  {0, 1, 2, 3, 4, 5}, {1, 2, 0, 4, 5, 3}, {2, 0, 1, 5, 3, 4}};
1244  const int cycle_nodes[3][6] = {
1245  {0, 1, 2, 3, 4, 5}, {1, 2, 0, 4, 5, 3}, {2, 0, 1, 5, 3, 4}};
1246  if (edge_new_nodes[cycle_nodes[ee][0]] == no_handle)
1247  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
1248  if (edge_new_nodes[cycle_nodes[ee][3]] == no_handle)
1249  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
1250  // PRISM0
1251  new_prism_conn[0 * 6 + 0] = edge_new_nodes[cycle_edges[ee][0]];
1252  new_prism_conn[0 * 6 + 1] = conn[cycle_nodes[ee][2]];
1253  new_prism_conn[0 * 6 + 2] = conn[cycle_nodes[ee][0]];
1254  new_prism_conn[0 * 6 + 3] = edge_new_nodes[cycle_edges[ee][3]];
1255  new_prism_conn[0 * 6 + 4] = conn[cycle_nodes[ee][5]];
1256  new_prism_conn[0 * 6 + 5] = conn[cycle_nodes[ee][3]];
1257  // PRISM1
1258  new_prism_conn[1 * 6 + 0] = edge_new_nodes[cycle_edges[ee][0]];
1259  new_prism_conn[1 * 6 + 1] = conn[cycle_nodes[ee][2]];
1260  new_prism_conn[1 * 6 + 2] = conn[cycle_nodes[ee][1]];
1261  new_prism_conn[1 * 6 + 3] = edge_new_nodes[cycle_edges[ee][3]];
1262  new_prism_conn[1 * 6 + 4] = conn[cycle_nodes[ee][5]];
1263  new_prism_conn[1 * 6 + 5] = conn[cycle_nodes[ee][4]];
1265 }

◆ prism_type_2()

MoFEMErrorCode MoFEM::prism_type_2 ( const EntityHandle conn,
const BitRefEdges  split_edges,
const EntityHandle edge_new_nodes,
EntityHandle new_prism_conn 
)

Definition at line 1266 of file EntityRefine.cpp.

1269  {
1271  const int cycle_edges[3][6] = {
1272  {0, 1, 2, 3, 4, 5}, {1, 2, 0, 4, 5, 3}, {2, 0, 1, 5, 3, 4}};
1273  const int cycle_nodes[3][6] = {
1274  {0, 1, 2, 3, 4, 5}, {1, 2, 0, 4, 5, 3}, {2, 0, 1, 5, 3, 4}};
1275  int ee = 0;
1276  for (; ee < 3; ee++) {
1277  BitRefEdges mach_pattern(0);
1278  mach_pattern.set(cycle_edges[ee][0]);
1279  mach_pattern.set(cycle_edges[ee][2]);
1280  mach_pattern.set(cycle_edges[ee][3]);
1281  mach_pattern.set(cycle_edges[ee][5]);
1282  if (mach_pattern == split_edges)
1283  break;
1284  }
1285  if (ee > 2)
1286  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
1287  EntityHandle _conn_[6], _edge_new_nodes_[6];
1288  int nn = 0;
1289  for (; nn < 6; nn++) {
1290  _conn_[nn] = conn[cycle_nodes[ee][nn]];
1291  _edge_new_nodes_[nn] = edge_new_nodes[cycle_edges[ee][nn]];
1292  }
1293  if (_conn_[1] < _conn_[2]) {
1294  EntityHandle _conn____;
1295  _conn____ = _conn_[2];
1296  _conn_[2] = _conn_[1];
1297  _conn_[1] = _conn____;
1298  _conn____ = _conn_[5];
1299  _conn_[5] = _conn_[4];
1300  _conn_[4] = _conn____;
1301  _conn____ = _edge_new_nodes_[0];
1302  _edge_new_nodes_[0] = _edge_new_nodes_[2];
1303  _edge_new_nodes_[2] = _conn____;
1304  _conn____ = _edge_new_nodes_[6 - 3];
1305  _edge_new_nodes_[6 - 3] = _edge_new_nodes_[8 - 3];
1306  _edge_new_nodes_[8 - 3] = _conn____;
1307  }
1308  if (_edge_new_nodes_[0] == no_handle)
1309  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
1310  if (_edge_new_nodes_[2] == no_handle)
1311  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
1312  if (_edge_new_nodes_[6 - 3] == no_handle)
1313  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
1314  if (_edge_new_nodes_[8 - 3] == no_handle)
1315  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
1316  // PRIMS0
1317  new_prism_conn[0 * 6 + 0] = _conn_[0];
1318  new_prism_conn[0 * 6 + 1] = _edge_new_nodes_[0];
1319  new_prism_conn[0 * 6 + 2] = _edge_new_nodes_[2];
1320  new_prism_conn[0 * 6 + 3] = _conn_[3];
1321  new_prism_conn[0 * 6 + 4] = _edge_new_nodes_[6 - 3];
1322  new_prism_conn[0 * 6 + 5] = _edge_new_nodes_[8 - 3];
1323  // PRISM1
1324  new_prism_conn[1 * 6 + 0] = _conn_[1];
1325  new_prism_conn[1 * 6 + 1] = _conn_[2];
1326  new_prism_conn[1 * 6 + 2] = _edge_new_nodes_[0];
1327  new_prism_conn[1 * 6 + 3] = _conn_[4];
1328  new_prism_conn[1 * 6 + 4] = _conn_[5];
1329  new_prism_conn[1 * 6 + 5] = _edge_new_nodes_[6 - 3];
1330  // PRISM2
1331  new_prism_conn[2 * 6 + 0] = _conn_[2];
1332  new_prism_conn[2 * 6 + 1] = _edge_new_nodes_[0];
1333  new_prism_conn[2 * 6 + 2] = _edge_new_nodes_[2];
1334  new_prism_conn[2 * 6 + 3] = _conn_[5];
1335  new_prism_conn[2 * 6 + 4] = _edge_new_nodes_[6 - 3];
1336  new_prism_conn[2 * 6 + 5] = _edge_new_nodes_[8 - 3];
1338 }

◆ prism_type_3()

MoFEMErrorCode MoFEM::prism_type_3 ( const EntityHandle conn,
const BitRefEdges  split_edges,
const EntityHandle edge_new_nodes,
EntityHandle new_prism_conn 
)

Definition at line 1339 of file EntityRefine.cpp.

1342  {
1344  int ee = 0;
1345  for (; ee < 6; ee++) {
1346  if (!split_edges.test(ee))
1347  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
1348  }
1349  // PRISM0
1350  new_prism_conn[0 * 6 + 0] = edge_new_nodes[0];
1351  new_prism_conn[0 * 6 + 1] = edge_new_nodes[2];
1352  new_prism_conn[0 * 6 + 2] = conn[0];
1353  new_prism_conn[0 * 6 + 3] = edge_new_nodes[6 - 3];
1354  new_prism_conn[0 * 6 + 4] = edge_new_nodes[8 - 3];
1355  new_prism_conn[0 * 6 + 5] = conn[3];
1356  // PRISM1
1357  new_prism_conn[1 * 6 + 0] = edge_new_nodes[0];
1358  new_prism_conn[1 * 6 + 1] = edge_new_nodes[1];
1359  new_prism_conn[1 * 6 + 2] = conn[1];
1360  new_prism_conn[1 * 6 + 3] = edge_new_nodes[6 - 3];
1361  new_prism_conn[1 * 6 + 4] = edge_new_nodes[7 - 3];
1362  new_prism_conn[1 * 6 + 5] = conn[4];
1363  // PRISM2
1364  new_prism_conn[2 * 6 + 0] = edge_new_nodes[1];
1365  new_prism_conn[2 * 6 + 1] = edge_new_nodes[2];
1366  new_prism_conn[2 * 6 + 2] = conn[2];
1367  new_prism_conn[2 * 6 + 3] = edge_new_nodes[7 - 3];
1368  new_prism_conn[2 * 6 + 4] = edge_new_nodes[8 - 3];
1369  new_prism_conn[2 * 6 + 5] = conn[5];
1370  // PRISM3
1371  new_prism_conn[3 * 6 + 0] = edge_new_nodes[0];
1372  new_prism_conn[3 * 6 + 1] = edge_new_nodes[1];
1373  new_prism_conn[3 * 6 + 2] = edge_new_nodes[2];
1374  new_prism_conn[3 * 6 + 3] = edge_new_nodes[6 - 3];
1375  new_prism_conn[3 * 6 + 4] = edge_new_nodes[7 - 3];
1376  new_prism_conn[3 * 6 + 5] = edge_new_nodes[8 - 3];
1378 }

◆ quad_split_all_edges() [1/2]

MoFEMErrorCode MoFEM::quad_split_all_edges ( const EntityHandle conn,
const BitRefEdges  split_edges,
const EntityHandle edge_new_nodes,
EntityHandle new_quad_conn 
)

Definition at line 1380 of file EntityRefine.cpp.

1383  {
1384 
1385  return 0;
1386  }

◆ quad_split_all_edges() [2/2]

MoFEMErrorCode MoFEM::quad_split_all_edges ( const EntityHandle conn,
const EntityHandle edge_new_nodes,
EntityHandle new_quad_conn 
)

◆ rangeInserter()

template<typename I >
auto MoFEM::rangeInserter ( const I  f,
const I  s,
boost::function< bool(I it)>  tester,
boost::function< MoFEMErrorCode(I f, I s)>  inserter 
)

Insert ranges.

Template Parameters
I
Parameters
f
s
tester
inserter
Returns
auto

Definition at line 1945 of file Templates.hpp.

1946  {
1948 
1949  auto first = f;
1950  while (first != s)
1951  if (tester(first)) {
1952 
1953  auto second = first;
1954  ++second;
1955 
1956  while (second != s) {
1957  if (tester(second))
1958  ++second;
1959  else
1960  break;
1961  }
1962 
1963  CHKERR inserter(first, second);
1964 
1965  first = second;
1966  if (first != s)
1967  ++first;
1968 
1969  } else {
1970  ++first;
1971  }
1972 
1974 }

◆ reconstructMultiIndex()

template<typename MI , typename MO = Modify_change_nothing>
MoFEMErrorCode MoFEM::reconstructMultiIndex ( const MI &  mi,
MO &&  mo = Modify_change_nothing() 
)
inline

Template used to reconstruct multi-index.

Template Parameters
MImulti-index
Modifier
Parameters
mi
mo
Returns
MoFEMErrorCode

Definition at line 1853 of file Templates.hpp.

1854  {
1856  for (auto it = mi.begin(); it != mi.end(); ++it) {
1857  if (!const_cast<MI &>(mi).modify(it, mo))
1858  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1859  "Houston we have a problem");
1860  }
1862 }

◆ scalar_fun_one()

double MoFEM::scalar_fun_one ( const double  ,
const double  ,
const double   
)
inline

Definition at line 146 of file FormsIntegrators.hpp.

146  {
147  return 1;
148 }

◆ schur_mat_set_values_wrap()

MoFEMErrorCode MoFEM::schur_mat_set_values_wrap ( Mat  M,
const EntitiesFieldData::EntData row_data,
const EntitiesFieldData::EntData col_data,
const MatrixDouble mat,
InsertMode  iora 
)

Definition at line 2256 of file Schur.cpp.

2258  {
2259  return MatSetValues<AssemblyTypeSelector<PETSC>>(M, row_data, col_data, mat,
2260  iora);
2261 }

◆ schurSaveBlockMesh()

MoFEMErrorCode MoFEM::schurSaveBlockMesh ( boost::shared_ptr< BlockStructure block_mat_data,
std::string  filename 
)

Save block matrix as a mesh.

Parameters
block_mat_data
filename
Returns
MoFEMErrorCode
Examples
schur_test_diag_mat.cpp.

Definition at line 2380 of file Schur.cpp.

2381  {
2383 
2384  moab::Core core;
2385  moab::Interface &moab = core;
2386 
2387  ReadUtilIface *iface;
2388  CHKERR moab.query_interface(iface);
2389 
2390  auto size = block_mat_data->blockIndex.size();
2391 
2392  EntityHandle starting_vertex;
2393  vector<double *> arrays_coord;
2394  CHKERR iface->get_node_coords(3, 4 * size, 0, starting_vertex, arrays_coord);
2395  EntityHandle starting_handle;
2396  EntityHandle *array;
2397  CHKERR iface->get_element_connect(size, 4, MBQUAD, 0, starting_handle, array);
2398 
2399  double def_val_nrm2 = 0;
2400  Tag th_nrm2;
2401  CHKERR moab.tag_get_handle("nrm2", 1, MB_TYPE_DOUBLE, th_nrm2,
2402  MB_TAG_CREAT | MB_TAG_DENSE, &def_val_nrm2);
2403 
2404  int def_val_mat_shift = 0;
2405  Tag th_mat_shift;
2406  CHKERR moab.tag_get_handle("mat_shift", 1, MB_TYPE_INTEGER, th_mat_shift,
2407  MB_TAG_CREAT | MB_TAG_DENSE, &def_val_mat_shift);
2408 
2409  int i = 0;
2410  for (auto &d : block_mat_data->blockIndex) {
2411  auto row = d.getRow();
2412  auto col = d.getCol();
2413  auto nb_rows = d.getNbRows();
2414  auto nb_cols = d.getNbCols();
2415  auto mat_shift = d.getMatShift();
2416 
2417  // q0
2418  arrays_coord[0][4 * i + 0] = row;
2419  arrays_coord[1][4 * i + 0] = col;
2420  arrays_coord[2][4 * i + 0] = 0;
2421 
2422  // q1
2423  arrays_coord[0][4 * i + 1] = row + nb_rows;
2424  arrays_coord[1][4 * i + 1] = col;
2425  arrays_coord[2][4 * i + 1] = 0;
2426 
2427  // q2
2428  arrays_coord[0][4 * i + 2] = row + nb_rows;
2429  arrays_coord[1][4 * i + 2] = col + nb_cols;
2430  arrays_coord[2][4 * i + 2] = 0;
2431 
2432  // q3
2433  arrays_coord[0][4 * i + 3] = row;
2434  arrays_coord[1][4 * i + 3] = col + nb_cols;
2435  arrays_coord[2][4 * i + 3] = 0;
2436 
2437  // ele conn
2438  array[4 * i + 0] = starting_vertex + 4 * i + 0;
2439  array[4 * i + 1] = starting_vertex + 4 * i + 1;
2440  array[4 * i + 2] = starting_vertex + 4 * i + 2;
2441  array[4 * i + 3] = starting_vertex + 4 * i + 3;
2442 
2443  auto prt = &(*block_mat_data->dataBlocksPtr)[d.getMatShift()];
2444  auto nrm2 = cblas_dnrm2(nb_rows * nb_cols, prt, 1);
2445  EntityHandle ele = starting_handle + i;
2446  CHKERR moab.tag_set_data(th_nrm2, &ele, 1, &nrm2);
2447  CHKERR moab.tag_set_data(th_mat_shift, &ele, 1, &mat_shift);
2448 
2449  ++i;
2450  }
2451 
2452  CHKERR iface->update_adjacencies(starting_handle, size, 4, array);
2453  CHKERR moab.write_file(filename.c_str(), "VTK", "");
2454 
2456 }

◆ schurSwitchPreconditioner()

MoFEMErrorCode MoFEM::schurSwitchPreconditioner ( boost::shared_ptr< BlockStructure block_mat_data)

Switch preconditioner.

Parameters
block_mat_data
Returns
MoFEMErrorCode
Examples
schur_test_diag_mat.cpp.

Definition at line 2365 of file Schur.cpp.

2365  {
2367  if (block_mat_data->multiplyByPreconditioner) {
2368  block_mat_data->multiplyByPreconditioner = false;
2369  } else {
2370  if (!block_mat_data->preconditionerBlocksPtr) {
2371  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
2372  "preconditionerBlocksPtr not set");
2373  }
2374  block_mat_data->multiplyByPreconditioner = true;
2375  }
2377 }

◆ set_ref_ent_basic_data_ptr_impl()

template<int V, typename std::enable_if<(V >=0), int >::type * = nullptr>
void MoFEM::set_ref_ent_basic_data_ptr_impl ( boost::shared_ptr< BasicEntityData > &  ptr)

Definition at line 900 of file Core.cpp.

900  {
901  RefEntityTmp<V>::basicDataPtr = ptr;
902 };

◆ setMPCParentAdjacency()

MoFEMErrorCode MoFEM::setMPCParentAdjacency ( )

Definition at line 15 of file EssentialMPCsData.cpp.

15  {
17 
19 }

◆ setSchurA00MatSolvePC()

MoFEMErrorCode MoFEM::setSchurA00MatSolvePC ( SmartPetscObj< PC >  pc)

Set PC for A00 block.

Parameters
pc
Returns
MoFEMErrorCode
Examples
plastic.cpp, schur_test_diag_mat.cpp, and test_broken_space.cpp.

Definition at line 2223 of file Schur.cpp.

2223  {
2225 
2226  auto apply = [](PC pc, Vec f, Vec x) {
2228  Mat A, P;
2229  CHKERR PCGetOperators(pc, &A, &P);
2230  CHKERR MatSolve(P, f, x);
2232  };
2233 
2234  CHKERR PCSetType(pc, PCSHELL);
2235  CHKERR PCShellSetApply(pc, apply);
2236  CHKERR PCShellSetName(pc, "MoFEMSchurBlockPC");
2237 
2239 }

◆ setSchurBlockMatOps()

static MoFEMErrorCode MoFEM::setSchurBlockMatOps ( Mat  mat_raw)
static

Definition at line 1362 of file Schur.cpp.

1362  {
1364  CHKERR MatShellSetManageScalingShifts(mat_raw);
1365  CHKERR MatShellSetOperation(mat_raw, MATOP_MULT, (void (*)(void))mult);
1366  CHKERR MatShellSetOperation(mat_raw, MATOP_MULT_ADD,
1367  (void (*)(void))mult_add);
1368  CHKERR MatShellSetOperation(mat_raw, MATOP_SOLVE, (void (*)(void))solve);
1369  CHKERR MatShellSetOperation(mat_raw, MATOP_SOLVE_ADD,
1370  (void (*)(void))solve_add);
1371  CHKERR MatShellSetOperation(mat_raw, MATOP_ZERO_ENTRIES,
1372  (void (*)(void))mat_zero);
1373  CHKERR MatShellSetOperation(mat_raw, MATOP_ZERO_ROWS_COLUMNS,
1374  (void (*)(void))zero_rows_columns);
1375 
1377 };

◆ setSchurMatSolvePC()

DEPRECATED MoFEMErrorCode MoFEM::setSchurMatSolvePC ( SmartPetscObj< PC >  pc)

Definition at line 2241 of file Schur.cpp.

2241  {
2242  return setSchurA00MatSolvePC(pc);
2243 }

◆ shell_block_mat_asmb_wrap()

MoFEMErrorCode MoFEM::shell_block_mat_asmb_wrap ( Mat  M,
const EntitiesFieldData::EntData row_data,
const EntitiesFieldData::EntData col_data,
const MatrixDouble mat,
InsertMode  iora 
)

Definition at line 1900 of file Schur.cpp.

1902  {
1904  PetscBool is_mat_shell = PETSC_FALSE;
1905  PetscObjectTypeCompare((PetscObject)M, MATSHELL, &is_mat_shell);
1906  if (is_mat_shell) {
1907  BlockStructure *ctx;
1908  CHKERR MatShellGetContext(M, (void **)&ctx);
1910  ctx, row_data, col_data, mat, iora,
1911  [](const DiagBlockIndex::Indexes *idx) { return idx->getMatShift(); },
1912  ctx->dataBlocksPtr);
1913  } else {
1914  CHKERR MatSetValues<AssemblyTypeSelector<PETSC>>(M, row_data, col_data, mat,
1915  iora);
1916  }
1918 }

◆ shell_block_mat_asmb_wrap_impl()

MoFEMErrorCode MoFEM::shell_block_mat_asmb_wrap_impl ( BlockStructure ctx,
const EntitiesFieldData::EntData row_data,
const EntitiesFieldData::EntData col_data,
const MatrixDouble mat,
InsertMode  iora,
boost::function< int(const DiagBlockIndex::Indexes *)>  shift_extractor,
boost::shared_ptr< std::vector< double >>  data_blocks_ptr 
)
inline

Definition at line 1745 of file Schur.cpp.

1750  {
1751 
1753 
1754  if (row_data.getIndices().empty())
1756  if (col_data.getIndices().empty())
1758 
1759 #ifndef NDEBUG
1760 
1761  PetscLogEventBegin(SchurEvents::MOFEM_EVENT_BlockStructureSetValues, 0, 0, 0,
1762  0);
1763 
1764 #endif // NDEBUG
1765 
1766  switch (iora) {
1767  case ADD_VALUES:
1768  case INSERT_VALUES:
1769  break;
1770  default:
1771  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "Wrong InsertMode");
1772  }
1773 
1774  auto get_row_data = [&]() -> std::pair<bool, VectorInt> {
1775  if (auto e_ptr = row_data.getFieldEntities()[0]) {
1776  if (auto stored_data_ptr =
1777  e_ptr->getSharedStoragePtr<EssentialBcStorage>()) {
1778  MOFEM_LOG("SELF", Sev::warning) << "Can lead to unhandled behaviour";
1779  return std::make_pair(true, stored_data_ptr->entityIndices);
1780  }
1781  }
1782  return std::make_pair(false, row_data.getIndices());
1783  };
1784 
1785  auto row_indices = get_row_data();
1786 
1787  std::vector<int> ent_row_indices;
1788  std::vector<int> ent_col_indices;
1789 
1790  for (auto &rent : row_data.getFieldEntities()) {
1791  if (auto r_cache = rent->entityCacheRowDofs.lock()) {
1792 
1793  auto &row_uid = rent->getLocalUniqueId();
1794  auto &row_ind = row_indices.second;
1795 
1796  for (auto &cent : col_data.getFieldEntities()) {
1797  if (auto c_cache = cent->entityCacheColDofs.lock()) {
1798 
1799  auto &col_uid = cent->getLocalUniqueId();
1800  auto &col_ind = col_data.getIndices();
1801 
1802  auto it = ctx->blockIndex.get<0>().find(
1803 
1804  boost::make_tuple(row_uid, col_uid)
1805 
1806  );
1807 
1808 #ifndef NDEBUG
1809 
1810  if (it == ctx->blockIndex.get<0>().end()) {
1811  MOFEM_LOG_CHANNEL("SELF");
1812  MOFEM_TAG_AND_LOG("SELF", Sev::error, "BlockMat")
1813  << "missing block: row "
1814  << row_data.getFieldDofs()[0]->getName() << " col "
1815  << col_data.getFieldDofs()[0]->getName();
1816  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1817  "Block not allocated");
1818  }
1819 
1820 #endif
1821 
1822  auto ri = row_ind.begin();
1823  auto rie = row_ind.end();
1824 
1825  auto shift = shift_extractor(&*it);
1826  auto s_mat = &(*data_blocks_ptr)[shift];
1827 
1828  auto get_ent_indices = [](auto &cache, auto &ind) {
1829  ind.clear();
1830  ind.reserve(std::distance(cache->loHi[0], cache->loHi[1]));
1831  for (auto e = cache->loHi[0]; e != cache->loHi[1]; ++e) {
1832  auto glob = (*e)->getPetscGlobalDofIdx();
1833  if (glob != -1)
1834  ind.push_back(glob);
1835  }
1836  };
1837 
1838  get_ent_indices(r_cache, ent_row_indices);
1839  if (ent_row_indices.empty())
1840  continue;
1841  get_ent_indices(c_cache, ent_col_indices);
1842  if (ent_col_indices.empty())
1843  continue;
1844 
1845  if (mat.size1() == ent_row_indices.size() &&
1846  mat.size2() == ent_col_indices.size()) {
1847 
1848  if (iora == ADD_VALUES) {
1849  cblas_daxpy(mat.data().size(), 1.0, mat.data().data(), 1, s_mat,
1850  1);
1851  } else {
1852  cblas_dcopy(mat.data().size(), mat.data().data(), 1, s_mat, 1);
1853  }
1854 
1855  } else {
1856 
1857  int row = 0;
1858  for (auto re : ent_row_indices) {
1859  ri = std::find(ri, rie, re);
1860  if (!(ri == rie && *ri != -1)) {
1861 
1862  auto ci = col_ind.begin();
1863  auto cie = col_ind.end();
1864  auto ce = c_cache->loHi[0];
1865 
1866  int col = 0;
1867  for (auto ce : ent_col_indices) {
1868  ci = std::find(ci, cie, ce);
1869  if (!(ci == cie && *ci != -1)) {
1870  auto &m = s_mat[row * ent_col_indices.size() + col];
1871  if (iora == ADD_VALUES) {
1872  m += mat(std::distance(row_ind.begin(), ri),
1873  std::distance(col_ind.begin(), ci));
1874  } else {
1875  m = mat(std::distance(row_ind.begin(), ri),
1876  std::distance(col_ind.begin(), ci));
1877  }
1878  }
1879  ++col;
1880  } // cols
1881  }
1882  ++row;
1883  } // rows
1884  }
1885 
1886  } // iterate entities
1887  }
1888  }
1889  }
1890 
1891 #ifndef NDEBUG
1892  PetscLogEventEnd(SchurEvents::MOFEM_EVENT_BlockStructureSetValues, 0, 0, 0,
1893  0);
1894 #endif // NDEBUG
1895 
1897 }

◆ shell_block_preconditioner_mat_asmb_wrap()

MoFEMErrorCode MoFEM::shell_block_preconditioner_mat_asmb_wrap ( Mat  M,
const EntitiesFieldData::EntData row_data,
const EntitiesFieldData::EntData col_data,
const MatrixDouble mat,
InsertMode  iora 
)

Definition at line 1920 of file Schur.cpp.

1923  {
1925  PetscBool is_mat_shell = PETSC_FALSE;
1926  PetscObjectTypeCompare((PetscObject)M, MATSHELL, &is_mat_shell);
1927  if (is_mat_shell) {
1928  BlockStructure *ctx;
1929  CHKERR MatShellGetContext(M, (void **)&ctx);
1930  if (!ctx->preconditionerBlocksPtr)
1931  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1932  "No preconditionerBlocksPtr");
1934  ctx, row_data, col_data, mat, iora,
1935  [](const DiagBlockIndex::Indexes *idx) { return idx->getMatShift(); },
1936  ctx->preconditionerBlocksPtr);
1937  } else {
1938  CHKERR MatSetValues<AssemblyTypeSelector<PETSC>>(M, row_data, col_data, mat,
1939  iora);
1940  }
1942 }

◆ smartCreateDMMatrix()

DEPRECATED auto MoFEM::smartCreateDMMatrix ( DM  dm)
inline

◆ smartCreateDMVector()

DEPRECATED auto MoFEM::smartCreateDMVector ( DM  dm)
inline

◆ smartGetDMKspCtx()

DEPRECATED auto MoFEM::smartGetDMKspCtx ( DM  dm)
inline
Deprecated:
getDMKspCtx

Definition at line 1121 of file DMMoFEM.hpp.

1121 { return getDMKspCtx(dm); }

◆ smartGetDMSnesCtx()

DEPRECATED auto MoFEM::smartGetDMSnesCtx ( DM  dm)
inline
Deprecated:
use smartGetDMSnesCtx

Definition at line 1135 of file DMMoFEM.hpp.

1135 { return getDMSnesCtx(dm); }

◆ smartGetDMTsCtx()

DEPRECATED auto MoFEM::smartGetDMTsCtx ( DM  dm)
inline
Deprecated:
use getDMTsCtx

Definition at line 1149 of file DMMoFEM.hpp.

1149 { return getDMTsCtx(dm); }

◆ smartMatDuplicate()

DEPRECATED SmartPetscObj<Mat> MoFEM::smartMatDuplicate ( Mat  mat,
MatDuplicateOption  op 
)
inline
Deprecated:
use matDuplicate
Examples
test_jacobian_of_simple_contact_element.cpp.

Definition at line 244 of file PetscSmartObj.hpp.

245  {
246  return matDuplicate(mat, op);
247 }

◆ smartVectorDuplicate()

DEPRECATED SmartPetscObj<Vec> MoFEM::smartVectorDuplicate ( Vec  vec)
inline

◆ SnesMat()

PetscErrorCode MoFEM::SnesMat ( SNES  snes,
Vec  x,
Mat  A,
Mat  B,
void *  ctx 
)

This is MoFEM implementation for the left hand side (tangent matrix) evaluation in SNES solver.

For more information pleas look to PETSc manual, i.e. SNESSetJacobian http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESSetJacobian.html#SNESSetJacobian

Parameters
snesSNES solver
xSolution vector at current iteration
ATangent matrix
BPreconditioner tangent matrix
ctxPointer to context i.e. SnesCtx
Returns
Error code
Examples
minimal_surface_area.cpp, mortar_contact_thermal.cpp, navier_stokes.cpp, nonlinear_dynamics.cpp, simple_contact.cpp, simple_contact_thermal.cpp, test_jacobian_of_simple_contact_element.cpp, testing_jacobian_of_hook_element.cpp, and testing_jacobian_of_hook_scaled_with_density_element.cpp.

Definition at line 139 of file SnesCtx.cpp.

139  {
140  SnesCtx *snes_ctx = (SnesCtx *)ctx;
141  // PetscValidHeaderSpecific(snes,SNES_CLASSID,1);
143  PetscLogEventBegin(snes_ctx->MOFEM_EVENT_SnesMat, 0, 0, 0, 0);
144  if (snes_ctx->zeroPreCondMatrixB)
145  CHKERR MatZeroEntries(B);
146 
147  snes_ctx->matAssembleSwitch = boost::movelib::make_unique<bool>(true);
148  auto cache_ptr = boost::make_shared<CacheTuple>();
149  CHKERR snes_ctx->mField.cache_problem_entities(snes_ctx->problemName,
150  cache_ptr);
151 
152  auto set = [&](auto &fe) {
153  fe.snes = snes;
154  fe.snes_x = x;
155  fe.snes_A = A;
156  fe.snes_B = B;
157  fe.snes_ctx = SnesMethod::CTX_SNESSETJACOBIAN;
158  fe.ksp_ctx = KspMethod::CTX_OPERATORS;
159  fe.data_ctx = PetscData::CtxSetA | PetscData::CtxSetB | PetscData::CtxSetX;
160 
161  CHKERR SNESGetKSP(snes, &fe.ksp);
162 
163  fe.cacheWeakPtr = cache_ptr;
164  };
165 
166  auto unset = [&](auto &fe) {
167  fe.snes_ctx = SnesMethod::CTX_SNESNONE;
168  fe.ksp_ctx = KspMethod::CTX_KSPNONE;
169  fe.data_ctx = PetscData::CtxSetNone;
170  };
171 
172 
173  CHKERR VecGhostUpdateBegin(x, INSERT_VALUES, SCATTER_FORWARD);
174  CHKERR VecGhostUpdateEnd(x, INSERT_VALUES, SCATTER_FORWARD);
175  CHKERR snes_ctx->mField.getInterface<VecManager>()->setLocalGhostVector(
176  snes_ctx->problemName, COL, x, INSERT_VALUES, SCATTER_REVERSE);
177  for (auto &bit : snes_ctx->preProcess_Mat) {
178  bit->matAssembleSwitch = boost::move(snes_ctx->matAssembleSwitch);
179  set(*bit);
180  CHKERR snes_ctx->mField.problem_basic_method_preProcess(
181  snes_ctx->problemName, *bit);
182  unset(*bit);
183  snes_ctx->matAssembleSwitch = boost::move(bit->matAssembleSwitch);
184  }
185 
186 
187 
188  for (auto &lit : snes_ctx->loops_to_do_Mat) {
189  lit.second->matAssembleSwitch = boost::move(snes_ctx->matAssembleSwitch);
190  set(*lit.second);
191  CHKERR snes_ctx->mField.loop_finite_elements(
192  snes_ctx->problemName, lit.first, *(lit.second), nullptr, snes_ctx->bH,
193  cache_ptr);
194  unset(*lit.second);
195  snes_ctx->matAssembleSwitch = boost::move(lit.second->matAssembleSwitch);
196  }
197 
198  for (auto &bit : snes_ctx->postProcess_Mat) {
199  bit->matAssembleSwitch = boost::move(snes_ctx->matAssembleSwitch);
200  set(*bit);
201  CHKERR snes_ctx->mField.problem_basic_method_postProcess(
202  snes_ctx->problemName, *bit);
203  unset(*bit);
204  snes_ctx->matAssembleSwitch = boost::move(bit->matAssembleSwitch);
205  }
206 
207  if (*snes_ctx->matAssembleSwitch) {
208  CHKERR MatAssemblyBegin(B, snes_ctx->typeOfAssembly);
209  CHKERR MatAssemblyEnd(B, snes_ctx->typeOfAssembly);
210  }
211  PetscLogEventEnd(snes_ctx->MOFEM_EVENT_SnesMat, 0, 0, 0, 0);
213 }

◆ SnesMoFEMSetAssemblyType()

MoFEMErrorCode MoFEM::SnesMoFEMSetAssemblyType ( SNES  snes,
MatAssemblyType  type 
)

Set assembly type at the end of SnesMat.

Note
Note that tangent matrix need have to have final assembly, you would use flush assembly in special case that you call SnesMat form other function set to SNESSetJacobian
Parameters
snes
typetype of assembly, either MAT_FLUSH_ASSEMBLY or MAT_FINAL_ASSEMBLY
Returns
error code

Definition at line 215 of file SnesCtx.cpp.

215  {
216  SnesCtx *snes_ctx;
217  // PetscValidHeaderSpecific(snes,SNES_CLASSID,1);
219  CHKERR SNESGetApplicationContext(snes, &snes_ctx);
220  snes_ctx->typeOfAssembly = type;
222 }

◆ SnesMoFEMSetBehavior()

MoFEMErrorCode MoFEM::SnesMoFEMSetBehavior ( SNES  snes,
MoFEMTypes  bh 
)

Set behavior if finite element in sequence does not exist.

Parameters
snes
bhIf set to MF_EXIST check if element exist, default MF_EXIST. Otherwise set MF_ZERO
Returns
error code

Definition at line 224 of file SnesCtx.cpp.

224  {
225  SnesCtx *snes_ctx;
227  CHKERR SNESGetApplicationContext(snes, &snes_ctx);
228  snes_ctx->bH = bh;
230 }

◆ SnesRhs()

PetscErrorCode MoFEM::SnesRhs ( SNES  snes,
Vec  x,
Vec  f,
void *  ctx 
)

This is MoFEM implementation for the right hand side (residual vector) evaluation in SNES solver.

For more information pleas look to PETSc manual, i.e. SNESSetFunction http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESSetFunction.html

Parameters
snesSNES solver
xSolution vector at current iteration
fThe right hand side vector
ctxPointer to context i.e. SnesCtx
Returns
Error code
Examples
minimal_surface_area.cpp, mortar_contact_thermal.cpp, navier_stokes.cpp, nonlinear_dynamics.cpp, simple_contact.cpp, simple_contact_thermal.cpp, test_jacobian_of_simple_contact_element.cpp, testing_jacobian_of_hook_element.cpp, and testing_jacobian_of_hook_scaled_with_density_element.cpp.

Definition at line 27 of file SnesCtx.cpp.

27  {
28  SnesCtx *snes_ctx = (SnesCtx *)ctx;
29  // PetscValidHeaderSpecific(snes,SNES_CLASSID,1);
31  PetscLogEventBegin(snes_ctx->MOFEM_EVENT_SnesRhs, 0, 0, 0, 0);
32  CHKERR VecGhostUpdateBegin(x, INSERT_VALUES, SCATTER_FORWARD);
33  CHKERR VecGhostUpdateEnd(x, INSERT_VALUES, SCATTER_FORWARD);
34  if (snes_ctx->vErify) {
35  // Verify finite elements, check for not a number
36  CHKERR VecAssemblyBegin(f);
37  CHKERR VecAssemblyEnd(f);
38  MPI_Comm comm = PetscObjectComm((PetscObject)f);
39  PetscSynchronizedPrintf(comm, "SNES Verify x\n");
40  const Problem *prb_ptr;
41  CHKERR snes_ctx->mField.get_problem(snes_ctx->problemName, &prb_ptr);
42  CHKERR snes_ctx->mField.getInterface<Tools>()->checkVectorForNotANumber(
43  prb_ptr, COL, x);
44  }
45  CHKERR snes_ctx->mField.getInterface<VecManager>()->setLocalGhostVector(
46  snes_ctx->problemName, COL, x, INSERT_VALUES, SCATTER_REVERSE);
47 
48  auto zero_ghost_vec = [](Vec g) {
50  Vec l;
51  CHKERR VecGhostGetLocalForm(g, &l);
52  double *a;
53  CHKERR VecGetArray(l, &a);
54  int s;
55  CHKERR VecGetLocalSize(l, &s);
56  for (int i = 0; i != s; ++i)
57  a[i] = 0;
58  CHKERR VecRestoreArray(l, &a);
59  CHKERR VecGhostRestoreLocalForm(g, &l);
61  };
62  CHKERR zero_ghost_vec(f);
63 
64  snes_ctx->vecAssembleSwitch = boost::movelib::make_unique<bool>(true);
65  auto cache_ptr = boost::make_shared<CacheTuple>();
66  CHKERR snes_ctx->mField.cache_problem_entities(snes_ctx->problemName,
67  cache_ptr);
68 
69  auto set = [&](auto &fe) {
70  fe.snes = snes;
71  fe.snes_x = x;
72  fe.snes_f = f;
73  fe.snes_ctx = SnesMethod::CTX_SNESSETFUNCTION;
74  fe.ksp_ctx = KspMethod::CTX_SETFUNCTION;
75  fe.data_ctx = PetscData::CtxSetF | PetscData::CtxSetX;
76 
77  CHKERR SNESGetKSP(snes, &fe.ksp);
78 
79  fe.cacheWeakPtr = cache_ptr;
80  };
81 
82  auto unset = [&](auto &fe) {
83  fe.snes_ctx = SnesMethod::CTX_SNESNONE;
84  fe.ksp_ctx = KspMethod::CTX_KSPNONE;
85  fe.data_ctx = PetscData::CtxSetNone;
86  };
87 
88  for (auto &bit : snes_ctx->preProcess_Rhs) {
89  bit->vecAssembleSwitch = boost::move(snes_ctx->vecAssembleSwitch);
90  set(*bit);
91  CHKERR snes_ctx->mField.problem_basic_method_preProcess(
92  snes_ctx->problemName, *bit);
93  unset(*bit);
94  snes_ctx->vecAssembleSwitch = boost::move(bit->vecAssembleSwitch);
95  }
96 
97  for (auto &lit : snes_ctx->loops_to_do_Rhs) {
98  lit.second->vecAssembleSwitch = boost::move(snes_ctx->vecAssembleSwitch);
99  set(*lit.second);
100  CHKERR snes_ctx->mField.loop_finite_elements(
101  snes_ctx->problemName, lit.first, *lit.second, nullptr, snes_ctx->bH,
102  cache_ptr);
103  unset(*lit.second);
104  if (snes_ctx->vErify) {
105  // Verify finite elements, check for not a number
106  CHKERR VecAssemblyBegin(f);
107  CHKERR VecAssemblyEnd(f);
108  MPI_Comm comm = PetscObjectComm((PetscObject)f);
109  PetscSynchronizedPrintf(comm, "SNES Verify f FE < %s >\n",
110  lit.first.c_str());
111  const Problem *prb_ptr;
112  CHKERR snes_ctx->mField.get_problem(snes_ctx->problemName, &prb_ptr);
113  CHKERR snes_ctx->mField.getInterface<Tools>()->checkVectorForNotANumber(
114  prb_ptr, ROW, f);
115  }
116 
117  snes_ctx->vecAssembleSwitch = boost::move(lit.second->vecAssembleSwitch);
118  }
119 
120  for (auto &bit : snes_ctx->postProcess_Rhs) {
121  bit->vecAssembleSwitch = boost::move(snes_ctx->vecAssembleSwitch);
122  set(*bit);
123  CHKERR snes_ctx->mField.problem_basic_method_postProcess(
124  snes_ctx->problemName, *bit);
125  unset(*bit);
126  snes_ctx->vecAssembleSwitch = boost::move(bit->vecAssembleSwitch);
127  }
128 
129  if (*(snes_ctx->vecAssembleSwitch)) {
130  CHKERR VecGhostUpdateBegin(f, ADD_VALUES, SCATTER_REVERSE);
131  CHKERR VecGhostUpdateEnd(f, ADD_VALUES, SCATTER_REVERSE);
132  CHKERR VecAssemblyBegin(f);
133  CHKERR VecAssemblyEnd(f);
134  }
135  PetscLogEventEnd(snes_ctx->MOFEM_EVENT_SnesRhs, 0, 0, 0, 0);
137 }

◆ solve()

static PetscErrorCode MoFEM::solve ( Mat  mat,
Vec  x,
Vec  y 
)
static
Examples
free_surface.cpp, and mesh_smoothing.cpp.

Definition at line 1223 of file Schur.cpp.

1223  {
1224  return solve_schur_block_shell(mat, x, y, INSERT_VALUES);
1225 }

◆ solve_add()

static PetscErrorCode MoFEM::solve_add ( Mat  mat,
Vec  x,
Vec  y 
)
static

Definition at line 1226 of file Schur.cpp.

1226  {
1227  return solve_schur_block_shell(mat, x, y, ADD_VALUES);
1228 }

◆ solve_schur_block_shell()

static MoFEMErrorCode MoFEM::solve_schur_block_shell ( Mat  mat,
Vec  y,
Vec  x,
InsertMode  iora 
)
static

Definition at line 1599 of file Schur.cpp.

1600  {
1601  using matrix_range = ublas::matrix_range<MatrixDouble>;
1602  using range = ublas::range;
1604  BlockStructure *ctx;
1605  CHKERR MatShellGetContext(mat, (void **)&ctx);
1606 
1607  PetscLogEventBegin(SchurEvents::MOFEM_EVENT_BlockStructureSolve, 0, 0, 0, 0);
1608 
1609  if (ctx->multiplyByPreconditioner) {
1610  if (!ctx->preconditionerBlocksPtr)
1611  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1612  "No preconditionerBlocksPtr");
1613  }
1614 
1615  if (iora == INSERT_VALUES) {
1616  CHKERR VecZeroEntries(x);
1617  }
1618 
1619  double *x_array;
1620  CHKERR VecGetArray(x, &x_array);
1621  double *y_array;
1622  CHKERR VecGetArray(y, &y_array);
1623 
1624  std::vector<const DiagBlockIndex::Indexes *> blocks;
1626  VectorDouble block_y;
1627  VectorInt ipiv;
1628 
1629  auto &block_index = ctx->blockIndex.get<1>();
1630  for (auto it = block_index.begin(); it != block_index.end();) {
1631 
1632  // get blocks on finit element
1633  blocks.clear();
1634  auto last_uid = it->getFEUId();
1635  while (it != block_index.end() && it->getFEUId() == last_uid) {
1636  blocks.push_back(&*it);
1637  ++it;
1638  }
1639 
1640  // set local indices
1641  std::map<UId, std::tuple<int, int, int>> block_indexing; // uid block map
1642  for (auto b : blocks) {
1643  if (block_indexing.find(b->getRowUId()) == block_indexing.end()) {
1644  block_indexing[b->getRowUId()] =
1645  std::make_tuple(b->getNbRows(), b->getNbRows(), b->getLocRow());
1646  }
1647  }
1648  std::sort(blocks.begin(), blocks.end(), [](auto a, auto b) {
1649  if (a->getRowUId() == b->getRowUId())
1650  return a->getColUId() < b->getColUId();
1651  else
1652  return a->getRowUId() < b->getRowUId();
1653  });
1654 
1655  // set indexes to block
1656  int mat_block_size = 0; // size of block matrix
1657  for (auto &b : block_indexing) {
1658  auto &[index, size, loc] = b.second;
1659  index = mat_block_size;
1660  mat_block_size += size;
1661  }
1662 
1663  auto get_range = [](auto &b) {
1664  auto [index, size, loc] = b;
1665  return range(index, index + size);
1666  };
1667 
1668  std::vector<std::tuple<int, int, int, int, int>> block_data;
1669  block_data.reserve(blocks.size());
1670  for (auto s : blocks) {
1671  auto ruid = s->getRowUId();
1672  auto cuid = s->getColUId();
1673  auto &rbi = block_indexing.at(ruid);
1674  auto &cbi = block_indexing.at(cuid);
1675  if (auto shift = s->getMatShift(); shift != -1) {
1676  block_data.push_back(std::make_tuple(
1677 
1678  shift,
1679 
1680  s->getNbRows(), s->getNbCols(),
1681 
1682  get<0>(rbi), get<0>(cbi))
1683 
1684  );
1685  }
1686  }
1687  block_mat.resize(mat_block_size, mat_block_size, false);
1688  block_mat.clear();
1689  for (auto &bd : block_data) {
1690  auto &[shift, nb_rows, nb_cols, ridx, cidx] = bd;
1691  auto ptr = &(*(ctx->dataBlocksPtr))[shift];
1692  for (auto i = 0; i != nb_rows; ++i, ptr += nb_cols) {
1693  auto sub_ptr = &block_mat(ridx + i, cidx);
1694  cblas_dcopy(nb_cols, ptr, 1, sub_ptr, 1);
1695  }
1696  }
1697  if (ctx->multiplyByPreconditioner) {
1698  for (auto &bd : block_data) {
1699  auto &[shift, nb_rows, nb_cols, ridx, cidx] = bd;
1700  auto ptr = &(*(ctx->preconditionerBlocksPtr))[shift];
1701  for (auto i = 0; i != nb_rows; ++i, ptr += nb_cols) {
1702  auto sub_ptr = &block_mat(ridx + i, cidx);
1703  cblas_daxpy(nb_cols, 1., ptr, 1, sub_ptr, 1);
1704  }
1705  }
1706  }
1707  block_mat = trans(block_mat);
1708 
1709  block_y.resize(mat_block_size, false);
1710  block_y.clear();
1711 
1712  for (auto &b : block_indexing) {
1713  auto [index, size, loc] = b.second;
1714  auto ptr = &y_array[loc];
1715  cblas_dcopy(size, ptr, 1, &block_y[index], 1);
1716  }
1717 
1718  // note: this not exploits symmetry, requires more implementation
1719  constexpr int nrhs = 1;
1720  ipiv.resize(mat_block_size, false);
1721  auto info = lapack_dgesv(mat_block_size, nrhs, &*block_mat.data().begin(),
1722  mat_block_size, &*ipiv.data().begin(),
1723  &*block_y.data().begin(), mat_block_size);
1724  if (info != 0) {
1725  SETERRQ1(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
1726  "error lapack solve dgesv info = %d", info);
1727  }
1728 
1729  for (auto &b : block_indexing) {
1730  auto [index, size, loc] = b.second;
1731  auto ptr = &x_array[loc];
1732  cblas_daxpy(size, 1.0, &block_y[index], 1, ptr, 1);
1733  }
1734  }
1735 
1736  CHKERR VecRestoreArray(x, &x_array);
1737  CHKERR VecRestoreArray(y, &y_array);
1738 
1739  // PetscLogFlops(xxx)
1740  PetscLogEventEnd(SchurEvents::MOFEM_EVENT_BlockStructureSolve, 0, 0, 0, 0);
1741 
1743 }

◆ solveLinearSystem() [1/2]

MoFEMErrorCode MoFEM::solveLinearSystem ( const MatrixDouble mat,
VectorDouble f 
)
inline

Solve linear system of equations using Lapack.

Parameters
mat
f
Returns
MoFEMErrorCode

Definition at line 1435 of file Templates.hpp.

1436  {
1438  // copy matrix since on output lapack returns factorisation
1439  auto mat_copy = mat;
1440  CHKERR solveLinearSystem(mat_copy, f);
1442 }

◆ solveLinearSystem() [2/2]

MoFEMErrorCode MoFEM::solveLinearSystem ( MatrixDouble mat,
VectorDouble f 
)
inline

solve linear system with lapack dgesv

Parameters
matinput lhs square matrix / output L and U from the factorization
finput rhs vector / output solution vector
Returns
MoFEMErrorCode

Definition at line 1401 of file Templates.hpp.

1401  {
1403 
1404  const size_t M = mat.size1();
1405  const size_t N = mat.size2();
1406 
1407  if (M == 0 || M != N)
1408  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1409  "The input matrix for inverse computation is not square %d != %d",
1410  M, N);
1411  if (f.size() != M)
1412  f.resize(M, false);
1413 
1414  const int nrhs = 1;
1415  int info;
1416  int *ipiv = new int[M];
1417  info = lapack_dgesv(M, nrhs, &*mat.data().begin(), M, ipiv,
1418  &*f.data().begin(), M);
1419  if (info != 0) {
1420  SETERRQ1(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
1421  "error lapack solve dgesv info = %d", info);
1422  }
1423 
1424  delete[] ipiv;
1426 }

◆ sub_mat_mult()

MoFEMErrorCode MoFEM::sub_mat_mult ( Mat  a,
Vec  x,
Vec  f 
)

Definition at line 160 of file PCMGSetUpViaApproxOrders.cpp.

160  {
161  return sub_mat_mult_generic<INSERT_VALUES>(a, x, f);
162 }

◆ sub_mat_mult_add()

MoFEMErrorCode MoFEM::sub_mat_mult_add ( Mat  a,
Vec  x,
Vec  f 
)

Definition at line 164 of file PCMGSetUpViaApproxOrders.cpp.

164  {
165  return sub_mat_mult_generic<ADD_VALUES>(a, x, f);
166 }

◆ sub_mat_mult_generic()

template<InsertMode MODE>
MoFEMErrorCode MoFEM::sub_mat_mult_generic ( Mat  a,
Vec  x,
Vec  f 
)

Definition at line 144 of file PCMGSetUpViaApproxOrders.cpp.

144  {
145  void *void_ctx;
147  CHKERR MatShellGetContext(a, &void_ctx);
148  PCMGSubMatrixCtx *ctx = (PCMGSubMatrixCtx *)void_ctx;
149  PetscLogEventBegin(ctx->MOFEM_EVENT_mult, 0, 0, 0, 0);
150  CHKERR ctx->initData(x);
151  CHKERR VecScatterBegin(ctx->sCat, x, ctx->X, INSERT_VALUES, SCATTER_REVERSE);
152  CHKERR VecScatterEnd(ctx->sCat, x, ctx->X, INSERT_VALUES, SCATTER_REVERSE);
153  CHKERR MatMult(ctx->A, ctx->X, ctx->F);
154  CHKERR VecScatterBegin(ctx->sCat, ctx->F, f, MODE, SCATTER_FORWARD);
155  CHKERR VecScatterEnd(ctx->sCat, ctx->F, f, MODE, SCATTER_FORWARD);
156  PetscLogEventEnd(ctx->MOFEM_EVENT_mult, 0, 0, 0, 0);
158 }

◆ sub_mat_sor()

MoFEMErrorCode MoFEM::sub_mat_sor ( Mat  mat,
Vec  b,
PetscReal  omega,
MatSORType  flag,
PetscReal  shift,
PetscInt  its,
PetscInt  lits,
Vec  x 
)

Definition at line 168 of file PCMGSetUpViaApproxOrders.cpp.

170  {
171 
172  //FIXME: that is crap implementation of SOR
173 
174  void *void_ctx;
176  CHKERR MatShellGetContext(mat, &void_ctx);
177  PCMGSubMatrixCtx *ctx = (PCMGSubMatrixCtx *)void_ctx;
178  PetscLogEventBegin(ctx->MOFEM_EVENT_sor, 0, 0, 0, 0);
179  CHKERR ctx->initData(x);
180  CHKERR VecScatterBegin(ctx->sCat, b, ctx->X, INSERT_VALUES, SCATTER_REVERSE);
181  CHKERR VecScatterEnd(ctx->sCat, b, ctx->X, INSERT_VALUES, SCATTER_REVERSE);
182  CHKERR MatSOR(ctx->A, ctx->X, omega, flag, shift, its, lits, ctx->F);
183  CHKERR VecScatterBegin(ctx->sCat, ctx->F, x, INSERT_VALUES, SCATTER_FORWARD);
184  CHKERR VecScatterEnd(ctx->sCat, ctx->F, x, INSERT_VALUES, SCATTER_FORWARD);
185  PetscLogEventEnd(ctx->MOFEM_EVENT_sor, 0, 0, 0, 0);
187 }

◆ tet_type_1()

void MoFEM::tet_type_1 ( const EntityHandle conn,
const int  split_edge,
const EntityHandle  edge_new_node,
EntityHandle new_tets_conn 
)

Definition at line 1096 of file EntityRefine.cpp.

1097  {
1098  // TET0
1099  new_tets_conn[0 * 4 + 0] = edge_new_node;
1100  new_tets_conn[0 * 4 + 1] = conn[edges_conn[2 * split_edge + 0]];
1101  new_tets_conn[0 * 4 + 2] = conn[edges_conn[2 * oposite_edge[split_edge] + 1]];
1102  new_tets_conn[0 * 4 + 3] = conn[edges_conn[2 * oposite_edge[split_edge] + 0]];
1103  // TET1
1104  new_tets_conn[1 * 4 + 0] = edge_new_node;
1105  new_tets_conn[1 * 4 + 1] = conn[edges_conn[2 * split_edge + 1]];
1106  new_tets_conn[1 * 4 + 2] = conn[edges_conn[2 * oposite_edge[split_edge] + 0]];
1107  new_tets_conn[1 * 4 + 3] = conn[edges_conn[2 * oposite_edge[split_edge] + 1]];
1108 }

◆ tet_type_2()

int MoFEM::tet_type_2 ( const EntityHandle conn,
const int *  split_edges,
const EntityHandle edge_new_nodes,
EntityHandle new_tets_conn 
)

Definition at line 988 of file EntityRefine.cpp.

990  {
991  if (split_edges[0] == oposite_edge[split_edges[1]]) {
992  // type 2b
993  EntityHandle n0 = conn[edges_conn[2 * split_edges[0] + 0]];
994  EntityHandle n1 = conn[edges_conn[2 * split_edges[0] + 1]];
995  EntityHandle n2 = conn[edges_conn[2 * split_edges[1] + 0]];
996  EntityHandle n3 = conn[edges_conn[2 * split_edges[1] + 1]];
997  // TET0
998  new_tets_conn[0 * 4 + 0] = edge_new_nodes[split_edges[0]];
999  new_tets_conn[0 * 4 + 1] = edge_new_nodes[split_edges[1]];
1000  new_tets_conn[0 * 4 + 2] = n2;
1001  new_tets_conn[0 * 4 + 3] = n0;
1002  // TET1
1003  new_tets_conn[1 * 4 + 0] = edge_new_nodes[split_edges[0]];
1004  new_tets_conn[1 * 4 + 1] = edge_new_nodes[split_edges[1]];
1005  new_tets_conn[1 * 4 + 2] = n1;
1006  new_tets_conn[1 * 4 + 3] = n2;
1007  // TET3
1008  new_tets_conn[2 * 4 + 0] = edge_new_nodes[split_edges[0]];
1009  new_tets_conn[2 * 4 + 1] = edge_new_nodes[split_edges[1]];
1010  new_tets_conn[2 * 4 + 2] = n0;
1011  new_tets_conn[2 * 4 + 3] = n3;
1012  // TET4
1013  new_tets_conn[3 * 4 + 0] = edge_new_nodes[split_edges[0]];
1014  new_tets_conn[3 * 4 + 1] = edge_new_nodes[split_edges[1]];
1015  new_tets_conn[3 * 4 + 2] = n3;
1016  new_tets_conn[3 * 4 + 3] = n1;
1017  return 1;
1018  } else {
1019  int sub_type = 0;
1020  // type 2a
1021  const char mach_pattern =
1022  edge_bits_mark[split_edges[0]] | edge_bits_mark[split_edges[1]];
1024  int edges_[6];
1025  for (int ee = 0; ee < 6; ee++) {
1026  char pattern;
1027  pattern = edge_bits_mark[edge_permutations[ee][1]] |
1029  if (pattern == mach_pattern) {
1030  int free_edge = oposite_edge[ee];
1031  conn_[0] = conn[edges_conn[ee * 2 + 0]];
1032  conn_[1] = conn[edges_conn[ee * 2 + 1]];
1033  conn_[2] = conn[edges_conn[free_edge * 2 + 0]];
1034  conn_[3] = conn[edges_conn[free_edge * 2 + 1]];
1035  for (int EE = 0; EE < 6; EE++)
1036  edges_[EE] = edge_permutations[ee][EE];
1037  sub_type |= 4;
1038  break;
1039  }
1042  if (pattern == mach_pattern) {
1043  int free_edge = oposite_edge[ee];
1044  conn_[0] = conn[edges_conn[ee * 2 + 1]];
1045  conn_[1] = conn[edges_conn[ee * 2 + 0]];
1046  conn_[2] = conn[edges_conn[free_edge * 2 + 1]];
1047  conn_[3] = conn[edges_conn[free_edge * 2 + 0]];
1048  for (int EE = 0; EE < 6; EE++)
1049  edges_[EE] = edge_permutations[ee][edge_mirror_cross[EE]];
1050  sub_type |= 8;
1051  break;
1052  }
1053  }
1054  EntityHandle edge_new_nodes_[6];
1055  for (int ee = 0; ee < 6; ee++)
1056  edge_new_nodes_[ee] = edge_new_nodes[edges_[ee]];
1057  assert(edge_new_nodes_[1] != no_handle);
1058  assert(edge_new_nodes_[4] != no_handle);
1059  // TET0
1060  new_tets_conn[0 * 4 + 0] = conn_[1];
1061  new_tets_conn[0 * 4 + 1] = edge_new_nodes_[4];
1062  new_tets_conn[0 * 4 + 2] = edge_new_nodes_[1];
1063  new_tets_conn[0 * 4 + 3] = conn_[0];
1064  bool free_edge_swappped5 = false;
1065  if (conn_[3] < conn_[2]) {
1066  free_edge_swappped5 = true;
1067  sub_type |= 16;
1068  }
1069  if (free_edge_swappped5) {
1070  // TET1
1071  new_tets_conn[1 * 4 + 0] = edge_new_nodes_[1];
1072  new_tets_conn[1 * 4 + 1] = conn_[2];
1073  new_tets_conn[1 * 4 + 2] = conn_[0];
1074  new_tets_conn[1 * 4 + 3] = conn_[3];
1075  // TET2
1076  new_tets_conn[2 * 4 + 0] = edge_new_nodes_[1];
1077  new_tets_conn[2 * 4 + 1] = edge_new_nodes_[4];
1078  new_tets_conn[2 * 4 + 2] = conn_[3];
1079  new_tets_conn[2 * 4 + 3] = conn_[0];
1080  return sub_type;
1081  }
1082  // TET1
1083  new_tets_conn[1 * 4 + 0] = edge_new_nodes_[4];
1084  new_tets_conn[1 * 4 + 1] = conn_[2];
1085  new_tets_conn[1 * 4 + 2] = conn_[0];
1086  new_tets_conn[1 * 4 + 3] = conn_[3];
1087  // TET2
1088  new_tets_conn[2 * 4 + 0] = edge_new_nodes_[1];
1089  new_tets_conn[2 * 4 + 1] = edge_new_nodes_[4];
1090  new_tets_conn[2 * 4 + 2] = conn_[2];
1091  new_tets_conn[2 * 4 + 3] = conn_[0];
1092  return sub_type;
1093  }
1094  return -1;
1095 }

◆ tet_type_3()

int MoFEM::tet_type_3 ( const EntityHandle conn,
const int *  split_edges,
const EntityHandle edge_new_nodes,
EntityHandle new_tets_conn 
)

Definition at line 565 of file EntityRefine.cpp.

567  {
568  char mach_pattern = 0;
569  for (int ee = 0; ee < 3; ee++)
570  mach_pattern |= edge_bits_mark[split_edges[ee]];
571  EntityHandle conn_[4];
572  int edges_[6];
573  int type = -1;
574  bool is_rotated = false;
575  for (int ee = 0; ee < 6; ee++) {
576  char pattern0, pattern1, pattern2;
577  pattern0 = edge_bits_mark[edge_permutations[ee][0]] |
580  pattern1 = edge_bits_mark[edge_permutations[ee][1]] |
583  pattern2 = edge_bits_mark[edge_permutations[ee][4]] |
586  if (pattern0 == mach_pattern || pattern1 == mach_pattern ||
587  pattern2 == mach_pattern) {
588  // printf("nothing\n");
589  int free_edge = oposite_edge[ee];
590  conn_[0] = conn[edges_conn[ee * 2 + 0]];
591  conn_[1] = conn[edges_conn[ee * 2 + 1]];
592  conn_[2] = conn[edges_conn[free_edge * 2 + 0]];
593  conn_[3] = conn[edges_conn[free_edge * 2 + 1]];
594  for (int EE = 0; EE < 6; EE++)
595  edges_[EE] = edge_permutations[ee][EE];
596  if (pattern0 == mach_pattern) {
597  // printf("nothing\n");
598  type = 0;
599  } else if (pattern1 == mach_pattern)
600  type = 1;
601  else if (pattern2 == mach_pattern)
602  type = 2;
603  break;
604  }
614  if (pattern0 == mach_pattern || pattern1 == mach_pattern ||
615  pattern2 == mach_pattern) {
616  // printf("edge_mirror_cross\n");
617  int free_edge = oposite_edge[ee];
618  conn_[0] = conn[edges_conn[ee * 2 + 1]];
619  conn_[1] = conn[edges_conn[ee * 2 + 0]];
620  conn_[2] = conn[edges_conn[free_edge * 2 + 1]];
621  conn_[3] = conn[edges_conn[free_edge * 2 + 0]];
622  for (int EE = 0; EE < 6; EE++)
623  edges_[EE] = edge_permutations[ee][edge_mirror_cross[EE]];
624  if (pattern0 == mach_pattern) {
625  // printf("edge_mirror_cross\n");
626  type = 0;
627  } else if (pattern1 == mach_pattern)
628  type = 1;
629  else if (pattern2 == mach_pattern)
630  type = 2;
631  break;
632  }
636  if (pattern2 == mach_pattern) {
637  is_rotated = true;
638  // printf("edge_mirror_vertical\n");
639  int free_edge = oposite_edge[ee];
640  conn_[0] = conn[edges_conn[ee * 2 + 0]];
641  conn_[1] = conn[edges_conn[ee * 2 + 1]];
642  conn_[2] = conn[edges_conn[free_edge * 2 + 1]];
643  conn_[3] = conn[edges_conn[free_edge * 2 + 0]];
644  for (int EE = 0; EE < 6; EE++)
645  edges_[EE] = edge_permutations[ee][edge_mirror_vertical[EE]];
646  if (pattern0 == mach_pattern) {
647  // printf("edge_mirror_vertical\n");
648  type = 0;
649  } else if (pattern1 == mach_pattern)
650  type = 1;
651  else if (pattern2 == mach_pattern)
652  type = 2;
653  break;
654  }
655  pattern2 =
662  if (pattern2 == mach_pattern) {
663  is_rotated = true;
664  int free_edge = oposite_edge[ee];
665  conn_[0] = conn[edges_conn[ee * 2 + 1]];
666  conn_[1] = conn[edges_conn[ee * 2 + 0]];
667  conn_[2] = conn[edges_conn[free_edge * 2 + 0]];
668  conn_[3] = conn[edges_conn[free_edge * 2 + 1]];
669  for (int EE = 0; EE < 6; EE++)
670  edges_[EE] =
672  if (pattern0 == mach_pattern) {
673  // printf("edge_mirror_cross|edge_mirror_vertical\n");
674  type = 0;
675  } else if (pattern1 == mach_pattern)
676  type = 1;
677  else if (pattern2 == mach_pattern)
678  type = 2;
679  break;
680  }
681  }
682  assert(type != -1);
683  EntityHandle edge_new_nodes_[6];
684  for (int ee = 0; ee < 6; ee++)
685  edge_new_nodes_[ee] = edge_new_nodes[edges_[ee]];
686  if (type == 0) {
687  EntityHandle conn__[4];
688  EntityHandle edge_new_nodes__[6];
689  bcopy(conn_, conn__, 4 * sizeof(EntityHandle));
690  bcopy(edge_new_nodes_, edge_new_nodes__, 6 * sizeof(EntityHandle));
691  for (int rotate_idx = 0; rotate_idx < 3; rotate_idx++) {
692  // fprintf(stderr,"%d\n",rotate_idx);
693  for (int ii = 0; ii < 4; ii++)
694  conn_[ii] = conn__[cyclic_node_rotate_face_3[rotate_idx][ii]];
695  for (int ee = 0; ee < 6; ee++)
696  edge_new_nodes_[ee] =
697  edge_new_nodes__[cyclic_edge_rotate_face_3[rotate_idx][ee]];
698  if ((conn_[0] > conn_[2]) && (conn_[0] > conn_[3]))
699  break;
700  }
701  assert(conn_[0] > conn_[2]);
702  assert(conn_[0] > conn_[3]);
703  assert(edge_new_nodes_[0] != no_handle);
704  assert(edge_new_nodes_[1] != no_handle);
705  assert(edge_new_nodes_[4] != no_handle);
706  // TET0
707  new_tets_conn[0 * 4 + 0] = edge_new_nodes_[0];
708  new_tets_conn[0 * 4 + 1] = edge_new_nodes_[1];
709  new_tets_conn[0 * 4 + 2] = edge_new_nodes_[4];
710  new_tets_conn[0 * 4 + 3] = conn_[1];
711  bool free_edge_swappped5 = false;
712  if (conn_[3] < conn_[2]) {
713  free_edge_swappped5 = true;
714  }
715  if (free_edge_swappped5) {
716  // TET1
717  new_tets_conn[1 * 4 + 0] = edge_new_nodes_[1];
718  new_tets_conn[1 * 4 + 1] = edge_new_nodes_[0];
719  new_tets_conn[1 * 4 + 2] = edge_new_nodes_[4];
720  new_tets_conn[1 * 4 + 3] = conn_[3];
721  // TET2
722  new_tets_conn[2 * 4 + 0] = edge_new_nodes_[0];
723  new_tets_conn[2 * 4 + 1] = edge_new_nodes_[1];
724  new_tets_conn[2 * 4 + 2] = conn_[2];
725  new_tets_conn[2 * 4 + 3] = conn_[3];
726  // TET3
727  new_tets_conn[3 * 4 + 0] = edge_new_nodes_[0];
728  new_tets_conn[3 * 4 + 1] = conn_[0];
729  new_tets_conn[3 * 4 + 2] = conn_[3];
730  new_tets_conn[3 * 4 + 3] = conn_[2];
731  // printf("free_edge_swappped5\n");
732  return 4;
733  }
734  assert(conn_[3] > conn_[2]);
735  // TET1
736  new_tets_conn[1 * 4 + 0] = edge_new_nodes_[1];
737  new_tets_conn[1 * 4 + 1] = edge_new_nodes_[0];
738  new_tets_conn[1 * 4 + 2] = edge_new_nodes_[4];
739  new_tets_conn[1 * 4 + 3] = conn_[2];
740  // TET2
741  new_tets_conn[2 * 4 + 0] = edge_new_nodes_[0];
742  new_tets_conn[2 * 4 + 1] = edge_new_nodes_[4];
743  new_tets_conn[2 * 4 + 2] = conn_[2];
744  new_tets_conn[2 * 4 + 3] = conn_[3];
745  // TET3
746  new_tets_conn[3 * 4 + 0] = edge_new_nodes_[0];
747  new_tets_conn[3 * 4 + 1] = conn_[0];
748  new_tets_conn[3 * 4 + 2] = conn_[3];
749  new_tets_conn[3 * 4 + 3] = conn_[2];
750  // printf("no free_edge_swappped5\n");
751  } else if (type == 1) {
752  assert(edge_new_nodes_[1] != no_handle);
753  assert(edge_new_nodes_[4] != no_handle);
754  assert(edge_new_nodes_[5] != no_handle);
755  // TET0
756  new_tets_conn[0 * 4 + 0] = edge_new_nodes_[1];
757  new_tets_conn[0 * 4 + 1] = edge_new_nodes_[4];
758  new_tets_conn[0 * 4 + 2] = edge_new_nodes_[5];
759  new_tets_conn[0 * 4 + 3] = conn_[0];
760  // TET1
761  new_tets_conn[1 * 4 + 0] = edge_new_nodes_[4];
762  new_tets_conn[1 * 4 + 1] = edge_new_nodes_[5];
763  new_tets_conn[1 * 4 + 2] = conn_[0];
764  new_tets_conn[1 * 4 + 3] = conn_[3];
765  // TET2
766  new_tets_conn[2 * 4 + 0] = edge_new_nodes_[1];
767  new_tets_conn[2 * 4 + 1] = edge_new_nodes_[5];
768  new_tets_conn[2 * 4 + 2] = conn_[2];
769  new_tets_conn[2 * 4 + 3] = conn_[0];
770  // TET3
771  new_tets_conn[3 * 4 + 0] = edge_new_nodes_[4];
772  new_tets_conn[3 * 4 + 1] = edge_new_nodes_[1];
773  new_tets_conn[3 * 4 + 2] = conn_[1];
774  new_tets_conn[3 * 4 + 3] = conn_[0];
775  } else if (type == 2) {
776  assert(edge_new_nodes_[1] != no_handle);
777  assert(edge_new_nodes_[4] != no_handle);
778  assert(edge_new_nodes_[2] != no_handle);
779  bool free_edge_swappped5 = false;
780  if (conn_[3] < conn_[2]) {
781  free_edge_swappped5 = true;
782  }
783  bool free_edge_swappped0 = false;
784  if (conn_[0] > conn_[1]) {
785  free_edge_swappped0 = true;
786  }
787  if (free_edge_swappped5 && (!free_edge_swappped0)) {
788  // TET0
789  new_tets_conn[0 * 4 + 0] = edge_new_nodes_[4];
790  new_tets_conn[0 * 4 + 1] = edge_new_nodes_[1];
791  if (is_rotated) {
792  new_tets_conn[0 * 4 + 2] = conn_[0];
793  new_tets_conn[0 * 4 + 3] = conn_[1];
794  } else {
795  new_tets_conn[0 * 4 + 2] = conn_[1];
796  new_tets_conn[0 * 4 + 3] = conn_[0];
797  }
798  // TET1
799  new_tets_conn[1 * 4 + 0] = edge_new_nodes_[1];
800  new_tets_conn[1 * 4 + 1] = edge_new_nodes_[2];
801  if (is_rotated) {
802  new_tets_conn[1 * 4 + 2] = conn_[3];
803  new_tets_conn[1 * 4 + 3] = conn_[0];
804  } else {
805  new_tets_conn[1 * 4 + 2] = conn_[0];
806  new_tets_conn[1 * 4 + 3] = conn_[3];
807  }
808  // TET2
809  new_tets_conn[2 * 4 + 0] = edge_new_nodes_[1];
810  new_tets_conn[2 * 4 + 1] = edge_new_nodes_[2];
811  if (is_rotated) {
812  new_tets_conn[2 * 4 + 2] = conn_[2];
813  new_tets_conn[2 * 4 + 3] = conn_[3];
814  } else {
815  new_tets_conn[2 * 4 + 2] = conn_[3];
816  new_tets_conn[2 * 4 + 3] = conn_[2];
817  }
818  // TET3
819  new_tets_conn[3 * 4 + 0] = edge_new_nodes_[4];
820  new_tets_conn[3 * 4 + 1] = edge_new_nodes_[1];
821  if (is_rotated) {
822  new_tets_conn[3 * 4 + 2] = conn_[3];
823  new_tets_conn[3 * 4 + 3] = conn_[0];
824  } else {
825  new_tets_conn[3 * 4 + 2] = conn_[0];
826  new_tets_conn[3 * 4 + 3] = conn_[3];
827  }
828  return type;
829  } else if (free_edge_swappped0 && (!free_edge_swappped5)) {
830  // TET0
831  new_tets_conn[0 * 4 + 0] = edge_new_nodes_[4];
832  new_tets_conn[0 * 4 + 1] = edge_new_nodes_[1];
833  if (is_rotated) {
834  new_tets_conn[0 * 4 + 2] = edge_new_nodes_[2];
835  new_tets_conn[0 * 4 + 3] = conn_[1];
836  } else {
837  new_tets_conn[0 * 4 + 2] = conn_[1];
838  new_tets_conn[0 * 4 + 3] = edge_new_nodes_[2];
839  }
840  // TET1
841  new_tets_conn[1 * 4 + 0] = edge_new_nodes_[4];
842  new_tets_conn[1 * 4 + 1] = edge_new_nodes_[1];
843  if (is_rotated) {
844  new_tets_conn[1 * 4 + 2] = conn_[2];
845  new_tets_conn[1 * 4 + 3] = edge_new_nodes_[2];
846  } else {
847  new_tets_conn[1 * 4 + 2] = edge_new_nodes_[2];
848  new_tets_conn[1 * 4 + 3] = conn_[2];
849  }
850  // TET2
851  new_tets_conn[2 * 4 + 0] = edge_new_nodes_[4];
852  new_tets_conn[2 * 4 + 1] = edge_new_nodes_[2];
853  if (is_rotated) {
854  new_tets_conn[2 * 4 + 2] = conn_[0];
855  new_tets_conn[2 * 4 + 3] = conn_[1];
856  } else {
857  new_tets_conn[2 * 4 + 2] = conn_[1];
858  new_tets_conn[2 * 4 + 3] = conn_[0];
859  }
860  // TET3
861  new_tets_conn[3 * 4 + 0] = edge_new_nodes_[4];
862  new_tets_conn[3 * 4 + 1] = edge_new_nodes_[2];
863  if (is_rotated) {
864  new_tets_conn[3 * 4 + 2] = conn_[3];
865  new_tets_conn[3 * 4 + 3] = conn_[0];
866  } else {
867  new_tets_conn[3 * 4 + 2] = conn_[0];
868  new_tets_conn[3 * 4 + 3] = conn_[3];
869  }
870  // TET4
871  new_tets_conn[4 * 4 + 0] = edge_new_nodes_[4];
872  new_tets_conn[4 * 4 + 1] = edge_new_nodes_[2];
873  if (is_rotated) {
874  new_tets_conn[4 * 4 + 2] = conn_[2];
875  new_tets_conn[4 * 4 + 3] = conn_[3];
876  } else {
877  new_tets_conn[4 * 4 + 2] = conn_[3];
878  new_tets_conn[4 * 4 + 3] = conn_[2];
879  }
880  return 5;
881  } else if (free_edge_swappped0 && free_edge_swappped5) {
882  // TET0
883  new_tets_conn[0 * 4 + 0] = edge_new_nodes_[4];
884  new_tets_conn[0 * 4 + 1] = edge_new_nodes_[1];
885  if (is_rotated) {
886  new_tets_conn[0 * 4 + 2] = edge_new_nodes_[2];
887  new_tets_conn[0 * 4 + 3] = conn_[1];
888  } else {
889  new_tets_conn[0 * 4 + 2] = conn_[1];
890  new_tets_conn[0 * 4 + 3] = edge_new_nodes_[2];
891  }
892  // TET1
893  new_tets_conn[1 * 4 + 0] = edge_new_nodes_[1];
894  new_tets_conn[1 * 4 + 1] = edge_new_nodes_[2];
895  if (is_rotated) {
896  new_tets_conn[1 * 4 + 2] = conn_[2];
897  new_tets_conn[1 * 4 + 3] = conn_[3];
898  } else {
899  new_tets_conn[1 * 4 + 2] = conn_[3];
900  new_tets_conn[1 * 4 + 3] = conn_[2];
901  }
902  // TET2
903  new_tets_conn[2 * 4 + 0] = edge_new_nodes_[4];
904  new_tets_conn[2 * 4 + 1] = edge_new_nodes_[2];
905  if (is_rotated) {
906  new_tets_conn[2 * 4 + 2] = conn_[0];
907  new_tets_conn[2 * 4 + 3] = conn_[1];
908  } else {
909  new_tets_conn[2 * 4 + 2] = conn_[1];
910  new_tets_conn[2 * 4 + 3] = conn_[0];
911  }
912  // TET3
913  new_tets_conn[3 * 4 + 0] = edge_new_nodes_[4];
914  new_tets_conn[3 * 4 + 1] = edge_new_nodes_[2];
915  if (is_rotated) {
916  new_tets_conn[3 * 4 + 2] = conn_[3];
917  new_tets_conn[3 * 4 + 3] = conn_[0];
918  } else {
919  new_tets_conn[3 * 4 + 2] = conn_[0];
920  new_tets_conn[3 * 4 + 3] = conn_[3];
921  }
922  // TET4
923  new_tets_conn[4 * 4 + 0] = edge_new_nodes_[4];
924  new_tets_conn[4 * 4 + 1] = edge_new_nodes_[2];
925  if (is_rotated) {
926  new_tets_conn[4 * 4 + 2] = edge_new_nodes_[1];
927  new_tets_conn[4 * 4 + 3] = conn_[3];
928  } else {
929  new_tets_conn[4 * 4 + 2] = conn_[3];
930  new_tets_conn[4 * 4 + 3] = edge_new_nodes_[1];
931  }
932  return 6;
933  }
934  // TET0
935  new_tets_conn[0 * 4 + 0] = edge_new_nodes_[4];
936  new_tets_conn[0 * 4 + 1] = edge_new_nodes_[1];
937  if (is_rotated) {
938  new_tets_conn[0 * 4 + 2] = conn_[0];
939  new_tets_conn[0 * 4 + 3] = conn_[1];
940  } else {
941  new_tets_conn[0 * 4 + 2] = conn_[1];
942  new_tets_conn[0 * 4 + 3] = conn_[0];
943  }
944  // TET1
945  new_tets_conn[1 * 4 + 0] = edge_new_nodes_[1];
946  new_tets_conn[1 * 4 + 1] = edge_new_nodes_[2];
947  if (is_rotated) {
948  new_tets_conn[1 * 4 + 2] = conn_[2];
949  new_tets_conn[1 * 4 + 3] = edge_new_nodes_[4];
950  } else {
951  new_tets_conn[1 * 4 + 2] = edge_new_nodes_[4];
952  new_tets_conn[1 * 4 + 3] = conn_[2];
953  }
954  // TET2
955  new_tets_conn[2 * 4 + 0] = edge_new_nodes_[4];
956  new_tets_conn[2 * 4 + 1] = edge_new_nodes_[2];
957  if (is_rotated) {
958  new_tets_conn[2 * 4 + 2] = conn_[2];
959  new_tets_conn[2 * 4 + 3] = conn_[3];
960  } else {
961  new_tets_conn[2 * 4 + 2] = conn_[3];
962  new_tets_conn[2 * 4 + 3] = conn_[2];
963  }
964  // TET3
965  new_tets_conn[3 * 4 + 0] = edge_new_nodes_[4];
966  new_tets_conn[3 * 4 + 1] = edge_new_nodes_[2];
967  if (is_rotated) {
968  new_tets_conn[3 * 4 + 2] = conn_[0];
969  new_tets_conn[3 * 4 + 3] = edge_new_nodes_[1];
970  } else {
971  new_tets_conn[3 * 4 + 2] = edge_new_nodes_[1];
972  new_tets_conn[3 * 4 + 3] = conn_[0];
973  }
974  // TET4
975  new_tets_conn[4 * 4 + 0] = edge_new_nodes_[4];
976  new_tets_conn[4 * 4 + 1] = edge_new_nodes_[2];
977  if (is_rotated) {
978  new_tets_conn[4 * 4 + 2] = conn_[3];
979  new_tets_conn[4 * 4 + 3] = conn_[0];
980  } else {
981  new_tets_conn[4 * 4 + 2] = conn_[0];
982  new_tets_conn[4 * 4 + 3] = conn_[3];
983  }
984  return 7;
985  }
986  return type;
987 }

◆ tet_type_4()

int MoFEM::tet_type_4 ( const EntityHandle conn,
const int *  split_edges,
const EntityHandle edge_new_nodes,
EntityHandle new_tets_conn 
)

Definition at line 239 of file EntityRefine.cpp.

241  {
242  char mach_pattern = 0;
243  for (int ee = 0; ee < 4; ee++)
244  mach_pattern |= edge_bits_mark[split_edges[ee]];
246  int edges_[6];
247  int type = -1;
248  for (int ee = 0; ee < 6; ee++) {
249  char pattern0, pattern1;
250  pattern0 = edge_bits_mark[edge_permutations[ee][0]] |
254  pattern1 = edge_bits_mark[edge_permutations[ee][1]] |
258  if (pattern0 == mach_pattern || pattern1 == mach_pattern) {
259  int free_edge = oposite_edge[ee];
260  conn_[0] = conn[edges_conn[ee * 2 + 0]];
261  conn_[1] = conn[edges_conn[ee * 2 + 1]];
262  conn_[2] = conn[edges_conn[free_edge * 2 + 0]];
263  conn_[3] = conn[edges_conn[free_edge * 2 + 1]];
264  for (int EE = 0; EE < 6; EE++)
265  edges_[EE] = edge_permutations[ee][EE];
266  if (pattern0 == mach_pattern)
267  type = 0;
268  else if (pattern1 == mach_pattern)
269  type = 1;
270  // printf("no mirror\n");
271  break;
272  }
277  pattern1 = edge_bits_mark[edge_permutations[ee][1]] |
281  if (pattern0 == mach_pattern || pattern1 == mach_pattern) {
282  int free_edge = oposite_edge[ee];
283  conn_[0] = conn[edges_conn[ee * 2 + 1]];
284  conn_[1] = conn[edges_conn[ee * 2 + 0]];
285  conn_[2] = conn[edges_conn[free_edge * 2 + 1]];
286  conn_[3] = conn[edges_conn[free_edge * 2 + 0]];
287  for (int EE = 0; EE < 6; EE++)
288  edges_[EE] = edge_permutations[ee][edge_mirror_cross[EE]];
289  if (pattern0 == mach_pattern)
290  type = 0;
291  else if (pattern1 == mach_pattern)
292  type = 1;
293  // printf("mirror\n");
294  break;
295  }
296  }
297  assert(type != -1);
298  EntityHandle edge_new_nodes_[6];
299  for (int ee = 0; ee < 6; ee++)
300  edge_new_nodes_[ee] = edge_new_nodes[edges_[ee]];
301  if (type == 0) {
302  assert(edge_new_nodes_[0] != no_handle);
303  assert(edge_new_nodes_[1] != no_handle);
304  assert(edge_new_nodes_[4] != no_handle);
305  assert(edge_new_nodes_[3] != no_handle);
306  bool free_edge_swappped5 = false;
307  if (conn_[3] < conn_[2]) {
308  free_edge_swappped5 = true;
309  }
310  bool free_edge_swappped2 = false;
311  if (conn_[0] < conn_[2]) {
312  free_edge_swappped2 = true;
313  }
314  // TET0
315  new_tets_conn[0 * 4 + 0] = conn_[1];
316  new_tets_conn[0 * 4 + 1] = edge_new_nodes_[1];
317  new_tets_conn[0 * 4 + 2] = edge_new_nodes_[0];
318  new_tets_conn[0 * 4 + 3] = edge_new_nodes_[4];
319  if (free_edge_swappped5 && (!free_edge_swappped2)) {
320  // TET1
321  new_tets_conn[1 * 4 + 0] = edge_new_nodes_[1];
322  new_tets_conn[1 * 4 + 1] = edge_new_nodes_[3];
323  new_tets_conn[1 * 4 + 2] = edge_new_nodes_[4];
324  new_tets_conn[1 * 4 + 3] = conn_[3];
325  // TET2
326  new_tets_conn[2 * 4 + 0] = conn_[3];
327  new_tets_conn[2 * 4 + 1] = edge_new_nodes_[1];
328  new_tets_conn[2 * 4 + 2] = edge_new_nodes_[3];
329  new_tets_conn[2 * 4 + 3] = conn_[2];
330  // TET3
331  new_tets_conn[3 * 4 + 0] = edge_new_nodes_[0];
332  new_tets_conn[3 * 4 + 1] = edge_new_nodes_[3];
333  new_tets_conn[3 * 4 + 2] = edge_new_nodes_[4];
334  new_tets_conn[3 * 4 + 3] = edge_new_nodes_[1];
335  // TET4
336  new_tets_conn[4 * 4 + 0] = conn_[2];
337  new_tets_conn[4 * 4 + 1] = edge_new_nodes_[0];
338  new_tets_conn[4 * 4 + 2] = edge_new_nodes_[3];
339  new_tets_conn[4 * 4 + 3] = conn_[0];
340  // TET5
341  new_tets_conn[5 * 4 + 0] = edge_new_nodes_[1];
342  new_tets_conn[5 * 4 + 1] = edge_new_nodes_[0];
343  new_tets_conn[5 * 4 + 2] = edge_new_nodes_[3];
344  new_tets_conn[5 * 4 + 3] = conn_[2];
345  return 2;
346  } else if (free_edge_swappped2 && (!free_edge_swappped5)) {
347  // TET1
348  new_tets_conn[1 * 4 + 0] = edge_new_nodes_[3];
349  new_tets_conn[1 * 4 + 1] = edge_new_nodes_[1];
350  new_tets_conn[1 * 4 + 2] = edge_new_nodes_[0];
351  new_tets_conn[1 * 4 + 3] = conn_[0];
352  // TET2
353  new_tets_conn[2 * 4 + 0] = edge_new_nodes_[3];
354  new_tets_conn[2 * 4 + 1] = edge_new_nodes_[1];
355  new_tets_conn[2 * 4 + 2] = conn_[0];
356  new_tets_conn[2 * 4 + 3] = conn_[2];
357  // TET3
358  new_tets_conn[3 * 4 + 0] = edge_new_nodes_[0];
359  new_tets_conn[3 * 4 + 1] = edge_new_nodes_[3];
360  new_tets_conn[3 * 4 + 2] = edge_new_nodes_[4];
361  new_tets_conn[3 * 4 + 3] = edge_new_nodes_[1];
362  // TET4
363  new_tets_conn[4 * 4 + 0] = conn_[2];
364  new_tets_conn[4 * 4 + 1] = edge_new_nodes_[3];
365  new_tets_conn[4 * 4 + 2] = edge_new_nodes_[4];
366  new_tets_conn[4 * 4 + 3] = conn_[3];
367  // TET5
368  new_tets_conn[5 * 4 + 0] = edge_new_nodes_[1];
369  new_tets_conn[5 * 4 + 1] = edge_new_nodes_[3];
370  new_tets_conn[5 * 4 + 2] = edge_new_nodes_[4];
371  new_tets_conn[5 * 4 + 3] = conn_[2];
372  return 3;
373  } else if (free_edge_swappped2 && free_edge_swappped5) {
374  // TET1
375  new_tets_conn[1 * 4 + 0] = edge_new_nodes_[3];
376  new_tets_conn[1 * 4 + 1] = edge_new_nodes_[1];
377  new_tets_conn[1 * 4 + 2] = edge_new_nodes_[0];
378  new_tets_conn[1 * 4 + 3] = conn_[0];
379  // TET2
380  new_tets_conn[2 * 4 + 0] = edge_new_nodes_[3];
381  new_tets_conn[2 * 4 + 1] = edge_new_nodes_[1];
382  new_tets_conn[2 * 4 + 2] = conn_[0];
383  new_tets_conn[2 * 4 + 3] = conn_[2];
384  // TET3
385  new_tets_conn[3 * 4 + 0] = edge_new_nodes_[0];
386  new_tets_conn[3 * 4 + 1] = edge_new_nodes_[3];
387  new_tets_conn[3 * 4 + 2] = edge_new_nodes_[4];
388  new_tets_conn[3 * 4 + 3] = edge_new_nodes_[1];
389  // TET4
390  new_tets_conn[4 * 4 + 0] = edge_new_nodes_[1];
391  new_tets_conn[4 * 4 + 1] = edge_new_nodes_[3];
392  new_tets_conn[4 * 4 + 2] = edge_new_nodes_[4];
393  new_tets_conn[4 * 4 + 3] = conn_[3];
394  // TET5
395  new_tets_conn[5 * 4 + 0] = conn_[3];
396  new_tets_conn[5 * 4 + 1] = edge_new_nodes_[1];
397  new_tets_conn[5 * 4 + 2] = edge_new_nodes_[3];
398  new_tets_conn[5 * 4 + 3] = conn_[2];
399  return 4;
400  } else {
401  // TET1
402  new_tets_conn[1 * 4 + 0] = edge_new_nodes_[0];
403  new_tets_conn[1 * 4 + 1] = edge_new_nodes_[3];
404  new_tets_conn[1 * 4 + 2] = edge_new_nodes_[4];
405  new_tets_conn[1 * 4 + 3] = conn_[2];
406  // TET2
407  new_tets_conn[2 * 4 + 0] = conn_[2];
408  new_tets_conn[2 * 4 + 1] = edge_new_nodes_[1];
409  new_tets_conn[2 * 4 + 2] = edge_new_nodes_[4];
410  new_tets_conn[2 * 4 + 3] = edge_new_nodes_[0];
411  // TET3
412  new_tets_conn[3 * 4 + 0] = conn_[2];
413  new_tets_conn[3 * 4 + 1] = edge_new_nodes_[0];
414  new_tets_conn[3 * 4 + 2] = edge_new_nodes_[3];
415  new_tets_conn[3 * 4 + 3] = conn_[0];
416  // TET4
417  new_tets_conn[4 * 4 + 0] = conn_[2];
418  new_tets_conn[4 * 4 + 1] = edge_new_nodes_[3];
419  new_tets_conn[4 * 4 + 2] = edge_new_nodes_[4];
420  new_tets_conn[4 * 4 + 3] = conn_[3];
421  }
422  } else if (type == 1) {
423  assert(edge_new_nodes_[1] != no_handle);
424  assert(edge_new_nodes_[2] != no_handle);
425  assert(edge_new_nodes_[3] != no_handle);
426  assert(edge_new_nodes_[4] != no_handle);
427  bool free_edge_swappped5 = false;
428  if (conn_[3] < conn_[2]) {
429  free_edge_swappped5 = true;
430  }
431  bool free_edge_swappped0 = false;
432  if (conn_[0] > conn_[1]) {
433  free_edge_swappped0 = true;
434  }
435  if (free_edge_swappped0 && (!free_edge_swappped5)) {
436  // TET0
437  new_tets_conn[0 * 4 + 0] = edge_new_nodes_[3];
438  new_tets_conn[0 * 4 + 1] = edge_new_nodes_[2];
439  new_tets_conn[0 * 4 + 2] = conn_[1];
440  new_tets_conn[0 * 4 + 3] = conn_[0];
441  // TET1
442  new_tets_conn[1 * 4 + 0] = edge_new_nodes_[3];
443  new_tets_conn[1 * 4 + 1] = edge_new_nodes_[1];
444  new_tets_conn[1 * 4 + 2] = edge_new_nodes_[4];
445  new_tets_conn[1 * 4 + 3] = conn_[1];
446  // TET2
447  new_tets_conn[2 * 4 + 0] = edge_new_nodes_[3];
448  new_tets_conn[2 * 4 + 1] = edge_new_nodes_[2];
449  new_tets_conn[2 * 4 + 2] = edge_new_nodes_[1];
450  new_tets_conn[2 * 4 + 3] = conn_[1];
451  // TET3
452  new_tets_conn[3 * 4 + 0] = edge_new_nodes_[1];
453  new_tets_conn[3 * 4 + 1] = edge_new_nodes_[2];
454  new_tets_conn[3 * 4 + 2] = edge_new_nodes_[3];
455  new_tets_conn[3 * 4 + 3] = conn_[2];
456  // TET4
457  new_tets_conn[4 * 4 + 0] = edge_new_nodes_[1];
458  new_tets_conn[4 * 4 + 1] = edge_new_nodes_[3];
459  new_tets_conn[4 * 4 + 2] = edge_new_nodes_[4];
460  new_tets_conn[4 * 4 + 3] = conn_[2];
461  // TET5
462  new_tets_conn[5 * 4 + 0] = edge_new_nodes_[3];
463  new_tets_conn[5 * 4 + 1] = edge_new_nodes_[4];
464  new_tets_conn[5 * 4 + 2] = conn_[2];
465  new_tets_conn[5 * 4 + 3] = conn_[3];
466  return 5;
467  } else if (free_edge_swappped5 && (!free_edge_swappped0)) {
468  // TET0
469  new_tets_conn[0 * 4 + 0] = edge_new_nodes_[4];
470  new_tets_conn[0 * 4 + 1] = edge_new_nodes_[1];
471  new_tets_conn[0 * 4 + 2] = conn_[1];
472  new_tets_conn[0 * 4 + 3] = conn_[0];
473  // TET1
474  new_tets_conn[1 * 4 + 0] = edge_new_nodes_[3];
475  new_tets_conn[1 * 4 + 1] = edge_new_nodes_[1];
476  new_tets_conn[1 * 4 + 2] = edge_new_nodes_[4];
477  new_tets_conn[1 * 4 + 3] = conn_[0];
478  // TET2
479  new_tets_conn[2 * 4 + 0] = edge_new_nodes_[2];
480  new_tets_conn[2 * 4 + 1] = edge_new_nodes_[1];
481  new_tets_conn[2 * 4 + 2] = edge_new_nodes_[3];
482  new_tets_conn[2 * 4 + 3] = conn_[0];
483  // TET3
484  new_tets_conn[3 * 4 + 0] = edge_new_nodes_[1];
485  new_tets_conn[3 * 4 + 1] = edge_new_nodes_[2];
486  new_tets_conn[3 * 4 + 2] = edge_new_nodes_[3];
487  new_tets_conn[3 * 4 + 3] = conn_[3];
488  // TET4
489  new_tets_conn[4 * 4 + 0] = edge_new_nodes_[1];
490  new_tets_conn[4 * 4 + 1] = edge_new_nodes_[3];
491  new_tets_conn[4 * 4 + 2] = edge_new_nodes_[4];
492  new_tets_conn[4 * 4 + 3] = conn_[3];
493  // TET5
494  new_tets_conn[5 * 4 + 0] = edge_new_nodes_[1];
495  new_tets_conn[5 * 4 + 1] = edge_new_nodes_[2];
496  new_tets_conn[5 * 4 + 2] = conn_[3];
497  new_tets_conn[5 * 4 + 3] = conn_[2];
498  return 6;
499  } else if (free_edge_swappped5 && free_edge_swappped0) {
500  // TET0
501  new_tets_conn[0 * 4 + 0] = edge_new_nodes_[3];
502  new_tets_conn[0 * 4 + 1] = edge_new_nodes_[2];
503  new_tets_conn[0 * 4 + 2] = conn_[1];
504  new_tets_conn[0 * 4 + 3] = conn_[0];
505  // TET1
506  new_tets_conn[1 * 4 + 0] = edge_new_nodes_[3];
507  new_tets_conn[1 * 4 + 1] = edge_new_nodes_[1];
508  new_tets_conn[1 * 4 + 2] = edge_new_nodes_[4];
509  new_tets_conn[1 * 4 + 3] = conn_[1];
510  // TET2
511  new_tets_conn[2 * 4 + 0] = edge_new_nodes_[3];
512  new_tets_conn[2 * 4 + 1] = edge_new_nodes_[2];
513  new_tets_conn[2 * 4 + 2] = edge_new_nodes_[1];
514  new_tets_conn[2 * 4 + 3] = conn_[1];
515  // TET3
516  new_tets_conn[3 * 4 + 0] = edge_new_nodes_[1];
517  new_tets_conn[3 * 4 + 1] = edge_new_nodes_[2];
518  new_tets_conn[3 * 4 + 2] = edge_new_nodes_[3];
519  new_tets_conn[3 * 4 + 3] = conn_[3];
520  // TET4
521  new_tets_conn[4 * 4 + 0] = edge_new_nodes_[1];
522  new_tets_conn[4 * 4 + 1] = edge_new_nodes_[3];
523  new_tets_conn[4 * 4 + 2] = edge_new_nodes_[4];
524  new_tets_conn[4 * 4 + 3] = conn_[3];
525  // TET5
526  new_tets_conn[5 * 4 + 0] = edge_new_nodes_[1];
527  new_tets_conn[5 * 4 + 1] = edge_new_nodes_[2];
528  new_tets_conn[5 * 4 + 2] = conn_[3];
529  new_tets_conn[5 * 4 + 3] = conn_[2];
530  return 7;
531  }
532  // TET0
533  new_tets_conn[0 * 4 + 0] = edge_new_nodes_[4];
534  new_tets_conn[0 * 4 + 1] = edge_new_nodes_[1];
535  new_tets_conn[0 * 4 + 2] = conn_[1];
536  new_tets_conn[0 * 4 + 3] = conn_[0];
537  // TET1
538  new_tets_conn[1 * 4 + 0] = edge_new_nodes_[3];
539  new_tets_conn[1 * 4 + 1] = edge_new_nodes_[1];
540  new_tets_conn[1 * 4 + 2] = edge_new_nodes_[4];
541  new_tets_conn[1 * 4 + 3] = conn_[0];
542  // TET2
543  new_tets_conn[2 * 4 + 0] = edge_new_nodes_[2];
544  new_tets_conn[2 * 4 + 1] = edge_new_nodes_[1];
545  new_tets_conn[2 * 4 + 2] = edge_new_nodes_[3];
546  new_tets_conn[2 * 4 + 3] = conn_[0];
547  // TET3
548  new_tets_conn[3 * 4 + 0] = edge_new_nodes_[1];
549  new_tets_conn[3 * 4 + 1] = edge_new_nodes_[2];
550  new_tets_conn[3 * 4 + 2] = edge_new_nodes_[3];
551  new_tets_conn[3 * 4 + 3] = conn_[2];
552  // TET4
553  new_tets_conn[4 * 4 + 0] = edge_new_nodes_[1];
554  new_tets_conn[4 * 4 + 1] = edge_new_nodes_[3];
555  new_tets_conn[4 * 4 + 2] = edge_new_nodes_[4];
556  new_tets_conn[4 * 4 + 3] = conn_[2];
557  // TET5
558  new_tets_conn[5 * 4 + 0] = edge_new_nodes_[3];
559  new_tets_conn[5 * 4 + 1] = edge_new_nodes_[4];
560  new_tets_conn[5 * 4 + 2] = conn_[2];
561  new_tets_conn[5 * 4 + 3] = conn_[3];
562  }
563  return type;
564 }

◆ tet_type_5()

int MoFEM::tet_type_5 ( moab::Interface &  moab,
const EntityHandle conn,
const EntityHandle edge_new_nodes,
EntityHandle new_tets_conn 
)

Definition at line 133 of file EntityRefine.cpp.

135  {
136  int free_edge = -1;
137  for (int ee = 0; ee < 6; ee++) {
138  if (edge_new_nodes[ee] == no_handle) {
139  free_edge = ee;
140  break;
141  }
142  }
143  int edge0 = oposite_edge[free_edge];
144  EntityHandle conn_[] = {
145  conn[edges_conn[edge0 * 2 + 0]], conn[edges_conn[edge0 * 2 + 1]],
146  conn[edges_conn[free_edge * 2 + 0]], conn[edges_conn[free_edge * 2 + 1]]};
147  const int *edges_ = &edge_permutations[edge0][0];
148  EntityHandle edge_new_nodes_[6];
149  for (int ee = 0; ee < 6; ee++)
150  edge_new_nodes_[ee] = edge_new_nodes[edges_[ee]];
151  bool free_edge_swappped = false;
152  if (conn_[3] < conn_[2]) {
153  free_edge_swappped = true;
154  EntityHandle conn__2_ = conn_[2];
155  conn_[2] = conn_[3];
156  conn_[3] = conn__2_;
157  }
158  assert(conn_[0] != no_handle);
159  assert(conn_[1] != no_handle);
160  assert(conn_[2] != no_handle);
161  assert(conn_[3] != no_handle);
162  assert(edge_new_nodes_[0] != no_handle);
163  assert(edge_new_nodes_[1] != no_handle);
164  assert(edge_new_nodes_[2] != no_handle);
165  assert(edge_new_nodes_[3] != no_handle);
166  assert(edge_new_nodes_[4] != no_handle);
167  // TET0
168  new_tets_conn[0 * 4 + 0] = edge_new_nodes_[4];
169  new_tets_conn[0 * 4 + 1] = edge_new_nodes_[0];
170  new_tets_conn[0 * 4 + 2] = edge_new_nodes_[1];
171  new_tets_conn[0 * 4 + 3] = conn_[1];
172  // TET1
173  new_tets_conn[1 * 4 + 0] = edge_new_nodes_[2];
174  new_tets_conn[1 * 4 + 1] = edge_new_nodes_[0];
175  new_tets_conn[1 * 4 + 2] = edge_new_nodes_[3];
176  new_tets_conn[1 * 4 + 3] = conn_[0];
177  // TET4
178  new_tets_conn[2 * 4 + 0] = conn_[2];
179  new_tets_conn[2 * 4 + 1] = edge_new_nodes_[3];
180  new_tets_conn[2 * 4 + 2] = edge_new_nodes_[4];
181  if (free_edge_swappped) {
182  new_tets_conn[2 * 4 + 1] = edge_new_nodes_[1];
183  new_tets_conn[2 * 4 + 2] = edge_new_nodes_[2];
184  }
185  new_tets_conn[2 * 4 + 3] = conn_[3];
186  double coords[6 * 3];
187  moab.get_coords(edge_new_nodes_, 6, coords);
188  cblas_daxpy(3, -1, &coords[4 * 3], 1, &coords[2 * 3], 1);
189  cblas_daxpy(3, -1, &coords[3 * 3], 1, &coords[1 * 3], 1);
190  double L[2] = {cblas_dnrm2(3, &coords[2 * 3], 1),
191  cblas_dnrm2(3, &coords[1 * 3], 1)};
192  if (L[1] <= L[0]) {
193  // VARIANT 1 diag 4-2
194  // TET2
195  new_tets_conn[3 * 4 + 0] = edge_new_nodes_[4];
196  new_tets_conn[3 * 4 + 1] = edge_new_nodes_[3];
197  new_tets_conn[3 * 4 + 2] = edge_new_nodes_[1];
198  new_tets_conn[3 * 4 + 3] = edge_new_nodes_[0];
199  // TET3
200  new_tets_conn[4 * 4 + 0] = edge_new_nodes_[2];
201  new_tets_conn[4 * 4 + 1] = edge_new_nodes_[1];
202  new_tets_conn[4 * 4 + 2] = edge_new_nodes_[3];
203  new_tets_conn[4 * 4 + 3] = edge_new_nodes_[0];
204  // TET5
205  new_tets_conn[5 * 4 + 0] = edge_new_nodes_[4];
206  new_tets_conn[5 * 4 + 1] = edge_new_nodes_[1];
207  new_tets_conn[5 * 4 + 2] = edge_new_nodes_[3];
208  new_tets_conn[5 * 4 + 3] = conn_[2];
209  // TET6
210  new_tets_conn[6 * 4 + 0] = edge_new_nodes_[1];
211  new_tets_conn[6 * 4 + 1] = edge_new_nodes_[2];
212  new_tets_conn[6 * 4 + 2] = edge_new_nodes_[3];
213  new_tets_conn[6 * 4 + 3] = conn_[2];
214  return 1;
215  }
216  // VARIANT 2 diag 1-3
217  // TET2
218  new_tets_conn[3 * 4 + 0] = edge_new_nodes_[4];
219  new_tets_conn[3 * 4 + 1] = edge_new_nodes_[3];
220  new_tets_conn[3 * 4 + 2] = edge_new_nodes_[2];
221  new_tets_conn[3 * 4 + 3] = edge_new_nodes_[0];
222  // TET3
223  new_tets_conn[4 * 4 + 0] = edge_new_nodes_[2];
224  new_tets_conn[4 * 4 + 1] = edge_new_nodes_[1];
225  new_tets_conn[4 * 4 + 2] = edge_new_nodes_[4];
226  new_tets_conn[4 * 4 + 3] = edge_new_nodes_[0];
227  // TET5
228  new_tets_conn[5 * 4 + 0] = edge_new_nodes_[4];
229  new_tets_conn[5 * 4 + 1] = edge_new_nodes_[1];
230  new_tets_conn[5 * 4 + 2] = edge_new_nodes_[2];
231  new_tets_conn[5 * 4 + 3] = conn_[2];
232  // TET6
233  new_tets_conn[6 * 4 + 0] = edge_new_nodes_[4];
234  new_tets_conn[6 * 4 + 1] = edge_new_nodes_[2];
235  new_tets_conn[6 * 4 + 2] = edge_new_nodes_[3];
236  new_tets_conn[6 * 4 + 3] = conn_[2];
237  return 0;
238 }

◆ tet_type_6()

void MoFEM::tet_type_6 ( moab::Interface &  moab,
const EntityHandle conn,
const EntityHandle edge_new_nodes,
EntityHandle new_tets_conn 
)

Definition at line 31 of file EntityRefine.cpp.

33  {
34  // 0:01 - 4 1:12-5 2:20-6 3:03-7 4:13-8 5:23-9
35  // TET0
36  new_tets_conn[0 * 4 + 0] = conn[0];
37  new_tets_conn[0 * 4 + 1] = edge_new_nodes[0];
38  new_tets_conn[0 * 4 + 2] = edge_new_nodes[2];
39  new_tets_conn[0 * 4 + 3] = edge_new_nodes[3];
40  // TET1
41  new_tets_conn[1 * 4 + 0] = conn[1];
42  new_tets_conn[1 * 4 + 1] = edge_new_nodes[0];
43  new_tets_conn[1 * 4 + 2] = edge_new_nodes[4];
44  new_tets_conn[1 * 4 + 3] = edge_new_nodes[1];
45  // TET2
46  new_tets_conn[2 * 4 + 0] = conn[2];
47  new_tets_conn[2 * 4 + 1] = edge_new_nodes[1];
48  new_tets_conn[2 * 4 + 2] = edge_new_nodes[5];
49  new_tets_conn[2 * 4 + 3] = edge_new_nodes[2];
50  // TET3
51  new_tets_conn[3 * 4 + 0] = conn[3];
52  new_tets_conn[3 * 4 + 1] = edge_new_nodes[3];
53  new_tets_conn[3 * 4 + 2] = edge_new_nodes[5];
54  new_tets_conn[3 * 4 + 3] = edge_new_nodes[4];
55  double coords[6 * 3];
56  moab.get_coords(edge_new_nodes, 6, coords);
57  cblas_daxpy(3, -1, &coords[4 * 3], 1, &coords[2 * 3], 1);
58  cblas_daxpy(3, -1, &coords[3 * 3], 1, &coords[1 * 3], 1);
59  cblas_daxpy(3, -1, &coords[5 * 3], 1, &coords[0 * 3], 1);
60  double L[3] = {cblas_dnrm2(3, &coords[2 * 3], 1),
61  cblas_dnrm2(3, &coords[1 * 3], 1),
62  cblas_dnrm2(3, &coords[0 * 3], 1)};
63  // VARIANT 1 - diag 4-2
64  if (L[0] <= L[1] && L[0] <= L[2]) {
65  // TET4
66  new_tets_conn[4 * 4 + 0] = edge_new_nodes[4];
67  new_tets_conn[4 * 4 + 1] = edge_new_nodes[3];
68  new_tets_conn[4 * 4 + 2] = edge_new_nodes[2];
69  new_tets_conn[4 * 4 + 3] = edge_new_nodes[0];
70  // TET5
71  new_tets_conn[5 * 4 + 0] = edge_new_nodes[4];
72  new_tets_conn[5 * 4 + 1] = edge_new_nodes[2];
73  new_tets_conn[5 * 4 + 2] = edge_new_nodes[3];
74  new_tets_conn[5 * 4 + 3] = edge_new_nodes[5];
75  // TET6
76  new_tets_conn[6 * 4 + 0] = edge_new_nodes[4];
77  new_tets_conn[6 * 4 + 1] = edge_new_nodes[2];
78  new_tets_conn[6 * 4 + 2] = edge_new_nodes[1];
79  new_tets_conn[6 * 4 + 3] = edge_new_nodes[0];
80  // TET7
81  new_tets_conn[7 * 4 + 0] = edge_new_nodes[4];
82  new_tets_conn[7 * 4 + 1] = edge_new_nodes[1];
83  new_tets_conn[7 * 4 + 2] = edge_new_nodes[2];
84  new_tets_conn[7 * 4 + 3] = edge_new_nodes[5];
85  return;
86  }
87  // VARIANT 2 - diag 3-1
88  if (L[1] <= L[0] && L[1] <= L[2]) {
89  // TET4
90  new_tets_conn[4 * 4 + 0] = edge_new_nodes[4];
91  new_tets_conn[4 * 4 + 1] = edge_new_nodes[3];
92  new_tets_conn[4 * 4 + 2] = edge_new_nodes[1];
93  new_tets_conn[4 * 4 + 3] = edge_new_nodes[0];
94  // TET5
95  new_tets_conn[5 * 4 + 0] = edge_new_nodes[4];
96  new_tets_conn[5 * 4 + 1] = edge_new_nodes[1];
97  new_tets_conn[5 * 4 + 2] = edge_new_nodes[3];
98  new_tets_conn[5 * 4 + 3] = edge_new_nodes[5];
99  // TET6
100  new_tets_conn[6 * 4 + 0] = edge_new_nodes[1];
101  new_tets_conn[6 * 4 + 1] = edge_new_nodes[3];
102  new_tets_conn[6 * 4 + 2] = edge_new_nodes[2];
103  new_tets_conn[6 * 4 + 3] = edge_new_nodes[0];
104  // TET7
105  new_tets_conn[7 * 4 + 0] = edge_new_nodes[1];
106  new_tets_conn[7 * 4 + 1] = edge_new_nodes[2];
107  new_tets_conn[7 * 4 + 2] = edge_new_nodes[3];
108  new_tets_conn[7 * 4 + 3] = edge_new_nodes[5];
109  return;
110  }
111  // VARIANT 3 - diag 5-0
112  // TET4
113  new_tets_conn[4 * 4 + 0] = edge_new_nodes[5];
114  new_tets_conn[4 * 4 + 1] = edge_new_nodes[2];
115  new_tets_conn[4 * 4 + 2] = edge_new_nodes[0];
116  new_tets_conn[4 * 4 + 3] = edge_new_nodes[3];
117  // TET5
118  new_tets_conn[5 * 4 + 0] = edge_new_nodes[5];
119  new_tets_conn[5 * 4 + 1] = edge_new_nodes[0];
120  new_tets_conn[5 * 4 + 2] = edge_new_nodes[2];
121  new_tets_conn[5 * 4 + 3] = edge_new_nodes[1];
122  // TET6
123  new_tets_conn[6 * 4 + 0] = edge_new_nodes[5];
124  new_tets_conn[6 * 4 + 1] = edge_new_nodes[0];
125  new_tets_conn[6 * 4 + 2] = edge_new_nodes[4];
126  new_tets_conn[6 * 4 + 3] = edge_new_nodes[3];
127  // TET7
128  new_tets_conn[7 * 4 + 0] = edge_new_nodes[5];
129  new_tets_conn[7 * 4 + 1] = edge_new_nodes[4];
130  new_tets_conn[7 * 4 + 2] = edge_new_nodes[0];
131  new_tets_conn[7 * 4 + 3] = edge_new_nodes[1];
132 }

◆ toString()

template<class X >
std::string MoFEM::toString ( x)
inline

Definition at line 106 of file Templates.hpp.

106  {
107  std::ostringstream buffer;
108  buffer << x;
109  return buffer.str();
110 }

◆ tri_type_1()

MoFEMErrorCode MoFEM::tri_type_1 ( const EntityHandle conn,
const int  split_edge,
const EntityHandle  edge_new_node,
EntityHandle new_tris_conn 
)

Definition at line 1137 of file EntityRefine.cpp.

1139  {
1140 
1142 
1143  if (split_edge == 0) {
1144  // TRI0
1145  new_tris_conn[0 * 3 + 0] = conn[0];
1146  new_tris_conn[0 * 3 + 1] = edge_new_node;
1147  new_tris_conn[0 * 3 + 2] = conn[2];
1148  // TRI1
1149  new_tris_conn[1 * 3 + 0] = edge_new_node;
1150  new_tris_conn[1 * 3 + 1] = conn[1];
1151  new_tris_conn[1 * 3 + 2] = conn[2];
1152  } else if (split_edge == 1) {
1153  // TRI0
1154  new_tris_conn[0 * 3 + 0] = conn[0];
1155  new_tris_conn[0 * 3 + 1] = conn[1];
1156  new_tris_conn[0 * 3 + 2] = edge_new_node;
1157  // TRI1
1158  new_tris_conn[1 * 3 + 0] = conn[0];
1159  new_tris_conn[1 * 3 + 1] = edge_new_node;
1160  new_tris_conn[1 * 3 + 2] = conn[2];
1161  } else if (split_edge == 2) {
1162  // TRI0
1163  new_tris_conn[0 * 3 + 0] = conn[0];
1164  new_tris_conn[0 * 3 + 1] = conn[1];
1165  new_tris_conn[0 * 3 + 2] = edge_new_node;
1166  // TRI1
1167  new_tris_conn[1 * 3 + 0] = edge_new_node;;
1168  new_tris_conn[1 * 3 + 1] = conn[1];
1169  new_tris_conn[1 * 3 + 2] = conn[2];
1170  } else {
1171  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Impossible case");
1172  }
1173 
1175 }

◆ tri_type_2()

MoFEMErrorCode MoFEM::tri_type_2 ( const EntityHandle conn,
const int *  split_edges,
const EntityHandle edge_new_nodes,
EntityHandle new_tris_conn 
)

Definition at line 1177 of file EntityRefine.cpp.

1179  {
1180 
1182 
1183  if(split_edges[0] == 0 && split_edges[1] == 1) {
1184  // TRI0
1185  new_tris_conn[0 * 3 + 0] = conn[0];
1186  new_tris_conn[0 * 3 + 1] = edge_new_nodes[0];
1187  new_tris_conn[0 * 3 + 2] = edge_new_nodes[1];
1188  // TRI1
1189  new_tris_conn[1 * 3 + 0] = edge_new_nodes[0];
1190  new_tris_conn[1 * 3 + 1] = conn[1];
1191  new_tris_conn[1 * 3 + 2] = edge_new_nodes[1];
1192  // TRI2
1193  new_tris_conn[2 * 3 + 0] = conn[0];
1194  new_tris_conn[2 * 3 + 1] = edge_new_nodes[1];
1195  new_tris_conn[2 * 3 + 2] = conn[2];
1196  } else if(split_edges[0] == 0 && split_edges[1] == 2) {
1197  // TRI0
1198  new_tris_conn[0 * 3 + 0] = conn[0];
1199  new_tris_conn[0 * 3 + 1] = edge_new_nodes[0];
1200  new_tris_conn[0 * 3 + 2] = edge_new_nodes[2];
1201  // TRI1
1202  new_tris_conn[1 * 3 + 0] = edge_new_nodes[0];
1203  new_tris_conn[1 * 3 + 1] = conn[1];
1204  new_tris_conn[1 * 3 + 2] = edge_new_nodes[2];
1205  // TRI2
1206  new_tris_conn[2 * 3 + 0] = edge_new_nodes[2];
1207  new_tris_conn[2 * 3 + 1] = conn[1];
1208  new_tris_conn[2 * 3 + 2] = conn[2];
1209  } else if(split_edges[0] == 1 && split_edges[1] == 2) {
1210  // TRI0
1211  new_tris_conn[0 * 3 + 0] = conn[0];
1212  new_tris_conn[0 * 3 + 1] = conn[1];
1213  new_tris_conn[0 * 3 + 2] = edge_new_nodes[2];
1214  // TRI1
1215  new_tris_conn[1 * 3 + 0] = edge_new_nodes[2];
1216  new_tris_conn[1 * 3 + 1] = conn[1];
1217  new_tris_conn[1 * 3 + 2] = edge_new_nodes[1];
1218  // TRI2
1219  new_tris_conn[2 * 3 + 0] = edge_new_nodes[2];
1220  new_tris_conn[2 * 3 + 1] = edge_new_nodes[1];
1221  new_tris_conn[2 * 3 + 2] = conn[2];
1222  } else {
1223  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Impossible case");
1224  }
1225 
1227 }

◆ tri_type_3()

MoFEMErrorCode MoFEM::tri_type_3 ( const EntityHandle conn,
const EntityHandle edge_new_nodes,
EntityHandle new_tris_conn 
)

Definition at line 1111 of file EntityRefine.cpp.

1113  {
1115  // TRI0
1116  new_tris_conn[0 * 3 + 0] = conn[0];
1117  new_tris_conn[0 * 3 + 1] = edge_new_nodes[0];
1118  new_tris_conn[0 * 3 + 2] = edge_new_nodes[2];
1119 
1120  // TRI1
1121  new_tris_conn[1 * 3 + 0] = edge_new_nodes[0];
1122  new_tris_conn[1 * 3 + 1] = conn[1];
1123  new_tris_conn[1 * 3 + 2] = edge_new_nodes[1];
1124 
1125  // TRI2
1126  new_tris_conn[2 * 3 + 0] = edge_new_nodes[2];
1127  new_tris_conn[2 * 3 + 1] = edge_new_nodes[1];
1128  new_tris_conn[2 * 3 + 2] = conn[2];
1129 
1130  // TRI3
1131  new_tris_conn[3 * 3 + 0] = edge_new_nodes[0];
1132  new_tris_conn[3 * 3 + 1] = edge_new_nodes[1];
1133  new_tris_conn[3 * 3 + 2] = edge_new_nodes[2];
1135 }

◆ TSAdaptChooseMoFEM()

static PetscErrorCode MoFEM::TSAdaptChooseMoFEM ( TSAdapt  adapt,
TS  ts,
PetscReal  h,
PetscInt *  next_sc,
PetscReal *  next_h,
PetscBool *  accept,
PetscReal *  wlte,
PetscReal *  wltea,
PetscReal *  wlter 
)

Definition at line 737 of file TsCtx.cpp.

740  {
742 
743  auto ts_adapt_mofem = boost::make_shared<TSAdaptMoFEM>();
744 
745  *next_sc = 0; /* Reuse the same order scheme */
746  *wlte = -1; /* Weighted local truncation error was not evaluated */
747  *wltea = -1; /* Weighted absolute local truncation error is not used */
748  *wlter = -1; /* Weighted relative local truncation error is not used */
749 
750  *accept = PETSC_TRUE;
751  *next_h = h; /* Reuse the old step */
752 
753  if (!ts_adapt_mofem->offApat) {
754 
755  SNES snes;
756  CHKERR TSGetSNES(ts, &snes);
757 
758  SNESConvergedReason reason;
759  CHKERR SNESGetConvergedReason(snes, &reason);
760 
761  int it;
762  CHKERR SNESGetIterationNumber(snes, &it);
763 
764  if (reason < 0) {
765  h *= ts_adapt_mofem->alpha;
766  *next_h = h;
767  MOFEM_LOG_C(
768  "TSWORLD", Sev::warning,
769  "\tDiverged set step length: it = %d, h = %3.4g set h = %3.4g \n", it,
770  h, *next_h);
771  } else if (reason > 0) {
772  h *= pow((static_cast<double>(ts_adapt_mofem->desiredIt) /
773  static_cast<double>(it + 1)),
774  static_cast<double>(ts_adapt_mofem->gamma));
775  *next_h = PetscClipInterval(h, adapt->dt_min, adapt->dt_max);
776  MOFEM_LOG_C(
777  "TSWORLD", Sev::inform,
778  "\tConverged set step length: it = %d, h = %3.4g set h = %3.4g \n",
779  it, h, *next_h);
780  }
781  }
782 
784 }

◆ TSAdaptCreateMoFEM()

PetscErrorCode MoFEM::TSAdaptCreateMoFEM ( TSAdapt  adapt)

Craete MOFEM adapt.

TSAdapt adapt;
CHKERR TSGetAdapt(solver, &adapt);
CHKERR TSAdaptSetType(adapt, TSADAPTMOFEM);
Parameters
adapt
Returns
PetscErrorCode
Examples
adolc_plasticity.cpp.

Definition at line 797 of file TsCtx.cpp.

797  {
798  PetscFunctionBegin;
799  adapt->ops->choose = TSAdaptChooseMoFEM;
800  adapt->ops->reset = TSAdaptResetMoFEM;
801  adapt->ops->destroy = TSAdaptDestroyMoFEM;
802  PetscFunctionReturn(0);
803 }

◆ TSAdaptDestroyMoFEM()

static PetscErrorCode MoFEM::TSAdaptDestroyMoFEM ( TSAdapt  adapt)

Definition at line 791 of file TsCtx.cpp.

791  {
793  CHKERR TSAdaptResetMoFEM(adapt);
795 }

◆ TSAdaptResetMoFEM()

static PetscErrorCode MoFEM::TSAdaptResetMoFEM ( TSAdapt  adapt)

Definition at line 786 of file TsCtx.cpp.

786  {
787  PetscFunctionBegin;
788  PetscFunctionReturn(0);
789 }

◆ TsMonitorSet()

PetscErrorCode MoFEM::TsMonitorSet ( TS  ts,
PetscInt  step,
PetscReal  t,
Vec  u,
void *  ctx 
)

Set monitor for TS solver.

See PETSc for details

Parameters
ts
step
t
u
ctx
Returns
PetscErrorCode
Examples
EshelbianPlasticity.cpp, free_surface.cpp, nonlinear_dynamics.cpp, Remodeling.cpp, and UnsaturatedFlow.hpp.

Definition at line 259 of file TsCtx.cpp.

260  {
262  TsCtx *ts_ctx = static_cast<TsCtx *>(ctx);
263  PetscLogEventBegin(ts_ctx->MOFEM_EVENT_TsCtxMonitor, 0, 0, 0, 0);
264  CHKERR VecGhostUpdateBegin(u, INSERT_VALUES, SCATTER_FORWARD);
265  CHKERR VecGhostUpdateEnd(u, INSERT_VALUES, SCATTER_FORWARD);
266  CHKERR ts_ctx->mField.getInterface<VecManager>()->setLocalGhostVector(
267  ts_ctx->problemName, COL, u, INSERT_VALUES, SCATTER_REVERSE);
268 
269  auto cache_ptr = boost::make_shared<CacheTuple>();
271 
272  auto set = [&](auto &fe) {
273  fe.ts = ts;
274  fe.ts_u = u;
275  fe.ts_t = t;
276  fe.ts_step = step;
277  fe.ts_F = PETSC_NULL;
278  fe.ts_ctx = TSMethod::CTX_TSTSMONITORSET;
279  fe.snes_ctx = SnesMethod::CTX_SNESNONE;
280  fe.ksp_ctx = KspMethod::CTX_KSPNONE;
281  fe.data_ctx = PetscData::CtxSetX | PetscData::CtxSetTime;
282 
283  CHKERR TSGetSNES(ts, &fe.snes);
284  CHKERR SNESGetKSP(fe.snes, &fe.ksp);
285 
286  fe.cacheWeakPtr = cache_ptr;
287  CHK_THROW_MESSAGE(TSGetTimeStep(ts, &fe.ts_dt), "get time step failed");
288  };
289 
290  auto unset = [&](auto &fe) {
291  fe.ts_ctx = TSMethod::CTX_TSNONE;
292  fe.data_ctx = PetscData::CtxSetNone;
293  };
294 
295  // preprocess
296  for (auto &bit : ts_ctx->preProcessMonitor) {
297  set(*bit);
299  *bit);
300  unset(*bit);
301  }
302 
303  for (auto &lit : ts_ctx->loopsMonitor) {
304  set(*lit.second);
306  *(lit.second), nullptr,
307  ts_ctx->bH, cache_ptr);
308  unset(*lit.second);
309  }
310 
311  // post process
312  for (auto &bit : ts_ctx->postProcessMonitor) {
313  set(*bit);
315  *bit);
316  unset(*bit);
317  }
318 
319  PetscLogEventEnd(ts_ctx->MOFEM_EVENT_TsCtxMonitor, 0, 0, 0, 0);
321 }

◆ TsSetI2Function()

PetscErrorCode MoFEM::TsSetI2Function ( TS  ts,
PetscReal  t,
Vec  u,
Vec  u_t,
Vec  u_tt,
Vec  F,
void *  ctx 
)

Calculation the right hand side for second order PDE in time.

PETSc for details

Parameters
ts
t
u
u_t
u_tt
F
ctx
Returns
PetscErrorCode

Definition at line 612 of file TsCtx.cpp.

613  {
615  TsCtx *ts_ctx = static_cast<TsCtx *>(ctx);
616  PetscLogEventBegin(ts_ctx->MOFEM_EVENT_TsCtxIFunction, 0, 0, 0, 0);
617  CHKERR VecGhostUpdateBegin(u, INSERT_VALUES, SCATTER_FORWARD);
618  CHKERR VecGhostUpdateEnd(u, INSERT_VALUES, SCATTER_FORWARD);
619  CHKERR VecGhostUpdateBegin(u_t, INSERT_VALUES, SCATTER_FORWARD);
620  CHKERR VecGhostUpdateEnd(u_t, INSERT_VALUES, SCATTER_FORWARD);
621  CHKERR VecGhostUpdateBegin(u_tt, INSERT_VALUES, SCATTER_FORWARD);
622  CHKERR VecGhostUpdateEnd(u_tt, INSERT_VALUES, SCATTER_FORWARD);
623  CHKERR ts_ctx->mField.getInterface<VecManager>()->setLocalGhostVector(
624  ts_ctx->problemName, COL, u, INSERT_VALUES, SCATTER_REVERSE);
625 
626  auto zero_ghost_vec = [](Vec g) {
628  Vec l;
629  CHKERR VecGhostGetLocalForm(g, &l);
630  double *a;
631  CHKERR VecGetArray(l, &a);
632  int s;
633  CHKERR VecGetLocalSize(l, &s);
634  for (int i = 0; i != s; ++i)
635  a[i] = 0;
636  CHKERR VecRestoreArray(l, &a);
637  CHKERR VecGhostRestoreLocalForm(g, &l);
639  };
640  CHKERR zero_ghost_vec(F);
641 
642  ts_ctx->vecAssembleSwitch = boost::movelib::make_unique<bool>(true);
643  auto cache_ptr = boost::make_shared<CacheTuple>();
645 
646  int step;
647 #if PETSC_VERSION_GE(3, 8, 0)
648  CHKERR TSGetStepNumber(ts, &step);
649 #else
650  CHKERR TSGetTimeStepNumber(ts, &step);
651 #endif
652 
653  auto set = [&](auto &fe) {
654  fe.ts_u = u;
655  fe.ts_u_t = u_t;
656  fe.ts_u_tt = u_tt;
657  fe.ts_F = F;
658  fe.ts_t = t;
659  fe.ts_step = step;
660  fe.ts_ctx = TSMethod::CTX_TSSETIFUNCTION;
661  fe.snes_ctx = SnesMethod::CTX_SNESSETFUNCTION;
662  fe.ksp_ctx = KspMethod::CTX_SETFUNCTION;
663  fe.data_ctx = PetscData::CtxSetF | PetscData::CtxSetX |
664  PetscData::CtxSetX_T | PetscData::CtxSetX_TT |
665  PetscData::CtxSetTime;
666 
667  CHKERR TSGetSNES(ts, &fe.snes);
668  CHKERR SNESGetKSP(fe.snes, &fe.ksp);
669 
670  fe.ts = ts;
671  fe.cacheWeakPtr = cache_ptr;
672  CHK_THROW_MESSAGE(TSGetTimeStep(ts, &fe.ts_dt), "get time step failed");
673  };
674 
675  auto unset = [&](auto &fe) {
676  fe.ts_ctx = TSMethod::CTX_TSNONE;
677  fe.snes_ctx = SnesMethod::CTX_SNESNONE;
678  fe.ksp_ctx = KspMethod::CTX_KSPNONE;
679  fe.data_ctx = PetscData::CtxSetNone;
680  };
681 
682  // preprocess
683  for (auto &bit : ts_ctx->preProcessIFunction) {
684  bit->vecAssembleSwitch = boost::move(ts_ctx->vecAssembleSwitch);
685  set(*bit);
687  *bit);
688  unset(*bit);
689  ts_ctx->vecAssembleSwitch = boost::move(bit->vecAssembleSwitch);
690  }
691 
692  // fe loops
693  for (auto &lit : ts_ctx->loopsIFunction) {
694  lit.second->vecAssembleSwitch = boost::move(ts_ctx->vecAssembleSwitch);
695  set(*lit.second);
697  *(lit.second), nullptr,
698  ts_ctx->bH, cache_ptr);
699  unset(*lit.second);
700  ts_ctx->vecAssembleSwitch = boost::move(lit.second->vecAssembleSwitch);
701  }
702 
703  // post process
704  for (auto &bit : ts_ctx->postProcessIFunction) {
705  bit->vecAssembleSwitch = boost::move(ts_ctx->vecAssembleSwitch);
706  set(*bit);
708  *bit);
709  unset(*bit);
710  ts_ctx->vecAssembleSwitch = boost::move(bit->vecAssembleSwitch);
711  }
712 
713  if (*ts_ctx->vecAssembleSwitch) {
714  CHKERR VecGhostUpdateBegin(F, ADD_VALUES, SCATTER_REVERSE);
715  CHKERR VecGhostUpdateEnd(F, ADD_VALUES, SCATTER_REVERSE);
716  CHKERR VecAssemblyBegin(F);
717  CHKERR VecAssemblyEnd(F);
718  }
719 
720  PetscLogEventEnd(ts_ctx->MOFEM_EVENT_TsCtxIFunction, 0, 0, 0, 0);
722 }

◆ TsSetI2Jacobian()

PetscErrorCode MoFEM::TsSetI2Jacobian ( TS  ts,
PetscReal  t,
Vec  u,
Vec  u_t,
Vec  u_tt,
PetscReal  a,
PetscReal  aa,
Mat  A,
Mat  B,
void *  ctx 
)

Calculation Jacobian for second order PDE in time.

See PETSc for details

Parameters
ts
ttime at step/stage being solved
ustate vectora
u_ttime derivative of state vector
u_ttsecond time derivative of state vector
ashift for u_t
aashift for u_tt
AJacobian of G(U) = F(t,U,W+v*U,W'+a*U), equivalent to dF/dU + v*dF/dU_t + a*dF/dU_tt
Bpreconditioning matrix for J, may be same as J
ctxTsCtx context for matrix evaluation routine
Returns
PetscErrorCode
Examples
plastic.cpp.

Definition at line 511 of file TsCtx.cpp.

513  {
515 
516  TsCtx *ts_ctx = static_cast<TsCtx *>(ctx);
517  PetscLogEventBegin(ts_ctx->MOFEM_EVENT_TsCtxI2Function, 0, 0, 0, 0);
518  CHKERR VecGhostUpdateBegin(u, INSERT_VALUES, SCATTER_FORWARD);
519  CHKERR VecGhostUpdateEnd(u, INSERT_VALUES, SCATTER_FORWARD);
520  CHKERR VecGhostUpdateBegin(u_t, INSERT_VALUES, SCATTER_FORWARD);
521  CHKERR VecGhostUpdateEnd(u_t, INSERT_VALUES, SCATTER_FORWARD);
522  CHKERR VecGhostUpdateBegin(u_tt, INSERT_VALUES, SCATTER_FORWARD);
523  CHKERR VecGhostUpdateEnd(u_tt, INSERT_VALUES, SCATTER_FORWARD);
524  CHKERR ts_ctx->mField.getInterface<VecManager>()->setLocalGhostVector(
525  ts_ctx->problemName, COL, u, INSERT_VALUES, SCATTER_REVERSE);
526  if (ts_ctx->zeroMatrix) {
527  CHKERR MatZeroEntries(B);
528  }
529  int step;
530 #if PETSC_VERSION_GE(3, 8, 0)
531  CHKERR TSGetStepNumber(ts, &step);
532 #else
533  CHKERR TSGetTimeStepNumber(ts, &step);
534 #endif
535 
537  boost::movelib::make_unique<bool>(ts_ctx->zeroMatrix);
538  auto cache_ptr = boost::make_shared<CacheTuple>();
540 
541  auto set = [&](auto &fe) {
542  fe.ts_u = u;
543  fe.ts_u_t = u_t;
544  fe.ts_u_tt = u_tt;
545  fe.ts_A = A;
546  fe.ts_B = B;
547  fe.ts_t = t;
548  fe.ts_a = a;
549  fe.ts_aa = aa;
550  fe.ts_step = step;
551 
552  fe.ts_ctx = TSMethod::CTX_TSSETIJACOBIAN;
553  fe.snes_ctx = SnesMethod::CTX_SNESSETJACOBIAN;
554  fe.ksp_ctx = KspMethod::CTX_OPERATORS;
555  fe.data_ctx = PetscData::CtxSetA | PetscData::CtxSetB | PetscData::CtxSetX |
556  PetscData::CtxSetX_T | PetscData::CtxSetX_TT |
557  PetscData::CtxSetTime;
558 
559  CHKERR TSGetSNES(ts, &fe.snes);
560  CHKERR SNESGetKSP(fe.snes, &fe.ksp);
561 
562  fe.ts = ts;
563  fe.cacheWeakPtr = cache_ptr;
564  CHK_THROW_MESSAGE(TSGetTimeStep(ts, &fe.ts_dt), "get time step failed");
565  };
566 
567  auto unset = [&](auto &fe) {
568  fe.ts_ctx = TSMethod::CTX_TSNONE;
569  fe.snes_ctx = SnesMethod::CTX_SNESNONE;
570  fe.ksp_ctx = KspMethod::CTX_KSPNONE;
571  fe.data_ctx = PetscData::CtxSetNone;
572  };
573 
574  // preprocess
575  for (auto &bit : ts_ctx->preProcessIJacobian) {
576  bit->matAssembleSwitch = boost::move(ts_ctx->matAssembleSwitch);
577  set(*bit);
579  *bit);
580  unset(*bit);
581  ts_ctx->matAssembleSwitch = boost::move(bit->matAssembleSwitch);
582  }
583 
584  for (auto &lit : ts_ctx->loopsIJacobian) {
585  lit.second->matAssembleSwitch = boost::move(ts_ctx->matAssembleSwitch);
586  set(*lit.second);
588  *(lit.second), nullptr,
589  ts_ctx->bH, cache_ptr);
590  unset(*lit.second);
591  ts_ctx->matAssembleSwitch = boost::move(lit.second->matAssembleSwitch);
592  }
593 
594  // post process
595  for (auto &bit : ts_ctx->postProcessIJacobian) {
596  bit->matAssembleSwitch = boost::move(ts_ctx->matAssembleSwitch);
597  set(*bit);
599  *bit);
600  unset(*bit);
601  ts_ctx->matAssembleSwitch = boost::move(bit->matAssembleSwitch);
602  }
603 
604  if (*(ts_ctx->matAssembleSwitch)) {
605  CHKERR MatAssemblyBegin(B, MAT_FINAL_ASSEMBLY);
606  CHKERR MatAssemblyEnd(B, MAT_FINAL_ASSEMBLY);
607  }
608  PetscLogEventEnd(ts_ctx->MOFEM_EVENT_TsCtxI2Function, 0, 0, 0, 0);
610 }

◆ TsSetIFunction()

PetscErrorCode MoFEM::TsSetIFunction ( TS  ts,
PetscReal  t,
Vec  u,
Vec  u_t,
Vec  F,
void *  ctx 
)

Set IFunction for TS solver.

See petsc for details

Parameters
ts
t
u
u_t
F
ctx
Returns
PetscErrorCode
Examples
free_surface.cpp, and nonlinear_dynamics.cpp.

Definition at line 56 of file TsCtx.cpp.

57  {
59  TsCtx *ts_ctx = static_cast<TsCtx *>(ctx);
60  PetscLogEventBegin(ts_ctx->MOFEM_EVENT_TsCtxIFunction, 0, 0, 0, 0);
61  CHKERR VecGhostUpdateBegin(u, INSERT_VALUES, SCATTER_FORWARD);
62  CHKERR VecGhostUpdateEnd(u, INSERT_VALUES, SCATTER_FORWARD);
63  CHKERR VecGhostUpdateBegin(u_t, INSERT_VALUES, SCATTER_FORWARD);
64  CHKERR VecGhostUpdateEnd(u_t, INSERT_VALUES, SCATTER_FORWARD);
65  CHKERR ts_ctx->mField.getInterface<VecManager>()->setLocalGhostVector(
66  ts_ctx->problemName, COL, u, INSERT_VALUES, SCATTER_REVERSE);
67 
68  auto zero_ghost_vec = [](Vec g) {
70  Vec l;
71  CHKERR VecGhostGetLocalForm(g, &l);
72  double *a;
73  CHKERR VecGetArray(l, &a);
74  int s;
75  CHKERR VecGetLocalSize(l, &s);
76  for (int i = 0; i != s; ++i)
77  a[i] = 0;
78  CHKERR VecRestoreArray(l, &a);
79  CHKERR VecGhostRestoreLocalForm(g, &l);
81  };
82  CHKERR zero_ghost_vec(F);
83 
84  ts_ctx->vecAssembleSwitch = boost::movelib::make_unique<bool>(true);
85 
86  int step;
87 #if PETSC_VERSION_GE(3, 8, 0)
88  CHKERR TSGetStepNumber(ts, &step);
89 #else
90  CHKERR TSGetTimeStepNumber(ts, &step);
91 #endif
92 
93  auto cache_ptr = boost::make_shared<CacheTuple>();
95 
96  auto set = [&](auto &fe) {
97  fe.ts = ts;
98  fe.ts_u = u;
99  fe.ts_u_t = u_t;
100  fe.ts_F = F;
101  fe.ts_t = t;
102  fe.ts_step = step;
103  fe.ts_ctx = TSMethod::CTX_TSSETIFUNCTION;
104  fe.snes_ctx = SnesMethod::CTX_SNESSETFUNCTION;
105  fe.ksp_ctx = KspMethod::CTX_SETFUNCTION;
106  fe.data_ctx = PetscData::CtxSetF | PetscData::CtxSetX |
107  PetscData::CtxSetX_T | PetscData::CtxSetTime;
108 
109  CHKERR TSGetSNES(ts, &fe.snes);
110  CHKERR SNESGetKSP(fe.snes, &fe.ksp);
111 
112  fe.cacheWeakPtr = cache_ptr;
113  CHK_THROW_MESSAGE(TSGetTimeStep(ts, &fe.ts_dt), "get time step failed");
114  };
115 
116  auto unset = [&](auto &fe) {
117  fe.ts_ctx = TSMethod::CTX_TSNONE;
118  fe.snes_ctx = SnesMethod::CTX_SNESNONE;
119  fe.ksp_ctx = KspMethod::CTX_KSPNONE;
120  fe.data_ctx = PetscData::CtxSetNone;
121  };
122 
123  // preprocess
124  for (auto &bit : ts_ctx->preProcessIFunction) {
125  bit->vecAssembleSwitch = boost::move(ts_ctx->vecAssembleSwitch);
126  set(*bit);
128  *bit);
129  unset(*bit);
130  ts_ctx->vecAssembleSwitch = boost::move(bit->vecAssembleSwitch);
131  }
132 
133  // fe loops
134  for (auto &lit : ts_ctx->loopsIFunction) {
135  lit.second->vecAssembleSwitch = boost::move(ts_ctx->vecAssembleSwitch);
136  set(*lit.second);
138  *(lit.second), nullptr,
139  ts_ctx->bH, cache_ptr);
140  unset(*lit.second);
141  ts_ctx->vecAssembleSwitch = boost::move(lit.second->vecAssembleSwitch);
142  }
143 
144  // post process
145  for (auto &bit : ts_ctx->postProcessIFunction) {
146  bit->vecAssembleSwitch = boost::move(ts_ctx->vecAssembleSwitch);
147  set(*bit);
149  *bit);
150  unset(*bit);
151  ts_ctx->vecAssembleSwitch = boost::move(bit->vecAssembleSwitch);
152  }
153 
154  if (*ts_ctx->vecAssembleSwitch) {
155  CHKERR VecGhostUpdateBegin(F, ADD_VALUES, SCATTER_REVERSE);
156  CHKERR VecGhostUpdateEnd(F, ADD_VALUES, SCATTER_REVERSE);
157  CHKERR VecAssemblyBegin(F);
158  CHKERR VecAssemblyEnd(F);
159  }
160 
161  PetscLogEventEnd(ts_ctx->MOFEM_EVENT_TsCtxIFunction, 0, 0, 0, 0);
163 }

◆ TsSetIJacobian()

PetscErrorCode MoFEM::TsSetIJacobian ( TS  ts,
PetscReal  t,
Vec  u,
Vec  u_t,
PetscReal  a,
Mat  A,
Mat  B,
void *  ctx 
)

Set function evaluating jacobian in TS solver.

See PETSc for details

Parameters
ts
t
u
u_t
a
A
B
ctx
Returns
PetscErrorCode
Examples
free_surface.cpp, heat_equation.cpp, level_set.cpp, nonlinear_dynamics.cpp, and plastic.cpp.

Definition at line 165 of file TsCtx.cpp.

166  {
168 
169  TsCtx *ts_ctx = static_cast<TsCtx *>(ctx);
170  PetscLogEventBegin(ts_ctx->MOFEM_EVENT_TsCtxIFunction, 0, 0, 0, 0);
171  CHKERR VecGhostUpdateBegin(u, INSERT_VALUES, SCATTER_FORWARD);
172  CHKERR VecGhostUpdateEnd(u, INSERT_VALUES, SCATTER_FORWARD);
173  CHKERR VecGhostUpdateBegin(u_t, INSERT_VALUES, SCATTER_FORWARD);
174  CHKERR VecGhostUpdateEnd(u_t, INSERT_VALUES, SCATTER_FORWARD);
175  CHKERR ts_ctx->mField.getInterface<VecManager>()->setLocalGhostVector(
176  ts_ctx->problemName, COL, u, INSERT_VALUES, SCATTER_REVERSE);
177  if (ts_ctx->zeroMatrix) {
178  CHKERR MatZeroEntries(B);
179  }
180  int step;
181 #if PETSC_VERSION_GE(3, 8, 0)
182  CHKERR TSGetStepNumber(ts, &step);
183 #else
184  CHKERR TSGetTimeStepNumber(ts, &step);
185 #endif
186 
188  boost::movelib::make_unique<bool>(ts_ctx->zeroMatrix);
189  auto cache_ptr = boost::make_shared<CacheTuple>();
191 
192  auto set = [&](auto &fe) {
193  fe.ts = ts;
194  fe.ts_u = u;
195  fe.ts_u_t = u_t;
196  fe.ts_A = A;
197  fe.ts_B = B;
198  fe.ts_t = t;
199  fe.ts_a = a;
200  fe.ts_step = step;
201  fe.ts_ctx = TSMethod::CTX_TSSETIJACOBIAN;
202  fe.snes_ctx = SnesMethod::CTX_SNESSETJACOBIAN;
203  fe.ksp_ctx = KspMethod::CTX_OPERATORS;
204  fe.data_ctx = PetscData::CtxSetA | PetscData::CtxSetB | PetscData::CtxSetX |
205  PetscData::CtxSetX_T | PetscData::CtxSetTime;
206 
207  CHKERR TSGetSNES(ts, &fe.snes);
208  CHKERR SNESGetKSP(fe.snes, &fe.ksp);
209 
210  fe.cacheWeakPtr = cache_ptr;
211  CHK_THROW_MESSAGE(TSGetTimeStep(ts, &fe.ts_dt), "get time step failed");
212  };
213 
214  auto unset = [&](auto &fe) {
215  fe.ts_ctx = TSMethod::CTX_TSNONE;
216  fe.snes_ctx = SnesMethod::CTX_SNESNONE;
217  fe.ksp_ctx = KspMethod::CTX_KSPNONE;
218  fe.data_ctx = PetscData::CtxSetNone;
219  };
220 
221  // preproces
222  for (auto &bit : ts_ctx->preProcessIJacobian) {
223  bit->matAssembleSwitch = boost::move(ts_ctx->matAssembleSwitch);
224  set(*bit);
226  *bit);
227  unset(*bit);
228  ts_ctx->matAssembleSwitch = boost::move(bit->matAssembleSwitch);
229  }
230 
231  for (auto &lit : ts_ctx->loopsIJacobian) {
232  lit.second->matAssembleSwitch = boost::move(ts_ctx->matAssembleSwitch);
233  set(*lit.second);
235  *(lit.second), nullptr,
236  ts_ctx->bH, cache_ptr);
237  unset(*lit.second);
238  ts_ctx->matAssembleSwitch = boost::move(lit.second->matAssembleSwitch);
239  }
240 
241  // post process
242  for (auto &bit : ts_ctx->postProcessIJacobian) {
243  bit->matAssembleSwitch = boost::move(ts_ctx->matAssembleSwitch);
244  set(*bit);
246  *bit);
247  unset(*bit);
248  ts_ctx->matAssembleSwitch = boost::move(bit->matAssembleSwitch);
249  }
250 
251  if (*(ts_ctx->matAssembleSwitch)) {
252  CHKERR MatAssemblyBegin(B, MAT_FINAL_ASSEMBLY);
253  CHKERR MatAssemblyEnd(B, MAT_FINAL_ASSEMBLY);
254  }
255  PetscLogEventEnd(ts_ctx->MOFEM_EVENT_TsCtxIFunction, 0, 0, 0, 0);
257 }

◆ TsSetRHSFunction()

PetscErrorCode MoFEM::TsSetRHSFunction ( TS  ts,
PetscReal  t,
Vec  u,
Vec  F,
void *  ctx 
)

TS solver function.

See PETSc for details

Parameters
ts
t
u
F
ctx
Returns
PetscErrorCode

Definition at line 323 of file TsCtx.cpp.

323  {
325  TsCtx *ts_ctx = static_cast<TsCtx *>(ctx);
326  PetscLogEventBegin(ts_ctx->MOFEM_EVENT_TsCtxRHSFunction, 0, 0, 0, 0);
327  CHKERR VecGhostUpdateBegin(u, INSERT_VALUES, SCATTER_FORWARD);
328  CHKERR VecGhostUpdateEnd(u, INSERT_VALUES, SCATTER_FORWARD);
329  CHKERR ts_ctx->mField.getInterface<VecManager>()->setLocalGhostVector(
330  ts_ctx->problemName, COL, u, INSERT_VALUES, SCATTER_REVERSE);
331 
332  auto zero_ghost_vec = [](Vec g) {
334  Vec l;
335  CHKERR VecGhostGetLocalForm(g, &l);
336  double *a;
337  CHKERR VecGetArray(l, &a);
338  int s;
339  CHKERR VecGetLocalSize(l, &s);
340  for (int i = 0; i != s; ++i)
341  a[i] = 0;
342  CHKERR VecRestoreArray(l, &a);
343  CHKERR VecGhostRestoreLocalForm(g, &l);
345  };
346  CHKERR zero_ghost_vec(F);
347 
348  ts_ctx->vecAssembleSwitch = boost::movelib::make_unique<bool>(true);
349  auto cache_ptr = boost::make_shared<CacheTuple>();
351 
352  int step;
353 #if PETSC_VERSION_GE(3, 8, 0)
354  CHKERR TSGetStepNumber(ts, &step);
355 #else
356  CHKERR TSGetTimeStepNumber(ts, &step);
357 #endif
358 
359  auto set = [&](auto &fe) {
360  fe.ts_u = u;
361  fe.ts_F = F;
362  fe.ts_t = t;
363  fe.ts = ts;
364  fe.ts_step = step;
365  fe.ts_ctx = TSMethod::CTX_TSSETRHSFUNCTION;
366  fe.snes_ctx = SnesMethod::CTX_SNESSETFUNCTION;
367  fe.ksp_ctx = KspMethod::CTX_SETFUNCTION;
368  fe.data_ctx =
369  PetscData::CtxSetF | PetscData::CtxSetX | PetscData::CtxSetTime;
370  fe.cacheWeakPtr = cache_ptr;
371  CHK_THROW_MESSAGE(TSGetTimeStep(ts, &fe.ts_dt), "get time step failed");
372  };
373 
374  auto unset = [&](auto &fe) {
375  fe.ts_ctx = TSMethod::CTX_TSNONE;
376  fe.snes_ctx = SnesMethod::CTX_SNESNONE;
377  fe.ksp_ctx = KspMethod::CTX_KSPNONE;
378  fe.data_ctx = PetscData::CtxSetNone;
379  };
380 
381  for (auto &bit : ts_ctx->preProcessRHSFunction) {
382  bit->vecAssembleSwitch = boost::move(ts_ctx->vecAssembleSwitch);
383  set(*bit);
385  *bit);
386  unset(*bit);
387  ts_ctx->vecAssembleSwitch = boost::move(bit->vecAssembleSwitch);
388  }
389 
390  // fe loops
391  for (auto &lit : ts_ctx->loopsRHSFunction) {
392  lit.second->vecAssembleSwitch = boost::move(ts_ctx->vecAssembleSwitch);
393  set(*lit.second);
395  *(lit.second), nullptr,
396  ts_ctx->bH, cache_ptr);
397  unset(*lit.second);
398  ts_ctx->vecAssembleSwitch = boost::move(lit.second->vecAssembleSwitch);
399  }
400 
401  // post process
402  for (auto &bit : ts_ctx->postProcessRHSFunction) {
403  bit->vecAssembleSwitch = boost::move(ts_ctx->vecAssembleSwitch);
404  set(*bit);
406  *bit);
407  unset(*bit);
408  ts_ctx->vecAssembleSwitch = boost::move(bit->vecAssembleSwitch);
409  }
410 
411  if (*ts_ctx->vecAssembleSwitch) {
412  CHKERR VecGhostUpdateBegin(F, ADD_VALUES, SCATTER_REVERSE);
413  CHKERR VecGhostUpdateEnd(F, ADD_VALUES, SCATTER_REVERSE);
414  CHKERR VecAssemblyBegin(F);
415  CHKERR VecAssemblyEnd(F);
416  }
417 
418  PetscLogEventEnd(ts_ctx->MOFEM_EVENT_TsCtxRHSFunction, 0, 0, 0, 0);
420 }

◆ TsSetRHSJacobian()

PetscErrorCode MoFEM::TsSetRHSJacobian ( TS  ts,
PetscReal  t,
Vec  u,
Mat  A,
Mat  B,
void *  ctx 
)

TS solver function.

See PETSc for details

Parameters
ts
t
u
A
B
ctx
Returns
PetscErrorCode

Definition at line 422 of file TsCtx.cpp.

423  {
425  TsCtx *ts_ctx = static_cast<TsCtx *>(ctx);
426  PetscLogEventBegin(ts_ctx->MOFEM_EVENT_TsCtxRHSJacobian, 0, 0, 0, 0);
427  CHKERR VecGhostUpdateBegin(u, INSERT_VALUES, SCATTER_FORWARD);
428  CHKERR VecGhostUpdateEnd(u, INSERT_VALUES, SCATTER_FORWARD);
429  CHKERR ts_ctx->mField.getInterface<VecManager>()->setLocalGhostVector(
430  ts_ctx->problemName, COL, u, INSERT_VALUES, SCATTER_REVERSE);
431 
432  if (ts_ctx->zeroMatrix) {
433  CHKERR MatZeroEntries(B);
434  }
435 
437  boost::movelib::make_unique<bool>(ts_ctx->zeroMatrix);
438  auto cache_ptr = boost::make_shared<CacheTuple>();
440 
441  int step;
442 #if PETSC_VERSION_GE(3, 8, 0)
443  CHKERR TSGetStepNumber(ts, &step);
444 #else
445  CHKERR TSGetTimeStepNumber(ts, &step);
446 #endif
447 
448  auto set = [&](auto &fe) {
449  fe.ts_u = u;
450  fe.ts_A = A;
451  fe.ts_B = B;
452  fe.ts_t = t;
453  fe.ts_step = step;
454  fe.ts_ctx = TSMethod::CTX_TSSETRHSJACOBIAN;
455  fe.snes_ctx = SnesMethod::CTX_SNESSETJACOBIAN;
456  fe.ksp_ctx = KspMethod::CTX_OPERATORS;
457  fe.data_ctx = PetscData::CtxSetA | PetscData::CtxSetB | PetscData::CtxSetX |
458  PetscData::CtxSetTime;
459  fe.ts = ts;
460  fe.cacheWeakPtr = cache_ptr;
461  CHK_THROW_MESSAGE(TSGetTimeStep(ts, &fe.ts_dt), "get time step failed");
462  };
463 
464  auto unset = [&](auto &fe) {
465  fe.ts_ctx = TSMethod::CTX_TSNONE;
466  fe.snes_ctx = SnesMethod::CTX_SNESNONE;
467  fe.ksp_ctx = KspMethod::CTX_KSPNONE;
468  fe.data_ctx = PetscData::CtxSetNone;
469  };
470 
471  // preprocess
472  for (auto &bit : ts_ctx->preProcessRHSJacobian) {
473  bit->matAssembleSwitch = boost::move(ts_ctx->matAssembleSwitch);
474  set(*bit);
476  *bit);
477  unset(*bit);
478  ts_ctx->matAssembleSwitch = boost::move(bit->matAssembleSwitch);
479  }
480 
481  // fe loops
482  for (auto &lit : ts_ctx->loopsRHSJacobian) {
483  lit.second->matAssembleSwitch = boost::move(ts_ctx->matAssembleSwitch);
484  set(*lit.second);
486  *(lit.second), nullptr,
487  ts_ctx->bH, cache_ptr);
488  unset(*lit.second);
489  ts_ctx->matAssembleSwitch = boost::move(lit.second->matAssembleSwitch);
490  }
491 
492  // post process
493  for (auto &bit : ts_ctx->postProcessRHSJacobian) {
494  bit->matAssembleSwitch = boost::move(ts_ctx->matAssembleSwitch);
495  set(*bit);
497  *bit);
498  unset(*bit);
499  ts_ctx->matAssembleSwitch = boost::move(bit->matAssembleSwitch);
500  }
501 
502  if (*(ts_ctx->matAssembleSwitch)) {
503  CHKERR MatAssemblyBegin(B, MAT_FINAL_ASSEMBLY);
504  CHKERR MatAssemblyEnd(B, MAT_FINAL_ASSEMBLY);
505  }
506 
507  PetscLogEventEnd(ts_ctx->MOFEM_EVENT_TsCtxRHSJacobian, 0, 0, 0, 0);
509 }

◆ type_from_handle()

auto MoFEM::type_from_handle ( const EntityHandle  h)
inline

get type from entity handle

Examples
HookeElement.hpp, plastic.cpp, and poisson_2d_homogeneous.cpp.

Definition at line 1898 of file Templates.hpp.

1898  {
1899  return static_cast<EntityType>(h >> MB_ID_WIDTH);
1900 };

◆ type_name_from_handle()

auto MoFEM::type_name_from_handle ( const EntityHandle  h)
inline

get entity type name from handle

Definition at line 1922 of file Templates.hpp.

1922  {
1923  return moab::CN::EntityTypeName(type_from_handle(h));
1924 };

◆ VecSetValues() [1/2]

template<typename T = EntityStorage>
MoFEMErrorCode MoFEM::VecSetValues ( Vec  V,
const EntitiesFieldData::EntData data,
const double ptr,
InsertMode  iora 
)
inline

Assemble PETSc vector.

Function extract indices from entity data and assemble vector

See PETSc documentation

Parameters
V
data
ptr
iora
Returns
MoFEMErrorCode
Examples
child_and_parent.cpp, ContactOps.hpp, hanging_node_approx.cpp, higher_derivatives.cpp, HookeElement.cpp, level_set.cpp, MagneticElement.hpp, mixed_poisson.cpp, NavierStokesElement.cpp, photon_diffusion.cpp, poisson_2d_dis_galerkin.cpp, PoissonDiscontinousGalerkin.hpp, PoissonOperators.hpp, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, reaction_diffusion.cpp, Remodeling.cpp, simple_elasticity.cpp, and UnsaturatedFlow.hpp.

Definition at line 1589 of file EntitiesFieldData.hpp.

1591  {
1592  static_assert(!std::is_same<T, T>::value,
1593  "VecSetValues value for this data storage is not implemented");
1594  return MOFEM_NOT_IMPLEMENTED;
1595 }

◆ VecSetValues() [2/2]

template<typename T = EntityStorage>
MoFEMErrorCode MoFEM::VecSetValues ( Vec  V,
const EntitiesFieldData::EntData data,
const VectorDouble vec,
InsertMode  iora 
)
inline

Assemble PETSc vector.

Function extract indices from entity data and assemble vector

See PETSc documentation

Parameters
V
data
vec
iora
Returns
MoFEMErrorCode

Definition at line 1621 of file EntitiesFieldData.hpp.

1623  {
1624  return VecSetValues<T>(V, data, &*vec.data().begin(), iora);
1625 }

◆ VecSetValues< AssemblyTypeSelector< BLOCK_MAT > >()

template<>
MoFEMErrorCode MoFEM::VecSetValues< AssemblyTypeSelector< BLOCK_MAT > > ( Vec  V,
const EntitiesFieldData::EntData data,
const VectorDouble nf,
InsertMode  iora 
)
inline

Definition at line 249 of file Schur.hpp.

251  {
252  return VecSetValues<EssentialBcStorage>(V, data, nf, iora);
253 }

◆ VecSetValues< AssemblyTypeSelector< BLOCK_PRECONDITIONER_SCHUR > >()

template<>
MoFEMErrorCode MoFEM::VecSetValues< AssemblyTypeSelector< BLOCK_PRECONDITIONER_SCHUR > > ( Vec  V,
const EntitiesFieldData::EntData data,
const VectorDouble nf,
InsertMode  iora 
)
inline

Definition at line 324 of file Schur.hpp.

326  {
327  return ::VecSetValues(V, data.getIndices().size(),
328  &*data.getIndices().begin(), &*nf.begin(), iora);
329 }

◆ VecSetValues< AssemblyTypeSelector< BLOCK_SCHUR > >()

template<>
MoFEMErrorCode MoFEM::VecSetValues< AssemblyTypeSelector< BLOCK_SCHUR > > ( Vec  V,
const EntitiesFieldData::EntData data,
const VectorDouble nf,
InsertMode  iora 
)
inline

Definition at line 290 of file Schur.hpp.

292  {
293  return VecSetValues<EssentialBcStorage>(V, data, nf, iora);
294 }

◆ VecSetValues< AssemblyTypeSelector< PETSC > >()

template<>
MoFEMErrorCode MoFEM::VecSetValues< AssemblyTypeSelector< PETSC > > ( Vec  V,
const EntitiesFieldData::EntData data,
const double ptr,
InsertMode  iora 
)
inline

Definition at line 125 of file FormsIntegrators.hpp.

127  {
128  return VecSetValues<EssentialBcStorage>(V, data, ptr, iora);
129 }

◆ VecSetValues< AssemblyTypeSelector< SCHUR > >()

template<>
MoFEMErrorCode MoFEM::VecSetValues< AssemblyTypeSelector< SCHUR > > ( Vec  V,
const EntitiesFieldData::EntData data,
const VectorDouble nf,
InsertMode  iora 
)
inline

Definition at line 219 of file Schur.hpp.

221  {
222  return VecSetValues<SchurElemMats>(V, data, nf, iora);
223 }

◆ VecSetValues< EntityStorage >()

template<>
MoFEMErrorCode MoFEM::VecSetValues< EntityStorage > ( Vec  V,
const EntitiesFieldData::EntData data,
const double ptr,
InsertMode  iora 
)
inline

Definition at line 1599 of file EntitiesFieldData.hpp.

1600  {
1601  return VecSetValues(V, data.getIndices().size(), &*data.getIndices().begin(),
1602  ptr, iora);
1603 }

◆ VecSetValues< SchurElemMats >()

template<>
MoFEMErrorCode MoFEM::VecSetValues< SchurElemMats > ( Vec  V,
const EntitiesFieldData::EntData data,
const VectorDouble nf,
InsertMode  iora 
)
inline

Definition at line 207 of file Schur.hpp.

208  {
209  return VecSetValues<EssentialBcStorage>(V, data, nf, iora);
210 }

◆ VecSetValues< SchurElemMatsBlock >()

template<>
MoFEMErrorCode MoFEM::VecSetValues< SchurElemMatsBlock > ( Vec  V,
const EntitiesFieldData::EntData data,
const VectorDouble nf,
InsertMode  iora 
)
inline

Definition at line 270 of file Schur.hpp.

271  {
272  return VecSetValues<EssentialBcStorage>(V, data, nf, iora);
273 }

◆ vectorDuplicate()

SmartPetscObj<Vec> MoFEM::vectorDuplicate ( Vec  vec)
inline

◆ zero_rows_columns()

static PetscErrorCode MoFEM::zero_rows_columns ( Mat  A,
PetscInt  N,
const PetscInt  rows[],
PetscScalar  diag,
Vec  x,
Vec  b 
)
static

Definition at line 1230 of file Schur.cpp.

1232  {
1233 
1235  BlockStructure *ctx;
1236  CHKERR MatShellGetContext(A, (void **)&ctx);
1237 
1238  PetscLogEventBegin(SchurEvents::MOFEM_EVENT_zeroRowsAndCols, 0, 0, 0, 0);
1239 
1240  using BlockIndexView = multi_index_container<
1241 
1242  const DiagBlockIndex::Indexes *,
1243 
1244  indexed_by<
1245 
1246  ordered_non_unique<
1247 
1248  const_mem_fun<DiagBlockIndex::Indexes, int,
1249  &DiagBlockIndex::Indexes::rowShift>
1250 
1251  >,
1252 
1253  ordered_non_unique<
1254 
1255  const_mem_fun<DiagBlockIndex::Indexes, int,
1256  &DiagBlockIndex::Indexes::colShift>
1257 
1258  >
1259 
1260  >>;
1261 
1262  BlockIndexView view;
1263  auto hint = view.get<0>().end();
1264  for (auto &v : ctx->blockIndex) {
1265  hint = view.insert(hint, &v);
1266  }
1267 
1268  const int *ptr = &rows[0];
1269  int is_nb_rows = N;
1270  SmartPetscObj<IS> is_local;
1271 
1272  MPI_Comm comm;
1273  CHKERR PetscObjectGetComm((PetscObject)A, &comm);
1274  int size;
1275  MPI_Comm_size(comm, &size);
1276  if (size > 1) {
1277  auto is = createISGeneral(comm, N, rows, PETSC_USE_POINTER);
1278  is_local = isAllGather(is);
1279  }
1280  if (is_local) {
1281  CHKERR ISGetSize(is_local, &is_nb_rows);
1282 #ifndef NDEBUG
1283  if constexpr (debug_schur) {
1284  CHKERR ISView(is_local, PETSC_VIEWER_STDOUT_WORLD);
1285  }
1286 #endif
1287  CHKERR ISGetIndices(is_local, &ptr);
1288  }
1289 
1290  int loc_m, loc_n;
1291  CHKERR MatGetLocalSize(A, &loc_m, &loc_n);
1292 
1293  for (auto n = 0; n != is_nb_rows; ++n) {
1294  auto row = ptr[n];
1295  auto rlo = view.get<0>().lower_bound(row);
1296  auto rhi = view.get<0>().end();
1297  for (; rlo != rhi; ++rlo) {
1298  auto r_shift = row - (*rlo)->getRow();
1299  if (r_shift >= 0 && r_shift < (*rlo)->getNbRows()) {
1300  auto *ptr = &(*ctx->dataBlocksPtr)[(*rlo)->getMatShift()];
1301  for (auto i = 0; i != (*rlo)->getNbCols(); ++i) {
1302  ptr[i + r_shift * (*rlo)->getNbCols()] = 0;
1303  }
1304  } else if ((*rlo)->getRow() + (*rlo)->getNbRows() > row) {
1305  break;
1306  }
1307  }
1308  }
1309 
1310  for (auto n = 0; n != is_nb_rows; ++n) {
1311  auto col = ptr[n];
1312  auto clo = view.get<1>().lower_bound(col);
1313  auto chi = view.get<1>().end();
1314  for (; clo != chi; ++clo) {
1315  auto c_shift = col - (*clo)->getCol();
1316  if (c_shift >= 0 && c_shift < (*clo)->getNbCols()) {
1317 
1318  auto *ptr = &(*ctx->dataBlocksPtr)[(*clo)->getMatShift()];
1319  for (auto i = 0; i != (*clo)->getNbRows(); ++i) {
1320  ptr[c_shift + i * (*clo)->getNbCols()] = 0;
1321  }
1322 
1323  // diagonal
1324  if (
1325 
1326  (*clo)->getRow() == (*clo)->getCol() &&
1327  (*clo)->getLocRow() < loc_m && (*clo)->getLocCol() < loc_n
1328 
1329  ) {
1330  auto r_shift = col - (*clo)->getCol();
1331  if (r_shift >= 0 && r_shift < (*clo)->getNbRows()) {
1332  ptr[c_shift + r_shift * (*clo)->getNbCols()] = diag;
1333  }
1334  }
1335  } else if ((*clo)->getCol() + (*clo)->getNbCols() > col) {
1336  break;
1337  }
1338  }
1339  }
1340 
1341  if (is_local) {
1342  CHKERR ISRestoreIndices(is_local, &ptr);
1343  }
1344 
1345  PetscLogEventEnd(SchurEvents::MOFEM_EVENT_zeroRowsAndCols, 0, 0, 0, 0);
1346 
1348 }

Variable Documentation

◆ cyclic_edge_rotate_face_3

constexpr int MoFEM::cyclic_edge_rotate_face_3[3][6]
staticconstexpr
Initial value:
= {
{4, 0, 3, 5, 1, 2}, {0, 1, 2, 3, 4, 5}, {1, 4, 5, 2, 0, 3}}

Definition at line 27 of file EntityRefine.cpp.

◆ cyclic_node_rotate_face_3

constexpr int MoFEM::cyclic_node_rotate_face_3[3][4]
staticconstexpr
Initial value:
= {
{3, 1, 0, 2}, {0, 1, 2, 3}, {2, 1, 3, 0}}

Definition at line 25 of file EntityRefine.cpp.

◆ DataForcesAndSourcesCore

DEPRECATED typedef EntitiesFieldData MoFEM::DataForcesAndSourcesCore
Deprecated:
Use EntitiesFieldData

Definition at line 1789 of file EntitiesFieldData.hpp.

◆ debug_schur

constexpr bool MoFEM::debug_schur = false
constexpr

Definition at line 12 of file Schur.cpp.

◆ DerivedDataForcesAndSourcesCore

DEPRECATED typedef DerivedEntitiesFieldData MoFEM::DerivedDataForcesAndSourcesCore

◆ dummy_file

char MoFEM::dummy_file
static

Definition at line 356 of file LogManager.cpp.

◆ edge_bits_mark

constexpr char MoFEM::edge_bits_mark[] = {1, 2, 4, 8, 16, 32}
staticconstexpr

Definition at line 29 of file EntityRefine.cpp.

◆ edge_mirror_cross

constexpr int MoFEM::edge_mirror_cross[6] = {0, 3, 4, 1, 2, 5}
staticconstexpr

Definition at line 23 of file EntityRefine.cpp.

◆ edge_mirror_vertical

constexpr int MoFEM::edge_mirror_vertical[6] = {0, 4, 3, 2, 1, 5}
staticconstexpr

Definition at line 24 of file EntityRefine.cpp.

◆ edge_permutations

constexpr int MoFEM::edge_permutations[6][6]
staticconstexpr
Initial value:
= {
{0, 1, 2, 3, 4, 5}, {1, 2, 0, 4, 5, 3}, {2, 0, 1, 5, 3, 4},
{3, 4, 0, 2, 5, 1}, {4, 5, 1, 0, 3, 2}, {5, 3, 2, 1, 4, 0}}

Definition at line 20 of file EntityRefine.cpp.

◆ EdgeElementForcesAndSourcesCoreBase

DEPRECATED typedef EdgeElementForcesAndSourcesCore MoFEM::EdgeElementForcesAndSourcesCoreBase

◆ edges_conn

constexpr int MoFEM::edges_conn[] = {0, 1, 1, 2, 2, 0, 0, 3, 1, 3, 2, 3}
staticconstexpr

Definition at line 18 of file EntityRefine.cpp.

◆ EntMethod

DEPRECATED typedef DofMethod MoFEM::EntMethod
Deprecated:
name changed use DofMethod insead EntMethod

Definition at line 510 of file LoopMethods.hpp.

◆ FaceElementForcesAndSourcesCoreBase

DEPRECATED typedef FaceElementForcesAndSourcesCore MoFEM::FaceElementForcesAndSourcesCoreBase

◆ field_it

Field_multiIndex::index<FieldName_mi_tag>::type::iterator MoFEM::field_it

Definition at line 123 of file Projection10NodeCoordsOnField.cpp.

◆ FlatPrismElementForcesAndSurcesCore

DEPRECATED typedef FlatPrismElementForcesAndSourcesCore MoFEM::FlatPrismElementForcesAndSurcesCore

◆ ForcesAndSurcesCore

DEPRECATED typedef ForcesAndSourcesCore MoFEM::ForcesAndSurcesCore
Deprecated:
Used ForcesAndSourcesCore instead

Definition at line 997 of file ForcesAndSourcesCore.hpp.

◆ K

VectorDouble MoFEM::K

◆ L

VectorDouble MoFEM::L

◆ max_gemv_size

constexpr int MoFEM::max_gemv_size = 2
constexpr

Definition at line 1413 of file Schur.cpp.

◆ MoFEM_BLOCK_MAT

constexpr const char MoFEM::MoFEM_BLOCK_MAT[] = "mofem_block_mat"
constexpr

Definition at line 21 of file Schur.hpp.

◆ no_handle

const EntityHandle MoFEM::no_handle
Initial value:
=
0

No entity handle is indicated by zero handle, i.e. root meshset.

Definition at line 12 of file Common.hpp.

◆ oposite_edge

constexpr int MoFEM::oposite_edge[] = {5, 3, 4, 1, 2, 0}
staticconstexpr

Definition at line 19 of file EntityRefine.cpp.

◆ th

Tag MoFEM::th

◆ VolumeElementForcesAndSourcesCoreBase

DEPRECATED typedef VolumeElementForcesAndSourcesCore MoFEM::VolumeElementForcesAndSourcesCoreBase

◆ VolumeElementForcesAndSourcesCoreOnContactPrismSideBase

DEPRECATED typedef VolumeElementForcesAndSourcesCoreOnContactPrismSide MoFEM::VolumeElementForcesAndSourcesCoreOnContactPrismSideBase

◆ VolumeElementForcesAndSourcesCoreOnSideBase

DEPRECATED typedef VolumeElementForcesAndSourcesCoreOnSide MoFEM::VolumeElementForcesAndSourcesCoreOnSideBase
MoFEM::TsCtx::preProcessRHSJacobian
BasicMethodsSequence preProcessRHSJacobian
Definition: TsCtx.hpp:40
CubitBCNames
const static char *const CubitBCNames[]
Names of types of sets and boundary conditions.
Definition: definitions.h:188
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Definition: UnknownInterface.hpp:93
CHK_MOAB_THROW
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:589
MoFEM::KspRhs
PetscErrorCode KspRhs(KSP ksp, Vec f, void *ctx)
Run over elements in the lists.
Definition: KspCtx.cpp:21
NBVOLUMETET_AINSWORTH_FACE_HCURL
#define NBVOLUMETET_AINSWORTH_FACE_HCURL(P)
Definition: h1_hdiv_hcurl_l2.h:101
MoFEM::EntitiesFieldData::EntData
Data on single entity (This is passed as argument to DataOperator::doWork)
Definition: EntitiesFieldData.hpp:128
MoFEM::DMMoFEMGetTsCtx
PetscErrorCode DMMoFEMGetTsCtx(DM dm, const boost::shared_ptr< MoFEM::TsCtx > &ts_ctx)
get MoFEM::TsCtx data structure
Definition: DMMoFEM.cpp:1150
g
constexpr double g
Definition: shallow_wave.cpp:63
omega
constexpr double omega
Save field DOFS on vertices/tags.
Definition: dynamic_first_order_con_law.cpp:93
MoFEM::CoreInterface::problem_basic_method_postProcess
virtual MoFEMErrorCode problem_basic_method_postProcess(const Problem *problem_ptr, BasicMethod &method, int verb=DEFAULT_VERBOSITY)=0
Set data for BasicMethod.
MoFEM::CoreInterface::loop_finite_elements
virtual MoFEMErrorCode loop_finite_elements(const std::string problem_name, const std::string &fe_name, FEMethod &method, boost::shared_ptr< NumeredEntFiniteElement_multiIndex > fe_ptr=nullptr, MoFEMTypes bh=MF_EXIST, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr(), int verb=DEFAULT_VERBOSITY)=0
Make a loop over finite elements.
MoFEM::zero_rows_columns
static PetscErrorCode zero_rows_columns(Mat A, PetscInt N, const PetscInt rows[], PetscScalar diag, Vec x, Vec b)
Definition: Schur.cpp:1230
H1
@ H1
continuous field
Definition: definitions.h:85
MoFEM::MatSetValues
MoFEMErrorCode MatSetValues(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
Assemble PETSc matrix.
Definition: EntitiesFieldData.hpp:1644
MoFEM::PetscOptionsGetScalarArray
PetscErrorCode PetscOptionsGetScalarArray(PetscOptions options, const char pre[], const char name[], PetscScalar dvalue[], PetscInt *nmax, PetscBool *set)
Definition: DeprecatedPetsc.hpp:228
MoFEM::DMMoFEMAddSubFieldCol
PetscErrorCode DMMoFEMAddSubFieldCol(DM dm, const char field_name[])
Definition: DMMoFEM.cpp:280
MOFEM_LOG_SEVERITY_SYNC
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
Definition: LogManager.hpp:352
MoFEM::createISGeneral
auto createISGeneral(MPI_Comm comm, PetscInt n, const PetscInt idx[], PetscCopyMode mode)
Creates a data structure for an index set containing a list of integers.
Definition: PetscSmartObj.hpp:287
MOFEM_STD_EXCEPTION_THROW
@ MOFEM_STD_EXCEPTION_THROW
Definition: definitions.h:39
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
MoFEM::createOpSchurAssembleEnd
OpSchurAssembleBase * createOpSchurAssembleEnd(std::vector< std::string > fields_name, std::vector< boost::shared_ptr< Range >> field_ents, std::vector< SmartPetscObj< AO >> sequence_of_aos, std::vector< SmartPetscObj< Mat >> sequence_of_mats, std::vector< bool > sym_schur, std::vector< double > diag_eps, bool symm_op, boost::shared_ptr< BlockStructure > diag_blocks)
Definition: Schur.cpp:2211
MOFEM_LOG_CHANNEL
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Definition: LogManager.hpp:284
EntityHandle
HVEC0_2
@ HVEC0_2
Definition: definitions.h:211
NBVOLUMETET_DEMKOWICZ_HCURL
#define NBVOLUMETET_DEMKOWICZ_HCURL(P)
Definition: h1_hdiv_hcurl_l2.h:110
lapack_dgetri
static __CLPK_integer lapack_dgetri(__CLPK_integer n, __CLPK_doublereal *a, __CLPK_integer lda, __CLPK_integer *ipiv, __CLPK_doublereal *work, __CLPK_integer lwork)
Definition: lapack_wrap.h:185
MoFEM::FEMethod
structure for User Loop Methods on finite elements
Definition: LoopMethods.hpp:369
MoFEM::solve_schur_block_shell
static MoFEMErrorCode solve_schur_block_shell(Mat mat, Vec y, Vec x, InsertMode iora)
Definition: Schur.cpp:1599
FTensor::row_major
@ row_major
Definition: Layout.hpp:13
MoFEM::VecSetValues
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const VectorDouble &vec, InsertMode iora)
Assemble PETSc vector.
Definition: EntitiesFieldData.hpp:1621
MoFEM::MatSetValues< BlockStructure >
MoFEMErrorCode MatSetValues< BlockStructure >(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora)
Definition: Schur.cpp:2293
MoFEM::TsSetIFunction
PetscErrorCode TsSetIFunction(TS ts, PetscReal t, Vec u, Vec u_t, Vec F, void *ctx)
Set IFunction for TS solver.
Definition: TsCtx.cpp:56
HcurlFaceBase
Definition: Hcurl.cpp:2176
MoFEM::cmp_uid_hi
static auto cmp_uid_hi(const UId &b, const boost::weak_ptr< FieldEntity > &a)
Definition: ForcesAndSourcesCore.cpp:29
MoFEM::TSAdaptDestroyMoFEM
PetscErrorCode TSAdaptDestroyMoFEM(TSAdapt adapt)
Definition: TsCtx.cpp:791
MoFEM::Exceptions::MoFEMException
Exception to catch.
Definition: Exceptions.hpp:20
CHK_THROW_MESSAGE
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
Definition: definitions.h:609
MoFEM::edge_mirror_cross
static constexpr int edge_mirror_cross[6]
Definition: EntityRefine.cpp:23
MoFEM::getDMKspCtx
auto getDMKspCtx(DM dm)
Get KSP context data structure used by DM.
Definition: DMMoFEM.hpp:1113
L2
@ L2
field with C-1 continuity
Definition: definitions.h:88
NBFACETRI_AINSWORTH_EDGE_HDIV
#define NBFACETRI_AINSWORTH_EDGE_HDIV(P)
Definition: h1_hdiv_hcurl_l2.h:130
MoFEM::Hdiv_Ainsworth_EdgeFaceShapeFunctions_MBTET_ON_FACE
MoFEMErrorCode Hdiv_Ainsworth_EdgeFaceShapeFunctions_MBTET_ON_FACE(int *faces_nodes, int p, double *N, double *diffN, double *phi_f_e[3], double *diff_phi_f_e[3], int gdim, int nb, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
Hdiv base functions, Edge-based face functions by Ainsworth .
Definition: Hdiv.cpp:47
MoFEM::shell_block_mat_asmb_wrap_impl
MoFEMErrorCode shell_block_mat_asmb_wrap_impl(BlockStructure *ctx, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora, boost::function< int(const DiagBlockIndex::Indexes *)> shift_extractor, boost::shared_ptr< std::vector< double >> data_blocks_ptr)
Definition: Schur.cpp:1745
phi
static double phi
Definition: poisson_2d_dis_galerkin.cpp:30
MoFEM::TsCtx::MOFEM_EVENT_TsCtxI2Function
PetscLogEvent MOFEM_EVENT_TsCtxI2Function
Definition: TsCtx.hpp:213
MoFEM::TsCtx::MOFEM_EVENT_TsCtxIFunction
PetscLogEvent MOFEM_EVENT_TsCtxIFunction
Definition: TsCtx.hpp:210
MoFEM::solve_add
static PetscErrorCode solve_add(Mat mat, Vec x, Vec y)
Definition: Schur.cpp:1226
lapack_dgesv
static __CLPK_integer lapack_dgesv(__CLPK_integer n, __CLPK_integer nrhs, __CLPK_doublereal *a, __CLPK_integer lda, __CLPK_integer *ipiv, __CLPK_doublereal *b, __CLPK_integer ldb)
Definition: lapack_wrap.h:176
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
HVEC0_1
@ HVEC0_1
Definition: definitions.h:208
MoFEM::oposite_edge
static constexpr int oposite_edge[]
Definition: EntityRefine.cpp:19
MoFEM::DMCreateGlobalVector_MGViaApproxOrders
MoFEMErrorCode DMCreateGlobalVector_MGViaApproxOrders(DM dm, Vec *g)
Create global vector for DMGViaApproxOrders.
Definition: PCMGSetUpViaApproxOrders.cpp:484
MoFEM::th
Tag th
Definition: Projection10NodeCoordsOnField.cpp:122
MoFEM::Types::BitFieldId
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
Definition: Types.hpp:42
NBVOLUMETET_AINSWORTH_FACE_HDIV
#define NBVOLUMETET_AINSWORTH_FACE_HDIV(P)
Definition: h1_hdiv_hcurl_l2.h:134
MoFEM::TsCtx::MOFEM_EVENT_TsCtxMonitor
PetscLogEvent MOFEM_EVENT_TsCtxMonitor
Definition: TsCtx.hpp:212
MoFEM::MPC::EQUATION
@ EQUATION
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
MoFEM::Hcurl_Ainsworth_FaceInteriorFunctions_MBTET
MoFEMErrorCode Hcurl_Ainsworth_FaceInteriorFunctions_MBTET(int *faces_nodes, int p, double *N, double *diffN, double *phi_v, double *diff_phi_v, int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
Face base interior function.
Definition: Hcurl.cpp:775
MoFEM::TsSetI2Jacobian
PetscErrorCode TsSetI2Jacobian(TS ts, PetscReal t, Vec u, Vec u_t, Vec u_tt, PetscReal a, PetscReal aa, Mat A, Mat B, void *ctx)
Calculation Jacobian for second order PDE in time.
Definition: TsCtx.cpp:511
MoFEM::TsCtx::vecAssembleSwitch
boost::movelib::unique_ptr< bool > vecAssembleSwitch
Definition: TsCtx.hpp:216
MoFEM::no_handle
const EntityHandle no_handle
No entity handle is indicated by zero handle, i.e. root meshset.
Definition: Common.hpp:12
FTensor::Tensor2_symmetric
Definition: Tensor2_symmetric_value.hpp:13
FTENSOR_INDEX
#define FTENSOR_INDEX(DIM, I)
Definition: Templates.hpp:2011
HVEC0_0
@ HVEC0_0
Definition: definitions.h:205
FTensor::levi_civita
constexpr std::enable_if<(Dim0<=2 &&Dim1<=2), Tensor2_Expr< Levi_Civita< T >, T, Dim0, Dim1, i, j > >::type levi_civita(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
levi_civita functions to make for easy adhoc use
Definition: Levi_Civita.hpp:617
HVEC1_1
@ HVEC1_1
Definition: definitions.h:209
GET_DM_FIELD
#define GET_DM_FIELD(DM)
Definition: PCMGSetUpViaApproxOrders.cpp:214
ts_ctx
MoFEM::TsCtx * ts_ctx
Definition: level_set.cpp:1932
MoFEM::TsCtx::loopsIJacobian
FEMethodsSequence loopsIJacobian
Definition: TsCtx.hpp:29
MoFEM::VecSetValues
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
Definition: EntitiesFieldData.hpp:1589
HVEC1
@ HVEC1
Definition: definitions.h:199
sdf.r
int r
Definition: sdf.py:8
MoFEM::createDMMatrix
auto createDMMatrix(DM dm)
Get smart matrix from DM.
Definition: DMMoFEM.hpp:1056
FTensor::Tensor2
Definition: Tensor2_value.hpp:16
order
constexpr int order
Definition: dg_projection.cpp:18
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
MoFEM::cyclic_node_rotate_face_3
static constexpr int cyclic_node_rotate_face_3[3][4]
Definition: EntityRefine.cpp:25
MoFEM::Hcurl_Ainsworth_EdgeBasedFaceFunctions_MBTET
MoFEMErrorCode Hcurl_Ainsworth_EdgeBasedFaceFunctions_MBTET(int *faces_nodes, int *p, double *N, double *diffN, double *phi_f_e[4][3], double *diff_phi_f_e[4][3], int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
Face edge base functions of Hcurl space on tetrahedral.
Definition: Hcurl.cpp:363
MoFEM::TsCtx::bH
MoFEMTypes bH
If set to MF_EXIST check if element exist.
Definition: TsCtx.hpp:23
MoFEM::TsCtx::problemName
std::string problemName
Definition: TsCtx.hpp:22
ROW
@ ROW
Definition: definitions.h:136
I
constexpr IntegrationType I
Definition: operators_tests.cpp:31
MoFEM::invertTensor3by3
MoFEMErrorCode invertTensor3by3(ublas::matrix< T, L, A > &jac_data, ublas::vector< T, A > &det_data, ublas::matrix< T, L, A > &inv_jac_data)
Calculate inverse of tensor rank 2 at integration points.
Definition: Templates.hpp:1588
MoFEM::TsCtx::loopsRHSJacobian
FEMethodsSequence loopsRHSJacobian
Definition: TsCtx.hpp:32
MoFEM::debug_schur
constexpr bool debug_schur
Definition: Schur.cpp:12
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:2010
MoFEM::TsMonitorSet
PetscErrorCode TsMonitorSet(TS ts, PetscInt step, PetscReal t, Vec u, void *ctx)
Set monitor for TS solver.
Definition: TsCtx.cpp:259
MoFEM::edge_mirror_vertical
static constexpr int edge_mirror_vertical[6]
Definition: EntityRefine.cpp:24
MoFEM::DMCreateGlobalVector_MoFEM
PetscErrorCode DMCreateGlobalVector_MoFEM(DM dm, Vec *g)
DMShellSetCreateGlobalVector.
Definition: DMMoFEM.cpp:1167
FTensor::Tensor1::data
T data[Tensor_Dim]
Definition: Tensor1_value.hpp:10
MoFEM::TSAdaptResetMoFEM
PetscErrorCode TSAdaptResetMoFEM(TSAdapt adapt)
Definition: TsCtx.cpp:786
c
const double c
speed of light (cm/ns)
Definition: initial_diffusion.cpp:39
HVEC2_1
@ HVEC2_1
Definition: definitions.h:210
MB_TYPE_MASK
#define MB_TYPE_MASK
Definition: definitions.h:241
IntegratedJacobi_polynomials
PetscErrorCode IntegratedJacobi_polynomials(int p, double alpha, double x, double t, double *diff_x, double *diff_t, double *L, double *diffL, const int dim)
Calculate integrated Jacobi approximation basis.
Definition: base_functions.c:134
MoFEM::DMDestroy_MGViaApproxOrders
PetscErrorCode DMDestroy_MGViaApproxOrders(DM dm)
Destroy DM.
Definition: PCMGSetUpViaApproxOrders.cpp:335
MoFEM::edge_bits_mark
static constexpr char edge_bits_mark[]
Definition: EntityRefine.cpp:29
MoFEM::Exceptions::rval
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:74
PlasticOps::M
FTensor::Index< 'M', 3 > M
Definition: PlasticOps.hpp:117
MoFEM::CoreInterface::problem_basic_method_preProcess
virtual MoFEMErrorCode problem_basic_method_preProcess(const Problem *problem_ptr, BasicMethod &method, int verb=DEFAULT_VERBOSITY)=0
Set data for BasicMethod.
MoFEM::TsCtx::postProcessIJacobian
BasicMethodsSequence postProcessIJacobian
Definition: TsCtx.hpp:35
FTensor::Number< 0 >
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
HcurlEdgeBase
Definition: Hcurl.cpp:1978
FTensor::Tensor3
Definition: Tensor3_value.hpp:12
HVEC2_2
@ HVEC2_2
Definition: definitions.h:213
HVEC1_2
@ HVEC1_2
Definition: definitions.h:212
MoFEM::createDMVector
auto createDMVector(DM dm)
Get smart vector from DM.
Definition: DMMoFEM.hpp:1099
MoFEM::createGhostVector
auto createGhostVector(MPI_Comm comm, PetscInt n, PetscInt N, PetscInt nghost, const PetscInt ghosts[])
Create smart ghost vector.
Definition: PetscSmartObj.hpp:179
MoFEM::mult_add
static PetscErrorCode mult_add(Mat mat, Vec x, Vec y)
Definition: Schur.cpp:1211
HcurlEdgeBase::calculate
MoFEMErrorCode calculate(int p, int nb_integration_pts, int n0_idx, int n1_idx, double n[], FTensor::Tensor1< double, 3 > t_grad_n[], FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > &t_phi, FTensor::Tensor2< FTensor::PackPtr< double *, 3 *DIM >, 3, DIM > *t_diff_phi_ptr)
Definition: Hcurl.cpp:1991
MoFEM::DMoFEMLoopFiniteElementsUpAndLowRank
PetscErrorCode DMoFEMLoopFiniteElementsUpAndLowRank(DM dm, const char fe_name[], MoFEM::FEMethod *method, int low_rank, int up_rank, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
Definition: DMMoFEM.cpp:567
MoFEM::mat_zero
static PetscErrorCode mat_zero(Mat m)
Definition: Schur.cpp:1350
MoFEM::edge_permutations
static constexpr int edge_permutations[6][6]
Definition: EntityRefine.cpp:20
MoFEM::DMMoFEMCreateHybridL2Mat
MoFEMErrorCode DMMoFEMCreateHybridL2Mat(DM dm, SmartPetscObj< Mat > &mat)
Create matrix for hybridised system.
Definition: DMMoFEM.cpp:1582
MoFEM::Hcurl_Ainsworth_EdgeBasedFaceFunctions_MBTET_ON_FACE
MoFEMErrorCode Hcurl_Ainsworth_EdgeBasedFaceFunctions_MBTET_ON_FACE(int *faces_nodes, int p, double *N, double *diffN, double *phi_f_e[3], double *diff_phi_f_e[3], int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
Face edge base functions of Hcurl space.
Definition: Hcurl.cpp:458
NBVOLUMETET_AINSWORTH_VOLUME_HDIV
#define NBVOLUMETET_AINSWORTH_VOLUME_HDIV(P)
Definition: h1_hdiv_hcurl_l2.h:135
MoFEM::createDM
auto createDM(MPI_Comm comm, const std::string dm_type_name)
Creates smart DM object.
Definition: PetscSmartObj.hpp:141
a
constexpr double a
Definition: approx_sphere.cpp:30
MoFEM::TsCtx::mField
MoFEM::Interface & mField
Definition: TsCtx.hpp:19
MoFEM::MatSetValues< EssentialBcStorage >
MoFEMErrorCode MatSetValues< EssentialBcStorage >(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
Set values to matrix in operator.
Definition: FormsIntegrators.cpp:112
MoFEM::PetscOptionsGetReal
PetscErrorCode PetscOptionsGetReal(PetscOptions *, const char pre[], const char name[], PetscReal *dval, PetscBool *set)
Definition: DeprecatedPetsc.hpp:152
HcurlFaceBase::calculateOneFamily
MoFEMErrorCode calculateOneFamily(int p, int nb_integration_pts, int n0f0_idx, int n1f0_idx, int n2f0_idx, double n[], FTensor::Tensor1< double, 3 > t_grad_n[], FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > &t_phi, FTensor::Tensor2< FTensor::PackPtr< double *, DIM *3 >, 3, DIM > &t_diff_phi)
Definition: Hcurl.cpp:2186
MoFEM::getVectorAdaptor
auto getVectorAdaptor(T1 ptr, const size_t n)
Get Vector adaptor.
Definition: Templates.hpp:31
MoFEM::getFTensor2HVecFromPtr< 3, 3 >
FTensor::Tensor2< FTensor::PackPtr< double *, 9 >, 3, 3 > getFTensor2HVecFromPtr< 3, 3 >(double *ptr)
Definition: Templates.hpp:968
MoFEM::insertOrdered
moab::Range::iterator insertOrdered(Range &r, Extractor, Iterator begin_iter, Iterator end_iter)
Insert ordered mofem multi-index into range.
Definition: Templates.hpp:1817
MoFEM::DMDestroy_MoFEM
PetscErrorCode DMDestroy_MoFEM(DM dm)
Destroys dm with MoFEM data structure.
Definition: DMMoFEM.cpp:79
MOFEM_LOG_C
#define MOFEM_LOG_C(channel, severity, format,...)
Definition: LogManager.hpp:311
MoFEM::Types::UId
uint128_t UId
Unique Id.
Definition: Types.hpp:31
MoFEM::DMMoFEMTSSetRHSFunction
static PetscErrorCode DMMoFEMTSSetRHSFunction(DM dm, S fe_name, T0 method, T1 pre_only, T2 post_only)
Definition: DMMoFEM.cpp:865
NBFACETRI_DEMKOWICZ_HDIV
#define NBFACETRI_DEMKOWICZ_HDIV(P)
Definition: h1_hdiv_hcurl_l2.h:139
DIM1
constexpr int DIM1
Definition: level_set.cpp:21
double
MoFEM::TsCtx::postProcessMonitor
BasicMethodsSequence postProcessMonitor
Definition: TsCtx.hpp:39
bit
auto bit
set bit
Definition: hanging_node_approx.cpp:75
convert.type
type
Definition: convert.py:64
MoFEM::ksp_set_operators
static MoFEMErrorCode ksp_set_operators(KSP ksp, Mat A, Mat B, void *ctx)
Definition: PCMGSetUpViaApproxOrders.cpp:308
MoFEM::TsCtx::loopsMonitor
FEMethodsSequence loopsMonitor
Definition: TsCtx.hpp:31
MoFEM::getFTensor0FromVec
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
MoFEM::MPC::RIGID_BODY
@ RIGID_BODY
EshelbianPlasticity::P
@ P
Definition: EshelbianContact.cpp:197
MoFEM::mult_schur_block_shell
static MoFEMErrorCode mult_schur_block_shell(Mat mat, Vec x, Vec y, InsertMode iora, boost::function< int(DiagBlockIndex::BlockIndex::nth_index< 0 >::type::iterator)> shift_extractor, boost::shared_ptr< std::vector< double >> data_blocks_ptr, bool multiply_by_preconditioner)
Definition: Schur.cpp:1415
MoFEM::MPC::EMBEDDED_REGION
@ EMBEDDED_REGION
h
double h
Definition: photon_diffusion.cpp:60
MoFEM::DMMoFEMCreateBlockMat
MoFEMErrorCode DMMoFEMCreateBlockMat(DM dm, SmartPetscObj< Mat > &mat)
Create block matrix.
MoFEM::cmp_uid_lo
static auto cmp_uid_lo(const boost::weak_ptr< FieldEntity > &a, const UId &b)
Definition: ForcesAndSourcesCore.cpp:18
COL
@ COL
Definition: definitions.h:136
MoFEM::max_gemv_size
constexpr int max_gemv_size
Definition: Schur.cpp:1413
MoFEM::TsCtx::zeroMatrix
bool zeroMatrix
Definition: TsCtx.hpp:45
MoFEM::DMRegister_MoFEM
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMoFEM.cpp:43
MoFEM::getMatrixAdaptor
auto getMatrixAdaptor(T1 ptr, const size_t n, const size_t m)
Get Matrix adaptor.
Definition: Templates.hpp:57
MoFEM::CoreInterface::cache_problem_entities
virtual MoFEMErrorCode cache_problem_entities(const std::string prb_name, CacheTupleWeakPtr cache_ptr)=0
Cache variables.
NBVOLUMETET_DEMKOWICZ_HDIV
#define NBVOLUMETET_DEMKOWICZ_HDIV(P)
Definition: h1_hdiv_hcurl_l2.h:140
MoFEM::TsCtx::matAssembleSwitch
boost::movelib::unique_ptr< bool > matAssembleSwitch
Definition: TsCtx.hpp:217
MoFEM::TsCtx::preProcessMonitor
BasicMethodsSequence preProcessMonitor
Definition: TsCtx.hpp:38
MoFEM::TsCtx::postProcessIFunction
BasicMethodsSequence postProcessIFunction
Definition: TsCtx.hpp:37
MoFEM::TsCtx::MOFEM_EVENT_TsCtxRHSFunction
PetscLogEvent MOFEM_EVENT_TsCtxRHSFunction
Definition: TsCtx.hpp:208
lapack_dgetrf
static __CLPK_integer lapack_dgetrf(__CLPK_integer m, __CLPK_integer n, __CLPK_doublereal *a, __CLPK_integer lda, __CLPK_integer *ipiv)
Definition: lapack_wrap.h:157
MoFEM::solve
static PetscErrorCode solve(Mat mat, Vec x, Vec y)
Definition: Schur.cpp:1223
FTensor::PackPtr
Definition: FTensor.hpp:54
MoFEM::TsCtx::preProcessIFunction
BasicMethodsSequence preProcessIFunction
Definition: TsCtx.hpp:36
MoFEM::TsCtx::loopsIFunction
FEMethodsSequence loopsIFunction
Definition: TsCtx.hpp:30
MoFEM::L
VectorDouble L
Definition: Projection10NodeCoordsOnField.cpp:124
MoFEM::TsSetIJacobian
PetscErrorCode TsSetIJacobian(TS ts, PetscReal t, Vec u, Vec u_t, PetscReal a, Mat A, Mat B, void *ctx)
Set function evaluating jacobian in TS solver.
Definition: TsCtx.cpp:165
MoFEM::TsCtx::preProcessIJacobian
BasicMethodsSequence preProcessIJacobian
Definition: TsCtx.hpp:34
HcurlFaceBase::calculateTwoFamily
MoFEMErrorCode calculateTwoFamily(int p, int nb_integration_pts, int n0f0_idx, int n1f0_idx, int n2f0_idx, int n0f1_idx, int n1f1_idx, int n2f1_idx, double n[], FTensor::Tensor1< double, 3 > t_grad_n[], FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > &t_phi, FTensor::Tensor2< FTensor::PackPtr< double *, 3 *DIM >, 3, DIM > &t_diff_phi)
Definition: Hcurl.cpp:2266
TSADAPTMOFEM
#define TSADAPTMOFEM
Definition: TsCtx.hpp:10
MOFEM_OPERATION_UNSUCCESSFUL
@ MOFEM_OPERATION_UNSUCCESSFUL
Definition: definitions.h:34
MoFEM::type_from_handle
auto type_from_handle(const EntityHandle h)
get type from entity handle
Definition: Templates.hpp:1898
MB_ID_WIDTH
#define MB_ID_WIDTH
Definition: definitions.h:240
MoFEM::MPC::TIE
@ TIE
MoFEM::mult
static PetscErrorCode mult(Mat mat, Vec x, Vec y)
Definition: Schur.cpp:1199
MoFEM::createSchurNestedMatrix
std::pair< SmartPetscObj< Mat >, boost::shared_ptr< NestSchurData > > createSchurNestedMatrix(boost::shared_ptr< NestSchurData > schur_net_data_ptr)
Create a Mat Diag Blocks object.
Definition: Schur.cpp:2153
MoFEM::BasicMethod
Data structure to exchange data between mofem and User Loop Methods.
Definition: LoopMethods.hpp:183
MOFEM_LOG_TAG
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:339
MoFEM::MatSetValues< SchurElemMatsPreconditionedBlock >
MoFEMErrorCode MatSetValues< SchurElemMatsPreconditionedBlock >(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora)
Definition: Schur.cpp:2356
MoFEM::Hdiv_Ainsworth_FaceBubbleShapeFunctions_ON_FACE
MoFEMErrorCode Hdiv_Ainsworth_FaceBubbleShapeFunctions_ON_FACE(int *faces_nodes, int p, double *N, double *diffN, double *phi_f, double *diff_phi_f, int gdim, int nb, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
Face bubble functions by Ainsworth .
Definition: Hdiv.cpp:174
MoFEM::matDuplicate
SmartPetscObj< Mat > matDuplicate(Mat mat, MatDuplicateOption op)
Definition: PetscSmartObj.hpp:234
t
constexpr double t
plate stiffness
Definition: plate.cpp:58
MoFEM::PetscOptionsGetIntArray
PetscErrorCode PetscOptionsGetIntArray(PetscOptions options, const char pre[], const char name[], PetscInt dvalue[], PetscInt *nmax, PetscBool *set)
Definition: DeprecatedPetsc.hpp:215
MoFEM::Exceptions::MoFEMException::errorMessage
char errorMessage[1024]
Definition: Exceptions.hpp:22
MoFEM::TsCtx::loopsRHSFunction
FEMethodsSequence loopsRHSFunction
Definition: TsCtx.hpp:33
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
MoFEM::TsCtx::MOFEM_EVENT_TsCtxRHSJacobian
PetscLogEvent MOFEM_EVENT_TsCtxRHSJacobian
Definition: TsCtx.hpp:209
MoFEM::DMSetOperators_MoFEM
PetscErrorCode DMSetOperators_MoFEM(DM dm)
Set operators for MoFEM dm.
Definition: DMMoFEM.cpp:49
MoFEM::TSAdaptChooseMoFEM
PetscErrorCode TSAdaptChooseMoFEM(TSAdapt adapt, TS ts, PetscReal h, PetscInt *next_sc, PetscReal *next_h, PetscBool *accept, PetscReal *wlte, PetscReal *wltea, PetscReal *wlter)
Definition: TsCtx.cpp:737
EntData
EntitiesFieldData::EntData EntData
Definition: child_and_parent.cpp:37
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
MoFEM::DMCreateInterpolation_MGViaApproxOrders
MoFEMErrorCode DMCreateInterpolation_MGViaApproxOrders(DM dm1, DM dm2, Mat *mat, Vec *vec)
Create interpolation matrix between data managers dm1 and dm2.
Definition: PCMGSetUpViaApproxOrders.cpp:391
MoFEM::Types::DoubleAllocator
VecAllocator< double > DoubleAllocator
Definition: Types.hpp:62
FTensor::Index< 'i', 3 >
NBFACETRI_DEMKOWICZ_HCURL
#define NBFACETRI_DEMKOWICZ_HCURL(P)
Definition: h1_hdiv_hcurl_l2.h:109
convert.n
n
Definition: convert.py:82
MoFEM::determinantTensor3by3
MoFEMErrorCode determinantTensor3by3(T1 &t, T2 &det)
Calculate determinant 3 by 3.
Definition: Templates.hpp:1607
MoFEM::TsCtx::postProcessRHSFunction
BasicMethodsSequence postProcessRHSFunction
Definition: TsCtx.hpp:43
MoFEM::DMMoFEMGetKspCtx
PetscErrorCode DMMoFEMGetKspCtx(DM dm, const boost::shared_ptr< MoFEM::KspCtx > &ksp_ctx)
get MoFEM::KspCtx data structure
Definition: DMMoFEM.cpp:1077
MoFEM::setSchurA00MatSolvePC
MoFEMErrorCode setSchurA00MatSolvePC(SmartPetscObj< PC > pc)
Set PC for A00 block.
Definition: Schur.cpp:2223
LASTSET_BC
@ LASTSET_BC
Definition: definitions.h:179
MoFEM::determinantTensor2by2
MoFEMErrorCode determinantTensor2by2(T1 &t, T2 &det)
Calculate determinant 2 by 2.
Definition: Templates.hpp:1618
N
const int N
Definition: speed_test.cpp:3
MAX_DOFS_ON_ENTITY
#define MAX_DOFS_ON_ENTITY
Maximal number of DOFs on entity.
Definition: definitions.h:249
MoFEM::determinantTensor3by3
static auto determinantTensor3by3(T &t)
Calculate the determinant of a 3x3 matrix or a tensor of rank 2.
Definition: Templates.hpp:1540
MoFEM::DMMoFEMGetSnesCtx
PetscErrorCode DMMoFEMGetSnesCtx(DM dm, const boost::shared_ptr< MoFEM::SnesCtx > &snes_ctx)
get MoFEM::SnesCtx data structure
Definition: DMMoFEM.cpp:1103
MoFEM::computeEigenValuesSymmetric
MoFEMErrorCode computeEigenValuesSymmetric(const FTensor::Tensor2_symmetric< T1, DIM > &mat, FTensor::Tensor1< T2, DIM > &eig, FTensor::Tensor2< T3, DIM, DIM > &eigen_vec)
compute eigenvalues of a symmetric tensor using lapack dsyev
Definition: Templates.hpp:1520
MoFEM::SnesRhs
PetscErrorCode SnesRhs(SNES snes, Vec x, Vec f, void *ctx)
This is MoFEM implementation for the right hand side (residual vector) evaluation in SNES solver.
Definition: SnesCtx.cpp:27
v
const double v
phase velocity of light in medium (cm/ns)
Definition: initial_diffusion.cpp:40
block_mat
SmartPetscObj< Mat > block_mat
Definition: schur_test_diag_mat.cpp:39
Range
MoFEM::Exceptions::MoFEMException::errorCode
const int errorCode
Definition: Exceptions.hpp:21
SnesCtx
MoFEM::setSchurBlockMatOps
static MoFEMErrorCode setSchurBlockMatOps(Mat mat_raw)
Definition: Schur.cpp:1362
adouble
NBEDGE_AINSWORTH_HCURL
#define NBEDGE_AINSWORTH_HCURL(P)
Definition: h1_hdiv_hcurl_l2.h:97
MoFEM::PetscOptionsGetRealArray
PetscErrorCode PetscOptionsGetRealArray(PetscOptions *, const char pre[], const char name[], PetscReal dval[], PetscInt *nmax, PetscBool *set)
Definition: DeprecatedPetsc.hpp:192
FTensor::dd
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: ddTensor0.hpp:33
MOFEM_TAG_AND_LOG
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
Definition: LogManager.hpp:362
MoFEM::getInterfacePtr
auto getInterfacePtr(DM dm)
Get the Interface Ptr object.
Definition: DMMoFEM.hpp:1033
MoFEM::MatSetValues
MoFEMErrorCode MatSetValues(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora)
Assemble PETSc matrix.
Definition: EntitiesFieldData.hpp:1670
MoFEM::Types::CubitBCType
std::bitset< 32 > CubitBCType
Definition: Types.hpp:52
MOFEM_LOG
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
MoFEM::vectorDuplicate
SmartPetscObj< Vec > vectorDuplicate(Vec vec)
Create duplicate vector of smart vector.
Definition: PetscSmartObj.hpp:221
MoFEM::getFTensor2SymmetricFromMat
static auto getFTensor2SymmetricFromMat(MatrixDouble &data)
Definition: Templates.hpp:339
MoFEM::cyclic_edge_rotate_face_3
static constexpr int cyclic_edge_rotate_face_3[3][6]
Definition: EntityRefine.cpp:27
FTensor::Tensor0
Definition: Tensor0.hpp:16
MoFEM::shell_block_mat_asmb_wrap
MoFEMErrorCode shell_block_mat_asmb_wrap(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora)
Definition: Schur.cpp:1900
MoFEM::MatSetValues< SchurElemMats >
MoFEMErrorCode MatSetValues< SchurElemMats >(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora)
Definition: Schur.cpp:2249
MoFEM::Core
CoreTmp< 0 > Core
Definition: Core.hpp:1148
MoFEM::DMoFEMGetInterfacePtr
PetscErrorCode DMoFEMGetInterfacePtr(DM dm, MoFEM::Interface **m_field_ptr)
Get pointer to MoFEM::Interface.
Definition: DMMoFEM.cpp:414
HenckyOps::f
auto f
Definition: HenckyOps.hpp:15
MoFEM::DMMoFEMTSSetMonitor
static PetscErrorCode DMMoFEMTSSetMonitor(DM dm, TS ts, S fe_name, T0 method, T1 pre_only, T2 post_only)
Definition: DMMoFEM.cpp:1029
MoFEM::KspMat
PetscErrorCode KspMat(KSP ksp, Mat A, Mat B, void *ctx)
Run over elements in the list.
Definition: KspCtx.cpp:86
NBVOLUMETET_AINSWORTH_HCURL
#define NBVOLUMETET_AINSWORTH_HCURL(P)
Definition: h1_hdiv_hcurl_l2.h:105
MoFEM::Types::BitRefEdges
std::bitset< BITREFEDGES_SIZE > BitRefEdges
Definition: Types.hpp:34
MoFEM::getFTensor2HVecFromPtr< 3, 2 >
FTensor::Tensor2< FTensor::PackPtr< double *, 6 >, 3, 2 > getFTensor2HVecFromPtr< 3, 2 >(double *ptr)
Definition: Templates.hpp:957
MoFEM::Types::VectorInt
UBlasVector< int > VectorInt
Definition: Types.hpp:67
BLOCKSET
@ BLOCKSET
Definition: definitions.h:161
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
eps
static const double eps
Definition: check_base_functions_derivatives_on_tet.cpp:11
Jacobi_polynomials
PetscErrorCode Jacobi_polynomials(int p, double alpha, double x, double t, double *diff_x, double *diff_t, double *L, double *diffL, const int dim)
Calculate Jacobi approximation basis.
Definition: base_functions.c:67
lapack_dsyev
static __CLPK_integer lapack_dsyev(char jobz, char uplo, __CLPK_integer n, __CLPK_doublereal *a, __CLPK_integer lda, __CLPK_doublereal *w, __CLPK_doublereal *work, __CLPK_integer lwork)
Definition: lapack_wrap.h:261
MoFEM::createSchurNestedMatrixStruture
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)
Get the Schur Nest Mat Array object.
Definition: Schur.cpp:1944
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
lambda
static double lambda
Definition: incompressible_elasticity.cpp:199
MoFEM::MPC::LAST
@ LAST
MoFEM::getProblemPtr
auto getProblemPtr(DM dm)
get problem pointer from DM
Definition: DMMoFEM.hpp:1044
HCURL
@ HCURL
field with continuous tangents
Definition: definitions.h:86
EigenMatrix::Vec
const FTensor::Tensor2< T, Dim, Dim > Vec
Definition: MatrixFunction.hpp:66
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
MoFEM::getCommFromPetscObject
MPI_Comm getCommFromPetscObject(PetscObject obj)
Get the Comm From Petsc Object object.
Definition: PetscSmartObj.hpp:160
MoFEM::PetscOptionsGetString
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
Definition: DeprecatedPetsc.hpp:172
MoFEM::DMMoFEMGetProblemPtr
PetscErrorCode DMMoFEMGetProblemPtr(DM dm, const MoFEM::Problem **problem_ptr)
Get pointer to problem data structure.
Definition: DMMoFEM.cpp:426
MoFEM::PetscOptionsGetEList
PetscErrorCode PetscOptionsGetEList(PetscOptions *, const char pre[], const char name[], const char *const *list, PetscInt next, PetscInt *value, PetscBool *set)
Definition: DeprecatedPetsc.hpp:203
MoFEM::createVectorMPI
auto createVectorMPI(MPI_Comm comm, PetscInt n, PetscInt N)
Create MPI Vector.
Definition: PetscSmartObj.hpp:202
sdf_hertz_2d_axisymm_plane.d
float d
Definition: sdf_hertz_2d_axisymm_plane.py:4
MoFEM::edges_conn
static constexpr int edges_conn[]
Definition: EntityRefine.cpp:18
FTensor::transform
Tensor2_Expr< transform_Tensor2< A, B, T, Dim0, Dim1, i, j >, T, Dim0, Dim1, i, j > transform(const Tensor2_Expr< A, T, Dim0, Dim1, i, j > &a, B function)
Definition: Tensor2_transform.hpp:27
DIM2
constexpr int DIM2
Definition: level_set.cpp:22
HVEC2_0
@ HVEC2_0
Definition: definitions.h:207
NBFACETRI_AINSWORTH_FACE_HCURL
#define NBFACETRI_AINSWORTH_FACE_HCURL(P)
Definition: h1_hdiv_hcurl_l2.h:99
MoFEM::TsCtx::postProcessRHSJacobian
BasicMethodsSequence postProcessRHSJacobian
Definition: TsCtx.hpp:42
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
MoFEM::TsSetRHSJacobian
PetscErrorCode TsSetRHSJacobian(TS ts, PetscReal t, Vec u, Mat A, Mat B, void *ctx)
TS solver function.
Definition: TsCtx.cpp:422
MoFEM::Hcurl_Ainsworth_VolumeInteriorFunctions_MBTET
MoFEMErrorCode Hcurl_Ainsworth_VolumeInteriorFunctions_MBTET(int p, double *N, double *diffN, double *phi_v, double *diff_phi_v, int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
Volume interior function.
Definition: Hcurl.cpp:909
NBFACETRI_AINSWORTH_FACE_HDIV
#define NBFACETRI_AINSWORTH_FACE_HDIV(P)
Definition: h1_hdiv_hcurl_l2.h:131
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
MoFEM::getDMSnesCtx
auto getDMSnesCtx(DM dm)
Get SNES context data structure used by DM.
Definition: DMMoFEM.hpp:1127
NBVOLUMETET_AINSWORTH_TET_HCURL
#define NBVOLUMETET_AINSWORTH_TET_HCURL(P)
Definition: h1_hdiv_hcurl_l2.h:103
MoFEM::VecSetValues< SchurElemMats >
MoFEMErrorCode VecSetValues< SchurElemMats >(Vec V, const EntitiesFieldData::EntData &data, const VectorDouble &nf, InsertMode iora)
Definition: Schur.hpp:207
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
NBFACETRI_AINSWORTH_HCURL
#define NBFACETRI_AINSWORTH_HCURL(P)
Definition: h1_hdiv_hcurl_l2.h:100
MoFEM::Hcurl_Ainsworth_BubbleFaceFunctions_MBTET
MoFEMErrorCode Hcurl_Ainsworth_BubbleFaceFunctions_MBTET(int *faces_nodes, int *p, double *N, double *diffN, double *phi_f[4], double *diff_phi_f[4], int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
Face edge base functions of Hcurl space on face on tetrahedral.
Definition: Hcurl.cpp:545
MoFEM::PetscOptionsGetScalar
PetscErrorCode PetscOptionsGetScalar(PetscOptions *, const char pre[], const char name[], PetscScalar *dval, PetscBool *set)
Definition: DeprecatedPetsc.hpp:162
MoFEM::Problem
keeps basic data about problem
Definition: ProblemsMultiIndices.hpp:54
NBFACETRI_AINSWORTH_EDGE_HCURL
#define NBFACETRI_AINSWORTH_EDGE_HCURL(P)
Definition: h1_hdiv_hcurl_l2.h:98
MoFEM::TsSetRHSFunction
PetscErrorCode TsSetRHSFunction(TS ts, PetscReal t, Vec u, Vec F, void *ctx)
TS solver function.
Definition: TsCtx.cpp:323
MoFEM::DMMoFEMAddSubFieldRow
PetscErrorCode DMMoFEMAddSubFieldRow(DM dm, const char field_name[])
Definition: DMMoFEM.cpp:238
HVEC2
@ HVEC2
Definition: definitions.h:199
sdf_wavy_2d.ind
float ind
Definition: sdf_wavy_2d.py:7
MoFEM::MatSetValues< SchurElemMatsBlock >
MoFEMErrorCode MatSetValues< SchurElemMatsBlock >(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora)
Definition: Schur.cpp:2325
MoFEM::TsSetI2Function
PetscErrorCode TsSetI2Function(TS ts, PetscReal t, Vec u, Vec u_t, Vec u_tt, Vec F, void *ctx)
Calculation the right hand side for second order PDE in time.
Definition: TsCtx.cpp:612
MB_ID_MASK
#define MB_ID_MASK
Definition: definitions.h:247
MoFEM::DMMoFEMTSSetRHSJacobian
static PetscErrorCode DMMoFEMTSSetRHSJacobian(DM dm, S fe_name, T0 method, T1 pre_only, T2 post_only)
Definition: DMMoFEM.cpp:905
MoFEM::DMMoFEMCreateNestSchurMat
MoFEMErrorCode DMMoFEMCreateNestSchurMat(DM dm, Mat *mat)
Create nest schur matrix.
Definition: DMMoFEM.cpp:1572
MoFEM::SnesMat
PetscErrorCode SnesMat(SNES snes, Vec x, Mat A, Mat B, void *ctx)
This is MoFEM implementation for the left hand side (tangent matrix) evaluation in SNES solver.
Definition: SnesCtx.cpp:139
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
convert.int
int
Definition: convert.py:64
MoFEM::PetscOptionsGetInt
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
Definition: DeprecatedPetsc.hpp:142
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
HDIV
@ HDIV
field with continuous normal traction
Definition: definitions.h:87
MOFEM_NOT_IMPLEMENTED
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32
MoFEM::DMCreateMatrix_MGViaApproxOrders
MoFEMErrorCode DMCreateMatrix_MGViaApproxOrders(DM dm, Mat *M)
Create matrix for Multi-Grid via approximation orders.
Definition: PCMGSetUpViaApproxOrders.cpp:344
MoFEM::getDMTsCtx
auto getDMTsCtx(DM dm)
Get TS context data structure used by DM.
Definition: DMMoFEM.hpp:1141
MoFEM::TsCtx::preProcessRHSFunction
BasicMethodsSequence preProcessRHSFunction
Definition: TsCtx.hpp:41
CHKERRG
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:496
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21
MoFEM::VecSetValues< EssentialBcStorage >
MoFEMErrorCode VecSetValues< EssentialBcStorage >(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Set values to vector in operator.
Definition: FormsIntegrators.cpp:76
MOFEM_INVALID_DATA
@ MOFEM_INVALID_DATA
Definition: definitions.h:36
MoFEM::isAllGather
auto isAllGather(IS is)
IS All gather.
Definition: PetscSmartObj.hpp:300
HVEC1_0
@ HVEC1_0
Definition: definitions.h:206
MoFEM::MPC::COUPLING
@ COUPLING
HVEC0
@ HVEC0
Definition: definitions.h:199
F
@ F
Definition: free_surface.cpp:394
MoFEM::DMCoarsen_MGViaApproxOrders
MoFEMErrorCode DMCoarsen_MGViaApproxOrders(DM dm, MPI_Comm comm, DM *dmc)
Coarsen DM.
Definition: PCMGSetUpViaApproxOrders.cpp:376
MoFEM::Types::DofIdx
int DofIdx
Index of DOF.
Definition: Types.hpp:18
MoFEM::PetscOptionsGetBool
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
Definition: DeprecatedPetsc.hpp:182
MoFEM::Hcurl_Ainsworth_BubbleFaceFunctions_MBTET_ON_FACE
MoFEMErrorCode Hcurl_Ainsworth_BubbleFaceFunctions_MBTET_ON_FACE(int *faces_nodes, int p, double *N, double *diffN, double *phi_f, double *diff_phi_f, int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
Face edge base functions of Hcurl space on face.
Definition: Hcurl.cpp:663
MoFEM::TSAdaptCreateMoFEM
PetscErrorCode TSAdaptCreateMoFEM(TSAdapt adapt)
Craete MOFEM adapt.
Definition: TsCtx.cpp:797
MoFEM::solveLinearSystem
MoFEMErrorCode solveLinearSystem(const MatrixDouble &mat, VectorDouble &f)
Solve linear system of equations using Lapack.
Definition: Templates.hpp:1435