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  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  DiagBlockInvStruture
 
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  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 directives for scalar base functions. More...
 
struct  OpBaseDerivativesNext< 3 >
 Specialisation for calculate directives 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  OpBrokenLoopSide
 
struct  OpBrokenSpaceConstrainDFluxImpl
 
struct  OpBrokenSpaceConstrainDFluxImpl< FIELD_DIM, GAUSS, OpBase >
 
struct  OpBrokenSpaceConstrainDHybridImpl
 
struct  OpBrokenSpaceConstrainDHybridImpl< FIELD_DIM, GAUSS, OpBase >
 
struct  OpBrokenSpaceConstrainImpl
 
struct  OpBrokenSpaceConstrainImpl< FIELD_DIM, GAUSS, OpBase >
 
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, FIELD_DIM, A, I, 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  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 >
 
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_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)
 
static MoFEMErrorCode solve_schur_block_shell (Mat mat, Vec x, Vec y, 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< 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)
 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, 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)
 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, std::vector< double > diag_eps, bool symm_op, boost::shared_ptr< BlockStructure > diag_blocks=nullptr)
 Construct a new Op Schur Assemble End object. More...
 
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)
 
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 1120 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, 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_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 1140 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 499 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 1976 of file Templates.hpp.

◆ I_FTIndex

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

Definition at line 1982 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, 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_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 2002 of file Interface.hpp.

◆ j_FTIndex

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

Definition at line 1977 of file Templates.hpp.

◆ J_FTIndex

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

Definition at line 1983 of file Templates.hpp.

◆ k_FTIndex

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

Definition at line 1978 of file Templates.hpp.

◆ l_FTIndex

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

Definition at line 1979 of file Templates.hpp.

◆ m_FTIndex

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

Definition at line 1980 of file Templates.hpp.

◆ n_FTIndex

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

Definition at line 1981 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 130 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

Examples
heat_method.cpp, and shallow_wave.cpp.

Definition at line 265 of file HODataOperators.hpp.

◆ 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

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.

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 97 of file Schur.hpp.

◆ SchurFieldPair

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

Definition at line 91 of file Schur.hpp.

◆ SchurShellMatData

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

Definition at line 112 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 789 of file HODataOperators.hpp.

790  {
791  std::vector<FieldSpace> spaces;
792  if (hcurl)
793  spaces.push_back(HCURL);
794  if (hdiv)
795  spaces.push_back(HDIV);
796  return AddHOOps<2, 3, 3>::add(e.getOpPtrVector(), spaces, field);
797 }

◆ 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 764 of file HODataOperators.hpp.

765  {
766  std::vector<FieldSpace> spaces;
767  if (h1)
768  spaces.push_back(H1);
769  if (hcurl)
770  spaces.push_back(HCURL);
771  if (hdiv)
772  spaces.push_back(HDIV);
773  if (l2)
774  spaces.push_back(L2);
775  return AddHOOps<3, 3, 3>::add(e.getOpPtrVector(), spaces, field);
776 }

◆ 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 1498 of file Templates.hpp.

1500  {
1502  for (int ii = 0; ii != DIM; ii++)
1503  for (int jj = 0; jj != DIM; jj++)
1504  eigen_vec(ii, jj) = mat(ii, jj);
1505 
1506  CHKERR computeEigenValuesSymmetric(eigen_vec, eig);
1507 
1509 }

◆ 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.

Definition at line 1430 of file Templates.hpp.

1432  {
1434 
1435  const size_t M = mat.size1();
1436  const size_t N = mat.size2();
1437 
1438  if (M == 0 || M != N)
1439  SETERRQ2(
1440  PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1441  "The input matrix for eigen value computation is not square %d != %d",
1442  M, N);
1443  if (eig.size() != M)
1444  eig.resize(M, false);
1445 
1446  eigen_vec = mat;
1447  const int n = M;
1448  const int lda = M;
1449  const int size = (M + 2) * M;
1450  int lwork = size;
1451  double *work = new double[size];
1452 
1453  if (lapack_dsyev('V', 'U', n, &*eigen_vec.data().begin(), lda,
1454  &*eig.data().begin(), work, lwork) > 0)
1455  SETERRQ(PETSC_COMM_SELF, MOFEM_INVALID_DATA,
1456  "The algorithm failed to compute eigenvalues.");
1457 
1458  delete[] work;
1460 }

◆ 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 1471 of file Templates.hpp.

1472  {
1474 
1475  const int n = DIM;
1476  const int lda = DIM;
1477  const int lwork = (DIM + 2) * DIM;
1478  std::array<double, (DIM + 2) * DIM> work;
1479 
1480  if (lapack_dsyev('V', 'U', n, &eigen_vec(0, 0), lda, &eig(0), work.data(),
1481  lwork) > 0)
1482  SETERRQ(PETSC_COMM_SELF, MOFEM_INVALID_DATA,
1483  "The algorithm failed to compute eigenvalues.");
1485 }

◆ 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 1343 of file Templates.hpp.

1343  {
1345 
1346  const size_t M = mat.size1();
1347  const size_t N = mat.size2();
1348 
1349  if (M != N)
1350  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1351  "The input matrix for inverse computation is not square %d != %d",
1352  M, N);
1353 
1354  int *ipv = new int[N];
1355  int lwork = N * N;
1356  double *work = new double[lwork];
1357  int info;
1358  info = lapack_dgetrf(N, N, &*mat.data().begin(), N, ipv);
1359  if (info != 0)
1360  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1361  "lapack error info = %d", info);
1362  info = lapack_dgetri(N, &*mat.data().begin(), N, ipv, work, lwork);
1363  if (info != 0)
1364  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1365  "lapack error info = %d", info);
1366 
1367  delete[] ipv;
1368  delete[] work;
1369 
1371 }

◆ 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 1503 of file Schur.cpp.

1504  {
1505 
1506  auto problem_ptr = getProblemPtr(dm);
1507  auto nb_local = problem_ptr->nbLocDofsRow;
1508  auto nb_global = problem_ptr->nbDofsRow;
1509 
1510  // check in nb, rows is equal to nb. columns.
1511  if (nb_local != problem_ptr->nbLocDofsCol) {
1512  MOFEM_LOG("SELF", Sev::error)
1513  << "Wrong size " << nb_local << " != " << problem_ptr->nbLocDofsCol;
1515  "nb. cols is inconsistent with nb. rows");
1516  }
1517  if (nb_global != problem_ptr->nbDofsCol) {
1518  MOFEM_LOG("SELF", Sev::error)
1519  << "Wrong size " << nb_global << " != " << problem_ptr->nbDofsCol;
1521  "nb. cols is inconsistent with nb. rows");
1522  }
1523 
1524  // get comm from DM
1525  MPI_Comm comm;
1526  CHKERR PetscObjectGetComm((PetscObject)dm, &comm);
1527 
1528  Mat mat_raw;
1529  CHKERR MatCreateShell(comm, nb_local, nb_local, nb_global, nb_global,
1530  (void *)data.get(), &mat_raw);
1531  CHKERR setSchurBlockMatOps(mat_raw);
1532  // CHKERR PetscObjectSetName((PetscObject)mat_raw, MoFEM_BLOCK_MAT);
1533 
1534  return std::make_pair(SmartPetscObj<Mat>(mat_raw), data);
1535 }

◆ 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 1196 of file Schur.cpp.

1201  {
1202 
1203  auto cmp_uid_lo = [](const boost::weak_ptr<FieldEntity> &a, const UId &b) {
1204  if (auto a_ptr = a.lock()) {
1205  if (a_ptr->getLocalUniqueId() < b)
1206  return true;
1207  else
1208  return false;
1209  } else {
1210  return false;
1211  }
1212  };
1213 
1214  auto cmp_uid_hi = [](const UId &b, const boost::weak_ptr<FieldEntity> &a) {
1215  if (auto a_ptr = a.lock()) {
1216  if (b < a_ptr->getLocalUniqueId())
1217  return true;
1218  else
1219  return false;
1220  } else {
1221  return true;
1222  }
1223  };
1224 
1225  // get uids for fields
1226  auto get_uid_pair = [](const auto &field_id) {
1227  auto lo_uid = FieldEntity::getLocalUniqueIdCalculate(
1228  field_id, get_id_for_min_type<MBVERTEX>());
1229  auto hi_uid = FieldEntity::getLocalUniqueIdCalculate(
1230  field_id, get_id_for_max_type<MBENTITYSET>());
1231  return std::make_pair(lo_uid, hi_uid);
1232  };
1233 
1234  // get uids pair
1235  auto get_it_pair = [cmp_uid_lo, cmp_uid_hi](auto &&field_ents, auto &&p_uid) {
1236  auto lo = std::lower_bound(field_ents.begin(), field_ents.end(),
1237  p_uid.first, cmp_uid_lo);
1238  auto hi = std::upper_bound(field_ents.begin(), field_ents.end(),
1239  p_uid.second, cmp_uid_hi);
1240  return std::make_pair(lo, hi);
1241  };
1242 
1243  // extract DOFs for rows/columns. DOFs are associated with fields entities
1244  // for given problem.
1245  auto row_extractor = [](auto &e) { return e->entityCacheRowDofs; };
1246  auto col_extractor = [](auto &e) { return e->entityCacheColDofs; };
1247 
1248  auto extract_data = [](auto &&its, auto extractor) {
1249  std::vector<std::tuple<int, int, int>> data;
1250  data.reserve(std::distance(its.first, its.second));
1251  // iterate field dofs
1252  for (; its.first != its.second; ++its.first) {
1253  if (auto e = its.first->lock()) {
1254  if (auto cache = extractor(e).lock()) {
1255  auto nb_dofs = std::distance(cache->loHi[0], cache->loHi[1]);
1256  if (nb_dofs) {
1257  auto glob = (*cache->loHi[0])->getPetscGlobalDofIdx();
1258  auto loc = (*cache->loHi[0])->getPetscLocalDofIdx();
1259  data.emplace_back(glob, nb_dofs, loc);
1260 
1261 #ifndef NDEBUG
1262 
1263  for (auto lo = cache->loHi[0]; lo != cache->loHi[1]; ++lo) {
1264  auto glob = (*lo)->getPetscGlobalDofIdx();
1265  if (glob == -1) {
1267  "Wrong global index");
1268  }
1269  }
1270 
1271 #endif
1272  }
1273  }
1274  }
1275  }
1276  return data;
1277  };
1278 
1279  auto data_ptr = boost::make_shared<BlockStructure>();
1280  auto m_field_ptr = getInterfacePtr(dm);
1281 
1282  // create element to extract data
1283  auto fe_method = boost::shared_ptr<MoFEM::FEMethod>(new MoFEM::FEMethod());
1284 
1285  for (auto &d : schur_fe_op_vec) {
1286 
1287  // extract bit numbers for row and column
1288  auto get_bit_numbers = [&d](auto op) {
1289  std::vector<FieldBitNumber> bit_numbers(d.second.size());
1290  std::transform(d.second.begin(), d.second.end(), bit_numbers.begin(), op);
1291  return bit_numbers;
1292  };
1293 
1294  // extract bit numbers for row
1295  auto row_bit_numbers = get_bit_numbers(
1296  [&](auto &p) { return m_field_ptr->get_field_bit_number(p.first); });
1297  // extract bit numbers for row
1298  auto col_bit_numbers = get_bit_numbers(
1299  [&](auto &p) { return m_field_ptr->get_field_bit_number(p.second); });
1300 
1301  fe_method->preProcessHook = []() { return 0; };
1302  fe_method->postProcessHook = []() { return 0; };
1303  fe_method->operatorHook = [&]() {
1305 
1306  for (auto f = 0; f != row_bit_numbers.size(); ++f) {
1307 
1308  auto row_data =
1309  extract_data(get_it_pair(fe_method->getRowFieldEnts(),
1310  get_uid_pair(row_bit_numbers[f])),
1311  row_extractor);
1312  auto col_data =
1313  extract_data(get_it_pair(fe_method->getColFieldEnts(),
1314  get_uid_pair(col_bit_numbers[f])),
1315  col_extractor);
1316 
1317  for (auto &r : row_data) {
1318  auto [r_glob, r_nb_dofs, r_loc] = r;
1319  for (auto &c : col_data) {
1320  auto [c_glob, c_nb_dofs, c_loc] = c;
1321  if (r_glob != -1 && c_glob != -1) {
1322  data_ptr->blockIndex.insert(BlockStructure::Indexes{
1323  r_glob, c_glob, r_nb_dofs, c_nb_dofs, r_loc, c_loc, -1, -1});
1324  }
1325  }
1326  }
1327  }
1328 
1330  };
1331 
1332  CHKERR DMoFEMLoopFiniteElementsUpAndLowRank(dm, d.first, fe_method, 0,
1333  m_field_ptr->get_comm_size());
1334  };
1335 
1336  // order by column (that is for matrix multiplication)
1337  auto mem_size = 0;
1338  for (auto &v : data_ptr->blockIndex.get<0>()) {
1339  v.getMatShift() = mem_size;
1340  mem_size += v.getNbCols() * v.getNbRows();
1341  }
1342 
1343  std::vector<double> tmp;
1344  if (mem_size > tmp.max_size())
1346 
1347  data_ptr->dataBlocksPtr =
1348  boost::make_shared<std::vector<double>>(mem_size, 0);
1349 
1350  auto ghost_x = createDMVector(dm);
1351  auto ghost_y = createDMVector(dm);
1352  CHKERR VecSetDM(ghost_x, PETSC_NULL);
1353  CHKERR VecSetDM(ghost_y, PETSC_NULL);
1354 
1355  data_ptr->ghostX = ghost_x;
1356  data_ptr->ghostY = ghost_y;
1357 
1358  return data_ptr;
1359 }

◆ 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 2766 of file Schur.cpp.

2766  {
2767  return new OpSchurAssembleBegin();
2768 }

◆ createOpSchurAssembleEnd() [1/2]

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 
)

Construct a new Op Schur Assemble End object.

Parameters
fields_namelist of fields
field_entslist of entities on which schur complement is applied (can be empty)
sequence_of_aoslist of maps from base problem to Schur complement matrix
sequence_of_matslist of Schur complement matrices
sym_schurtrue if Schur 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 2771 of file Schur.cpp.

2776  {
2777  if (symm_op)
2778  return new OpSchurAssembleEnd<SchurDSYSV>(fields_name, field_ents,
2779  sequence_of_aos, sequence_of_mats,
2780  sym_schur, symm_op, diag_blocks);
2781  else
2782  return new OpSchurAssembleEnd<SchurDGESV>(fields_name, field_ents,
2783  sequence_of_aos, sequence_of_mats,
2784  sym_schur, symm_op, diag_blocks);
2785 }

◆ createOpSchurAssembleEnd() [2/2]

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 
)

Construct a new Op Schur Assemble End object.

Parameters
fields_namelist of fields
field_entslist of entities on which schur complement is applied (can be empty)
sequence_of_aoslist of maps from base problem to Schur complement matrix
sequence_of_matslist of Schur complement matrices
sym_schurtrue if Schur complement is symmetric
diag_epsadd epsilon on diagonal of inverted matrix
symm_optrue if block diagonal is symmetric

Definition at line 2788 of file Schur.cpp.

2794  {
2795  if (symm_op)
2796  return new OpSchurAssembleEnd<SchurDSYSV>(
2797  fields_name, field_ents, sequence_of_aos, sequence_of_mats, sym_schur,
2798  diag_eps, symm_op, diag_blocks);
2799  else
2800  return new OpSchurAssembleEnd<SchurDGESV>(
2801  fields_name, field_ents, sequence_of_aos, sequence_of_mats, sym_schur,
2802  diag_eps, symm_op, diag_blocks);
2803 }

◆ 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
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 2738 of file Schur.cpp.

2738  {
2739 
2740  if (!schur_net_data_ptr)
2742 
2743  auto [mat_arrays, data_ptrs, block_mat_data_ptr, iss] = *schur_net_data_ptr;
2744  auto [schur_is, block_is] = iss;
2745 
2746  std::array<IS, 2> is_a = {schur_is, block_is};
2747  std::array<Mat, 4> mats_a = {
2748 
2749  mat_arrays[0], mat_arrays[1], mat_arrays[2], mat_arrays[3]
2750 
2751  };
2752 
2753  MPI_Comm comm;
2754  CHKERR PetscObjectGetComm((PetscObject)mat_arrays[0], &comm);
2755 
2756  Mat mat_raw;
2757  CHKERR MatCreateNest(
2758 
2759  comm, 2, is_a.data(), 2, is_a.data(), mats_a.data(), &mat_raw
2760 
2761  );
2762 
2763  return std::make_pair(SmartPetscObj<Mat>(mat_raw), schur_net_data_ptr);
2764 }

◆ 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, nonlinear_elastic.cpp, poisson_2d_dis_galerkin.cpp, and test_broken_space.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.

Definition at line 1549 of file Templates.hpp.

1549  {
1550  return DeterminantTensorImpl<FTensor::Tensor2<T, DIM, DIM>, DIM>::get(t);
1551 }

◆ 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 1557 of file Templates.hpp.

1557  {
1558  return DeterminantTensorImpl<FTensor::Tensor2_symmetric<T, DIM>, DIM>::get(t);
1559 }

◆ 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 1531 of file Templates.hpp.

1531  {
1532  return t(0, 0) * t(1, 1) - t(0, 1) * t(1, 0);
1533 }

◆ determinantTensor2by2() [2/2]

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

Calculate determinant 2 by 2.

Definition at line 1596 of file Templates.hpp.

1596  {
1598  det = determinantTensor2by2(t);
1600 }

◆ 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 1518 of file Templates.hpp.

1518  {
1519  return t(0, 0) * t(1, 1) * t(2, 2) + t(1, 0) * t(2, 1) * t(0, 2) +
1520  t(2, 0) * t(0, 1) * t(1, 2) - t(0, 0) * t(2, 1) * t(1, 2) -
1521  t(2, 0) * t(1, 1) * t(0, 2) - t(1, 0) * t(0, 1) * t(2, 2);
1522 }

◆ determinantTensor3by3() [2/2]

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

Calculate determinant 3 by 3.

Definition at line 1585 of file Templates.hpp.

1585  {
1587  det = determinantTensor3by3(t);
1589 }

◆ dimension_from_handle()

auto MoFEM::dimension_from_handle ( const EntityHandle  h)
inline

get entity dimension form handle

Definition at line 1892 of file Templates.hpp.

1892  {
1893  return moab::CN::Dimension(type_from_handle(h));
1894 };

◆ 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
plastic.cpp, and 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, nonlinear_elastic.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 1884 of file Templates.hpp.

1884  {
1885  return (static_cast<EntityHandle>(type) << MB_ID_WIDTH) | id;
1886 };

◆ 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 1908 of file Templates.hpp.

1908  {
1909  return BitFieldId().set(bit_number - 1);
1910 };

◆ 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, free_surface.cpp, hanging_node_approx.cpp, level_set.cpp, seepage.cpp, split_sideset.cpp, and thermo_elastic.cpp.

Definition at line 1864 of file Templates.hpp.

1864  {
1865  return boost::make_shared<TempMeshset>(moab);
1866 };

◆ 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
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, EshelbianPlasticity.cpp, free_surface.cpp, heat_equation.cpp, nonlinear_elastic.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 1153 of file Templates.hpp.

1153  {
1154  return GetFTensor1FromArray<DIM, S>::get(data);
1155 }

◆ 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 1161 of file Templates.hpp.

1161  {
1162  return GetFTensor1FromArray<3, 0>::get(data);
1163 }

◆ 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 1211 of file Templates.hpp.

1211  {
1212  static_assert(DIM != DIM, "not implemented");
1214 }

◆ getFTensor1FromArrayDiag() [2/2]

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

Definition at line 1218 of file Templates.hpp.

1218  {
1219  return FTensor::Tensor1<FTensor::PackPtr<double *, 2>, 2>{&data(rr + 0, 0),
1220  &data(rr + 1, 1)};
1221 }

◆ 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 1171 of file Templates.hpp.

1171  {
1172  return FTensor::Tensor1<FTensor::PackPtr<double *, 1>, 2>{&data(rr + 0, 0),
1173  &data(rr + 1, 0)};
1174 }

◆ getFTensor1FromMat() [3/4]

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

Definition at line 1171 of file Templates.hpp.

1171  {
1172  return FTensor::Tensor1<FTensor::PackPtr<double *, 1>, 2>{&data(rr + 0, 0),
1173  &data(rr + 1, 0)};
1174 }

◆ 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 823 of file Templates.hpp.

823  {
824  return GetFTensor1FromPtrImpl<DIM, S, adouble>::get(ptr);
825 };

◆ 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 816 of file Templates.hpp.

816  {
817  return GetFTensor1FromPtrImpl<DIM, S, double>::get(ptr);
818 };

◆ 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 830 of file Templates.hpp.

830  {
831  return GetFTensor1FromPtrImpl<DIM, S, std::complex<double>>::get(ptr);
832 };

◆ getFTensor2FromArray() [1/3]

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

Definition at line 1329 of file Templates.hpp.

1329  {
1330  return GetFTensor2FromArrayImpl<DIM1, DIM2, S, adouble, ublas::row_major,
1331  VecAllocator<adouble>>::get(data, rr);
1332 }

◆ 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 1305 of file Templates.hpp.

1306  {
1307  return GetFTensor2FromArrayRawPtrImpl<DIM1, DIM2, double, ublas::row_major,
1308  VecAllocator<double>>::get(data, rr, cc,
1309  ss);
1310 }

◆ 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 1298 of file Templates.hpp.

1298  {
1299  return GetFTensor2FromArrayImpl<DIM1, DIM2, S, double, ublas::row_major,
1300  VecAllocator<double>>::get(data, rr, cc);
1301 }

◆ 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 1313 of file Templates.hpp.

1315  {
1316  return GetFTensor2FromArrayImpl<2, 2, S, T, L, A>::get(data, rr, cc);
1317 }

◆ 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 1320 of file Templates.hpp.

1322  {
1323  return GetFTensor2FromArrayImpl<3, 3, S, T, L, A>::get(data, rr, cc);
1324 }

◆ 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 903 of file Templates.hpp.

903  {
904  return GetFTensor2FromPtr<DIM1, DIM2, S, double>::get(ptr);
905 };

◆ 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 915 of file Templates.hpp.

915  {
916  return GetFTensor2FromPtr<DIM1, DIM2, S, std::complex<double>>::get(ptr);
917 };

◆ 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 928 of file Templates.hpp.

928  {
929  static_assert(DIM1 == DIM1 || DIM2 != DIM2,
930  "Such getFTensor2HVecFromPtr is not implemented");
931 };

◆ getFTensor2HVecFromPtr< 3, 2 >()

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

Definition at line 935 of file Templates.hpp.

935  {
937  ptr + HVEC0_0, ptr + HVEC0_1,
938 
939  ptr + HVEC1_0, ptr + HVEC1_1,
940 
941  ptr + HVEC2_0, ptr + HVEC2_1);
942 };

◆ getFTensor2HVecFromPtr< 3, 3 >()

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

Definition at line 946 of file Templates.hpp.

946  {
948  ptr + HVEC0_0, ptr + HVEC0_1, ptr + HVEC0_2,
949 
950  ptr + HVEC1_0, ptr + HVEC1_1, ptr + HVEC1_2,
951 
952  ptr + HVEC2_0, ptr + HVEC2_1, ptr + HVEC2_2);
953 };

◆ 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 1033 of file Templates.hpp.

1033  {
1034  static_assert(DIM, "Such getFTensor2SymmetricFromPtr is not implemented");
1035 }

◆ 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 999 of file Templates.hpp.

999  {
1000  static_assert(DIM, "Such getFTensor2SymmetricFromPtr is not implemented");
1001 }

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

Definition at line 1050 of file Templates.hpp.

1050  {
1052  ptr + 0, ptr + 1, ptr + 2);
1053 };

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

Definition at line 1016 of file Templates.hpp.

1016  {
1018  &ptr[0], &ptr[1], &ptr[2]);
1019 };

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

Definition at line 1039 of file Templates.hpp.

1039  {
1041  ptr + 0, ptr + 1, ptr + 2,
1042 
1043  ptr + 3, ptr + 4,
1044 
1045  ptr + 5);
1046 };

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

Definition at line 1005 of file Templates.hpp.

1005  {
1007  ptr + 0, ptr + 1, ptr + 2,
1008 
1009  ptr + 3, ptr + 4,
1010 
1011  ptr + 5);
1012 };

◆ 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 1066 of file Templates.hpp.

1066  {
1067  static_assert(DIM,
1068  "Such getFTensor2SymmetricLowerFromPtr is not implemented");
1069 }

◆ getFTensor2SymmetricLowerFromPtr< 2 >()

Examples
plate.cpp.

Definition at line 1084 of file Templates.hpp.

1084  {
1086  ptr + 0, ptr + 1, ptr + 3);
1087 };

◆ getFTensor2SymmetricLowerFromPtr< 3 >()

Definition at line 1073 of file Templates.hpp.

1073  {
1075  ptr + HVEC0_0, ptr + HVEC0_1, ptr + HVEC0_2,
1076 
1077  ptr + HVEC1_0, ptr + HVEC1_1,
1078 
1079  ptr + HVEC2_2);
1080 };

◆ getFTensor3DgFromMat() [1/2]

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

Definition at line 504 of file Templates.hpp.

504  {
505  return GetFTensor3DgFromMatImpl<Tensor_Dim01, Tensor_Dim2, S, double,
506  ublas::row_major, DoubleAllocator>::get(data);
507 }

◆ 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 498 of file Templates.hpp.

498  {
499  static_assert(!std::is_same<T, T>::value,
500  "Such getFTensor3DgFromMat specialisation is not implemented");
501 }

◆ 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 760 of file Templates.hpp.

760  {
761  return GetFTensor3FromMatImpl<Tensor_Dim0, Tensor_Dim1, Tensor_Dim2, S,
763  DoubleAllocator>::get(data);
764 }

◆ 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 754 of file Templates.hpp.

754  {
755  static_assert(!std::is_same<T, T>::value,
756  "Such getFTensor3FromMat specialisation is not implemented");
757 }

◆ 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 966 of file Templates.hpp.

966  {
967  static_assert(DIM1 == DIM1 || DIM2 != DIM2 || DIM3 != DIM3,
968  "Such getFTensor3FromPtr is not implemented");
969 };

◆ 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 973 of file Templates.hpp.

973  {
975  ptr + 0, ptr + 1, ptr + 2, ptr + 3, ptr + 4, ptr + 5, ptr + 6, ptr + 7,
976  ptr + 8, ptr + 9, ptr + 10, ptr + 11);
977 };

◆ 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 981 of file Templates.hpp.

981  {
983  ptr + 0, ptr + 1, ptr + 2, ptr + 3, ptr + 4, ptr + 5, ptr + 6, ptr + 7,
984  ptr + 8, ptr + 9, ptr + 10, ptr + 11, ptr + 12, ptr + 13, ptr + 14,
985  ptr + 15, ptr + 16, ptr + 17, ptr + 18, ptr + 19, ptr + 20, ptr + 21,
986  ptr + 22, ptr + 23, ptr + 24, ptr + 25, ptr + 26);
987 };

◆ getFTensor4DdgFromMat() [1/2]

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

Definition at line 423 of file Templates.hpp.

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

◆ 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
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 417 of file Templates.hpp.

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

◆ 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 605 of file Templates.hpp.

605  {
606  return GetFTensor4FromMatImpl<Tensor_Dim0, Tensor_Dim1, Tensor_Dim2,
607  Tensor_Dim3, S, double, ublas::row_major,
608  DoubleAllocator>::get(data);
609 }

◆ 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 598 of file Templates.hpp.

598  {
599  static_assert(!std::is_same<T, T>::value,
600  "Such getFTensor4FromMat specialisation is not implemented");
601 }

◆ 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()

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 
)

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 2249 of file Schur.cpp.

2257  {
2258 
2259  if (!block_mat_data_ptr) {
2260  CHK_THROW_MESSAGE(MOFEM_DATA_INCONSISTENCY, "Block data not set");
2261  }
2262 
2263  if(fields_names.size() != field_ents.size())
2265  "fields_names.size() != field_ents.size()");
2266 
2267  auto [schur_dm, block_dm] = dms;
2268  auto schur_prb = getProblemPtr(schur_dm);
2269  auto block_prb = getProblemPtr(block_dm);
2270  auto m_field_ptr = getInterfacePtr(block_dm);
2271 
2272  auto schur_dofs_row = schur_prb->getNumeredRowDofsPtr();
2273  auto schur_dofs_col = schur_prb->getNumeredColDofsPtr();
2274  auto block_dofs_row = block_prb->getNumeredRowDofsPtr();
2275  auto block_dofs_col = block_prb->getNumeredColDofsPtr();
2276 
2277  auto ao_schur_row = schur_prb->getSubData()->getSmartRowMap();
2278  auto ao_schur_col = schur_prb->getSubData()->getSmartColMap();
2279  auto ao_block_row = block_prb->getSubData()->getSmartRowMap();
2280  auto ao_block_col = block_prb->getSubData()->getSmartColMap();
2281 
2282  auto schur_vec_x = createDMVector(schur_dm);
2283  auto block_vec_x = createDMVector(block_dm);
2284  auto schur_vec_y = vectorDuplicate(schur_vec_x);
2285  auto block_vec_y = vectorDuplicate(block_vec_x);
2286  CHKERR VecSetDM(schur_vec_x, PETSC_NULL);
2287  CHKERR VecSetDM(block_vec_x, PETSC_NULL);
2288  CHKERR VecSetDM(schur_vec_y, PETSC_NULL);
2289  CHKERR VecSetDM(block_vec_y, PETSC_NULL);
2290 
2291  auto get_vec = [&](auto schur_data) {
2292  std::vector<int> vec_r, vec_c;
2293  vec_r.reserve(schur_data->blockIndex.size());
2294  vec_c.reserve(schur_data->blockIndex.size());
2295  for (auto &d : schur_data->blockIndex.template get<1>()) {
2296  vec_r.push_back(d.getRow());
2297  vec_c.push_back(d.getCol());
2298  }
2299  return std::make_pair(vec_r, vec_c);
2300  };
2301 
2302  auto [vec_r_schur, vec_c_schur] = get_vec(block_mat_data_ptr);
2303  CHKERR AOApplicationToPetsc(ao_schur_row, vec_r_schur.size(),
2304  &*vec_r_schur.begin());
2305  CHKERR AOApplicationToPetsc(ao_schur_col, vec_c_schur.size(),
2306  &*vec_c_schur.begin());
2307  auto [vec_r_block, vec_c_block] = get_vec(block_mat_data_ptr);
2308  CHKERR AOApplicationToPetsc(ao_block_row, vec_r_block.size(),
2309  &*vec_r_block.begin());
2310  CHKERR AOApplicationToPetsc(ao_block_col, vec_c_block.size(),
2311  &*vec_c_block.begin());
2312 
2313  std::array<boost::shared_ptr<BlockStructure>, 4> data_ptrs;
2314 
2315  for (auto r = 0; r != 3; ++r) {
2316  data_ptrs[r] = boost::make_shared<BlockStructure>();
2317  data_ptrs[r]->dataBlocksPtr = block_mat_data_ptr->dataBlocksPtr;
2318  }
2319  data_ptrs[3] = boost::make_shared<DiagBlockInvStruture>();
2320  data_ptrs[3]->dataBlocksPtr = block_mat_data_ptr->dataBlocksPtr;
2321 
2322  data_ptrs[0]->ghostX = schur_vec_x;
2323  data_ptrs[0]->ghostY = schur_vec_y;
2324  data_ptrs[1]->ghostX = block_vec_x;
2325  data_ptrs[1]->ghostY = schur_vec_y;
2326  data_ptrs[2]->ghostX = schur_vec_x;
2327  data_ptrs[2]->ghostY = block_vec_y;
2328  data_ptrs[3]->ghostX = block_vec_x;
2329  data_ptrs[3]->ghostY = block_vec_y;
2330 
2331  int idx = 0;
2332  for (auto &d : block_mat_data_ptr->blockIndex.get<1>()) {
2333 
2334  auto insert = [&](auto &m, auto &dof_r, auto &dof_c, auto &d) {
2335  m.insert(
2336 
2337  BlockStructure::Indexes{
2338  dof_r->getPetscGlobalDofIdx(), dof_c->getPetscGlobalDofIdx(),
2339 
2340  d.getNbRows(), d.getNbCols(),
2341 
2342  dof_r->getPetscLocalDofIdx(), dof_c->getPetscLocalDofIdx(),
2343 
2344  d.getMatShift(), d.getInvShift()}
2345 
2346  );
2347  };
2348 
2349  if (vec_r_schur[idx] != -1 && vec_c_schur[idx] != -1) {
2350  auto schur_dof_r =
2351  schur_dofs_row->get<PetscGlobalIdx_mi_tag>().find(vec_r_schur[idx]);
2352  auto schur_dof_c =
2353  schur_dofs_col->get<PetscGlobalIdx_mi_tag>().find(vec_c_schur[idx]);
2354 #ifndef NDEBUG
2355  if (schur_dof_r == schur_dofs_row->get<PetscGlobalIdx_mi_tag>().end()) {
2356  CHK_THROW_MESSAGE(MOFEM_DATA_INCONSISTENCY, "Block <Schur> not found");
2357  }
2358  if (schur_dof_c == schur_dofs_col->get<PetscGlobalIdx_mi_tag>().end()) {
2359  CHK_THROW_MESSAGE(MOFEM_DATA_INCONSISTENCY, "Block <Schur> not found");
2360  }
2361 #endif // NDEBUG
2362  insert(data_ptrs[0]->blockIndex, *schur_dof_r, *schur_dof_c, d);
2363  }
2364 
2365  if (vec_r_schur[idx] != -1 && vec_c_block[idx] != -1) {
2366  auto schur_dof_r =
2367  schur_dofs_row->get<PetscGlobalIdx_mi_tag>().find(vec_r_schur[idx]);
2368  auto block_dof_c =
2369  block_dofs_col->get<PetscGlobalIdx_mi_tag>().find(vec_c_block[idx]);
2370 #ifndef NDEBUG
2371  if (schur_dof_r == schur_dofs_row->get<PetscGlobalIdx_mi_tag>().end()) {
2372  CHK_THROW_MESSAGE(MOFEM_DATA_INCONSISTENCY, "Block <Schur> not found");
2373  }
2374  if (block_dof_c == block_dofs_col->get<PetscGlobalIdx_mi_tag>().end()) {
2375  CHK_THROW_MESSAGE(MOFEM_DATA_INCONSISTENCY, "Block <Block> not found");
2376  }
2377 #endif
2378  insert(data_ptrs[1]->blockIndex, *schur_dof_r, *block_dof_c, d);
2379  }
2380 
2381  if (vec_r_block[idx] != -1 && vec_c_schur[idx] != -1) {
2382  auto block_dof_r =
2383  block_dofs_row->get<PetscGlobalIdx_mi_tag>().find(vec_r_block[idx]);
2384  auto schur_dof_c =
2385  schur_dofs_col->get<PetscGlobalIdx_mi_tag>().find(vec_c_schur[idx]);
2386 #ifndef NDEBUG
2387  if (block_dof_r == block_dofs_row->get<PetscGlobalIdx_mi_tag>().end()) {
2388  CHK_THROW_MESSAGE(MOFEM_DATA_INCONSISTENCY, "Block <Block> not found");
2389  }
2390  if (schur_dof_c == schur_dofs_col->get<PetscGlobalIdx_mi_tag>().end()) {
2391  CHK_THROW_MESSAGE(MOFEM_DATA_INCONSISTENCY, "Block <Schur> not found");
2392  }
2393 #endif // NDEBUG
2394  insert(data_ptrs[2]->blockIndex, *block_dof_r, *schur_dof_c, d);
2395  }
2396 
2397  if (vec_r_block[idx] != -1 && vec_c_block[idx] != -1) {
2398  auto block_dof_r =
2399  block_dofs_row->get<PetscGlobalIdx_mi_tag>().find(vec_r_block[idx]);
2400  auto block_dof_c =
2401  block_dofs_col->get<PetscGlobalIdx_mi_tag>().find(vec_c_block[idx]);
2402  insert(data_ptrs[3]->blockIndex, *block_dof_r, *block_dof_c, d);
2403  }
2404 
2405  ++idx;
2406  }
2407 
2408  // set data for a00 solve (inverse blocks)
2409  auto set_up_a00_data = [&](auto inv_block_data) {
2411 
2412  auto get_forward_list = [&]() {
2413  std::vector<int> list;
2414  list.reserve(fields_names.size());
2415  for (auto s = 0; s != fields_names.size(); ++s) {
2416  list.push_back(s);
2417  }
2418  return list;
2419  };
2420 
2421  auto get_reverse_list = [&]() {
2422  std::vector<int> list;
2423  list.reserve(fields_names.size());
2424  for (auto s = 0; s != fields_names.size(); ++s) {
2425  list.push_back(fields_names.size() - s - 1);
2426  }
2427  return list;
2428  };
2429 
2430  // get uids on the diagonal of a00 block
2431  auto get_a00_uids = [&](auto &&list) {
2432  auto get_field_bit = [&](auto field_name) {
2433  return m_field_ptr->get_field_bit_number(field_name);
2434  };
2435 
2436  std::vector<std::pair<UId, UId>> a00_uids;
2437  a00_uids.reserve(fields_names.size());
2438  for (auto ss : list) {
2439  auto field_bit = get_field_bit(fields_names[ss]);
2440  auto row_ents = field_ents[ss];
2441  if (row_ents) {
2442  for (auto p = row_ents->pair_begin(); p != row_ents->pair_end();
2443  ++p) {
2444  auto lo_uid =
2445  FieldEntity::getLoLocalEntityBitNumber(field_bit, p->first);
2446  auto hi_uid =
2447  FieldEntity::getHiLocalEntityBitNumber(field_bit, p->second);
2448  a00_uids.push_back(std::make_pair(lo_uid, hi_uid));
2449  }
2450  } else {
2451  auto lo_uid = FieldEntity::getLoLocalEntityBitNumber(
2452  field_bit, get_id_for_min_type<MBVERTEX>());
2453  auto hi_uid = FieldEntity::getHiLocalEntityBitNumber(
2454  field_bit, get_id_for_max_type<MBENTITYSET>());
2455  a00_uids.push_back(std::make_pair(lo_uid, hi_uid));
2456  }
2457  }
2458  return a00_uids;
2459  };
2460 
2461  // get global indexes for a00 block
2462  auto get_glob_idex_pairs = [&](auto &&uid_pairs) {
2463  std::vector<std::pair<int, int>> glob_idex_pairs;
2464  glob_idex_pairs.reserve(uid_pairs.size());
2465  auto dofs = block_prb->getNumeredRowDofsPtr();
2466 
2467  auto it = uid_pairs.rbegin();
2468  auto hi = uid_pairs.rend();
2469 
2470  for (; it != hi; ++it) {
2471  auto [lo_uid, hi_uid] = *it;
2472  auto lo_it = dofs->lower_bound(lo_uid);
2473  auto hi_it = dofs->upper_bound(hi_uid);
2474  if (lo_it != hi_it) {
2475  auto lo_idx = (*lo_it)->getPetscGlobalDofIdx();
2476  glob_idex_pairs.emplace_back(lo_idx, std::distance(lo_it, hi_it));
2477  }
2478  }
2479  // pair of local index and number of dofs
2480  return glob_idex_pairs;
2481  };
2482 
2483  auto &index_view =
2484  boost::dynamic_pointer_cast<DiagBlockInvStruture>(inv_block_data)
2485  ->indexView;
2486 
2487  // set struture to keep indices to mat solve of a00
2488  index_view.lowView.resize(0);
2489  index_view.lowView.reserve(inv_block_data->blockIndex.size());
2490  index_view.diagLoRange.resize(0);
2491  index_view.diagLoRange.reserve(inv_block_data->blockIndex.size() + 1);
2492  index_view.diagLoRange.push_back(0);
2493 
2494  index_view.upView.resize(0);
2495  index_view.upView.reserve(inv_block_data->blockIndex.size());
2496  index_view.diagUpRange.resize(0);
2497  index_view.diagUpRange.reserve(inv_block_data->blockIndex.size() + 1);
2498  index_view.diagUpRange.push_back(0);
2499 
2500  // this enable search by varying ranges
2501  using BlockIndexView = multi_index_container<
2502 
2503  const DiagBlockIndex::Indexes *,
2504 
2505  indexed_by<
2506 
2507  ordered_non_unique<const_mem_fun<DiagBlockIndex::Indexes, int,
2508  &DiagBlockIndex::Indexes::getRow>>
2509 
2510  >>;
2511 
2512  BlockIndexView block_index_view;
2513  for (auto it = inv_block_data->blockIndex.template get<1>().begin();
2514  it != inv_block_data->blockIndex.template get<1>().end(); ++it) {
2515  block_index_view.insert(&*it);
2516  }
2517 
2518  auto set_index_view_data = [&](
2519 
2520  int start,
2521 
2522  auto &&glob_idx_pairs,
2523 
2524  auto &view, auto &range
2525 
2526  ) {
2527  // iterate field & entities pairs
2528  for (auto s1 = start; s1 < glob_idx_pairs.size(); ++s1) {
2529 
2530  // iterate matrix indexes
2531  // index, and numer of dofs
2532  auto [lo_idx, nb] = glob_idx_pairs[s1];
2533  auto it = block_index_view.lower_bound(lo_idx);
2534  auto hi = block_index_view.end();
2535 
2536  // iterate rows
2537  while (it != hi &&
2538  ((*it)->getRow() + (*it)->getNbRows()) <= lo_idx + nb) {
2539 
2540  auto row = (*it)->getRow();
2541 
2542  auto get_diag_index =
2543  [&](auto it) -> const MoFEM::DiagBlockIndex::Indexes * {
2544  while (it != hi && (*it)->getRow() == row) {
2545  if ((*it)->getCol() == row &&
2546  (*it)->getNbCols() == (*it)->getNbRows()) {
2547  auto ptr = *it;
2548  return ptr;
2549  }
2550  ++it;
2551  }
2552  CHK_THROW_MESSAGE(MOFEM_DATA_INCONSISTENCY, "Diagonal not found");
2553  return nullptr;
2554  };
2555 
2556  auto push_off_diag = [&](auto it, auto s1) {
2557  while (it != hi && (*it)->getRow() == row) {
2558  for (int s2 = 0; s2 < s1; ++s2) {
2559  auto [col_lo_idx, col_nb] = glob_idx_pairs[s2];
2560  if ((*it)->getCol() >= col_lo_idx &&
2561  (*it)->getCol() + (*it)->getNbCols() <=
2562  col_lo_idx + col_nb) {
2563  view.push_back(*it);
2564  }
2565  }
2566  ++it;
2567  }
2568  };
2569 
2570  view.push_back(get_diag_index(it));
2571  push_off_diag(it, s1);
2572  range.push_back(view.size());
2573 
2574  while (it != hi && (*it)->getRow() == row) {
2575  ++it;
2576  }
2577  }
2578  }
2579  };
2580 
2581  set_index_view_data(
2582 
2583  0,
2584 
2585  get_glob_idex_pairs(get_a00_uids(get_forward_list())),
2586 
2587  index_view.lowView, index_view.diagLoRange
2588 
2589  );
2590 
2591  set_index_view_data(
2592 
2593  0,
2594 
2595  get_glob_idex_pairs(get_a00_uids(get_reverse_list())),
2596 
2597  index_view.upView, index_view.diagUpRange
2598 
2599  );
2600 
2601  // calculate size of invert matrix vector, and set internal data
2602  auto set_inv_mat = [&](auto inv_mem_size, auto &view, auto &range) {
2603  auto get_vec = [&](auto &view) {
2604  std::vector<int> vec_r, vec_c;
2605  vec_r.reserve(view.size());
2606  vec_c.reserve(view.size());
2607  for (auto &i : view) {
2608  vec_r.push_back(i->getRow());
2609  vec_c.push_back(i->getCol());
2610  }
2611  return std::make_pair(vec_r, vec_c);
2612  };
2613 
2614  auto [vec_row, vec_col] = get_vec(view);
2616  AOPetscToApplication(ao_block_row, vec_row.size(), &*vec_row.begin()),
2617  "apply ao");
2619  AOPetscToApplication(ao_block_col, vec_col.size(), &*vec_col.begin()),
2620  "apply ao");
2621 
2622  for (auto s1 = 0; s1 != range.size() - 1; ++s1) {
2623  auto lo = range[s1];
2624  auto hi = range[s1 + 1];
2625  for (; lo != hi; ++lo) {
2626  auto diag_index_ptr = view[lo];
2627  auto row = vec_row[lo];
2628  auto col = vec_col[lo];
2629  auto nb_rows = diag_index_ptr->getNbRows();
2630  auto nb_cols = diag_index_ptr->getNbCols();
2631  auto it = block_mat_data_ptr->blockIndex.get<1>().find(
2632  boost::make_tuple(row, col, nb_rows, nb_cols));
2633  if (it == block_mat_data_ptr->blockIndex.get<1>().end()) {
2634  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
2635  "Block not found");
2636  }
2637  if (it->getInvShift() == -1) {
2638  it->getInvShift() = inv_mem_size;
2639  inv_mem_size += nb_rows * nb_cols;
2640  }
2641  diag_index_ptr->getInvShift() = it->getInvShift();
2642  }
2643  }
2644 
2645  return inv_mem_size;
2646  };
2647 
2648  // allocate memory for invert matrix solver
2649  auto allocate_inv_block = [&](auto inv_mem_size) {
2650  auto inv_data_ptr =
2651  boost::make_shared<std::vector<double>>(inv_mem_size, 0);
2652  data_ptrs[3]->dataInvBlocksPtr = inv_data_ptr;
2653  block_mat_data_ptr->dataInvBlocksPtr = data_ptrs[3]->dataInvBlocksPtr;
2654  };
2655 
2656  int inv_mem_size = 0;
2657  inv_mem_size =
2658  set_inv_mat(inv_mem_size, index_view.lowView, index_view.diagLoRange);
2659  inv_mem_size =
2660  set_inv_mat(inv_mem_size, index_view.upView, index_view.diagUpRange);
2661  allocate_inv_block(inv_mem_size);
2662 
2663  if (add_preconditioner_block) {
2664  auto preconditioned_block = boost::make_shared<std::vector<double>>(
2665  data_ptrs[3]->dataInvBlocksPtr->size(), 0);
2666  data_ptrs[3]->preconditionerBlocksPtr = preconditioned_block;
2667  data_ptrs[3]->multiplyByPreconditioner = true;
2668  block_mat_data_ptr->preconditionerBlocksPtr =
2669  data_ptrs[3]->preconditionerBlocksPtr;
2670  block_mat_data_ptr->multiplyByPreconditioner = false;
2671  }
2672 
2674  };
2675 
2676  CHKERR set_up_a00_data(data_ptrs[3]);
2677 
2678  MPI_Comm comm;
2679  CHKERR PetscObjectGetComm((PetscObject)schur_dm, &comm);
2680 
2681  auto create_shell_mat = [&](auto nb_r_loc, auto nb_c_loc, auto nb_r_glob,
2682  auto nb_c_glob, auto data_ptr) {
2683  Mat mat_raw;
2684  CHKERR MatCreateShell(comm, nb_r_loc, nb_c_loc, nb_r_glob, nb_c_glob,
2685  (void *)data_ptr.get(), &mat_raw);
2686  CHKERR setSchurBlockMatOps(mat_raw);
2687  return SmartPetscObj<Mat>(mat_raw);
2688  };
2689 
2690  auto schur_nb_global = schur_prb->getNbDofsRow();
2691  auto block_nb_global = block_prb->getNbDofsRow();
2692  auto schur_nb_local = schur_prb->getNbLocalDofsRow();
2693  auto block_nb_local = block_prb->getNbLocalDofsRow();
2694 
2695  std::array<SmartPetscObj<Mat>, 4> mats_array;
2696  mats_array[0] =
2697  create_shell_mat(schur_nb_local, schur_nb_local, schur_nb_global,
2698  schur_nb_global, data_ptrs[0]);
2699  mats_array[1] =
2700  create_shell_mat(schur_nb_local, block_nb_local, schur_nb_global,
2701  block_nb_global, data_ptrs[1]);
2702  mats_array[2] =
2703  create_shell_mat(block_nb_local, schur_nb_local, block_nb_global,
2704  schur_nb_global, data_ptrs[2]);
2705  mats_array[3] =
2706  create_shell_mat(block_nb_local, block_nb_local, block_nb_global,
2707  block_nb_global, data_ptrs[3]);
2708 
2709  MOFEM_TAG_AND_LOG("SYNC", Sev::verbose, "NestedSchur")
2710  << "(0, 0) " << schur_nb_local << " " << schur_nb_global << " "
2711  << data_ptrs[0]->blockIndex.size();
2712  MOFEM_TAG_AND_LOG("SYNC", Sev::verbose, "NestedSchur")
2713  << "(0, 1) " << schur_nb_local << " " << block_nb_local << " "
2714  << schur_nb_global << " " << block_nb_global << " "
2715  << data_ptrs[1]->blockIndex.size();
2716  MOFEM_TAG_AND_LOG("SYNC", Sev::verbose, "NestedSchur")
2717  << "(1, 0) " << block_nb_local << " " << schur_nb_local << " "
2718  << block_nb_global << " " << schur_nb_global << " "
2719  << data_ptrs[2]->blockIndex.size();
2720  MOFEM_TAG_AND_LOG("SYNC", Sev::verbose, "NestedSchur")
2721  << "(1, 1) " << block_nb_local << " " << block_nb_global << " "
2722  << data_ptrs[3]->blockIndex.size();
2723 
2724  MOFEM_LOG_SEVERITY_SYNC(comm, Sev::verbose);
2725 
2726  auto schur_is = schur_prb->getSubData()->getSmartRowIs();
2727  auto block_is = block_prb->getSubData()->getSmartRowIs();
2728 
2729  return boost::make_shared<NestSchurData>(
2730 
2731  mats_array, data_ptrs, block_mat_data_ptr,
2732  std::make_pair(schur_is, block_is)
2733 
2734  );
2735 }

◆ 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 280 of file Hdiv.cpp.

285  {
286 
287  const int edges_nodes[6][2] = {{0, 1}, {1, 2}, {2, 0},
288  {0, 3}, {1, 3}, {2, 3}};
289 
291  if (p < 2)
293  if (diffN == NULL) {
294  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
295  }
296 
297  FTensor::Tensor1<double, 3> t_coords[4] = {
298  FTensor::Tensor1<double, 3>(0., 0., 0.),
299  FTensor::Tensor1<double, 3>(1., 0., 0.),
300  FTensor::Tensor1<double, 3>(0., 1., 0.),
301  FTensor::Tensor1<double, 3>(0., 0., 1.)};
302  FTensor::Tensor1<double *, 3> t_node_diff_ksi[4] = {
303  FTensor::Tensor1<double *, 3>(&diffN[0], &diffN[1], &diffN[2]),
304  FTensor::Tensor1<double *, 3>(&diffN[3], &diffN[4], &diffN[5]),
305  FTensor::Tensor1<double *, 3>(&diffN[6], &diffN[7], &diffN[8]),
306  FTensor::Tensor1<double *, 3>(&diffN[9], &diffN[10], &diffN[11])};
307 
310 
312  FTensor::Tensor1<double, 3> t_diff_ksi0i;
313  FTensor::Tensor1<double, 3> t_diff_beta_e;
314 
315  double psi_l[p + 1];
316  double diff_psi_l[3 * (p + 1)];
317 
318  for (int ee = 0; ee != 6; ee++) {
319  t_tou_e(i) =
320  t_coords[edges_nodes[ee][1]](i) - t_coords[edges_nodes[ee][0]](i);
321  t_diff_ksi0i(i) = t_node_diff_ksi[edges_nodes[ee][1]](i) -
322  t_node_diff_ksi[edges_nodes[ee][0]](i);
323  FTensor::Tensor1<double *, 3> t_psi_v_e(&phi_v_e[ee][0], &phi_v_e[ee][1],
324  &phi_v_e[ee][2], 3);
325  FTensor::Tensor2<double *, 3, 3> t_diff_phi_v_e(
326  &diff_phi_v_e[ee][HVEC0_0], &diff_phi_v_e[ee][HVEC0_1],
327  &diff_phi_v_e[ee][HVEC0_2], &diff_phi_v_e[ee][HVEC1_0],
328  &diff_phi_v_e[ee][HVEC1_1], &diff_phi_v_e[ee][HVEC1_2],
329  &diff_phi_v_e[ee][HVEC2_0], &diff_phi_v_e[ee][HVEC2_1],
330  &diff_phi_v_e[ee][HVEC2_2], 9);
331  for (int ii = 0; ii != gdim; ii++) {
332  const int node_shift = ii * 4;
333  const double ni = N[node_shift + edges_nodes[ee][1]];
334  const double n0 = N[node_shift + edges_nodes[ee][0]];
335  const double beta_e = ni * n0;
336  const double ksi0i = ni - n0;
337  if (diff_phi_v_e) {
338  t_diff_beta_e(i) = ni * t_node_diff_ksi[edges_nodes[ee][0]](i) +
339  t_node_diff_ksi[edges_nodes[ee][1]](i) * n0;
340  ierr =
341  base_polynomials(p, ksi0i, &t_diff_ksi0i(0), psi_l, diff_psi_l, 3);
342  CHKERRG(ierr);
343  } else {
344  ierr = base_polynomials(p, ksi0i, NULL, psi_l, NULL, 3);
345  CHKERRG(ierr);
346  }
347  FTensor::Tensor0<double *> t_psi_l(&psi_l[0]);
348  FTensor::Tensor1<double *, 3> t_diff_psi_l(
349  &diff_psi_l[0], &diff_psi_l[p + 1], &diff_psi_l[2 * p + 2], 1);
350  for (int l = 0; l <= p - 2; l++) {
351  t_psi_v_e(i) = (beta_e * t_psi_l) * t_tou_e(i);
352  ++t_psi_v_e;
353  if (diff_phi_v_e) {
354  t_diff_phi_v_e(i, j) =
355  (t_diff_beta_e(j) * t_psi_l + beta_e * t_diff_psi_l(j)) *
356  t_tou_e(i);
357  ++t_diff_phi_v_e;
358  ++t_diff_psi_l;
359  }
360  ++t_psi_l;
361  }
362  }
363  }
364 
366 }

◆ 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 13 of file Hdiv.cpp.

18  {
19 
21  for (int ff = 0; ff < 4; ff++) {
22  if (diff_phi_f_e != NULL) {
24  &faces_nodes[3 * ff], p[ff], N, diffN, phi_f_e[ff], diff_phi_f_e[ff],
25  gdim, 4, base_polynomials);
26  CHKERRG(ierr);
27  } else {
29  &faces_nodes[3 * ff], p[ff], N, diffN, phi_f_e[ff], NULL, gdim, 4,
30  base_polynomials);
31  CHKERRG(ierr);
32  }
33  }
35 }

◆ 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 37 of file Hdiv.cpp.

42  {
43 
44  const int face_edges_nodes[3][2] = {{0, 1}, {1, 2}, {2, 0}};
45  const int face_opposite_edges_node[] = {2, 0, 1};
48 
50  if (p < 1)
52 
53  FTensor::Tensor1<double, 3> t_edge_cross[3];
54  FTensor::Tensor1<double, 3> t_node_diff_ksi[4];
55  FTensor::Tensor1<double, 3> t_diff_ksi0i[3];
56  if (diffN != NULL) {
57  t_node_diff_ksi[0] =
58  FTensor::Tensor1<double, 3>(diffN[0], diffN[1], diffN[2]);
59  t_node_diff_ksi[1] =
60  FTensor::Tensor1<double, 3>(diffN[3], diffN[4], diffN[5]);
61  t_node_diff_ksi[2] =
62  FTensor::Tensor1<double, 3>(diffN[6], diffN[7], diffN[8]);
63  t_node_diff_ksi[3] =
64  FTensor::Tensor1<double, 3>(diffN[9], diffN[10], diffN[11]);
65  for (int ee = 0; ee < 3; ee++) {
66  const int n0 = faces_nodes[face_edges_nodes[ee][0]];
67  const int n1 = faces_nodes[face_edges_nodes[ee][1]];
68  t_diff_ksi0i[ee](i) = t_node_diff_ksi[n1](i) - t_node_diff_ksi[n0](i);
69  t_edge_cross[ee](0) = t_node_diff_ksi[n0](1) * t_node_diff_ksi[n1](2) -
70  t_node_diff_ksi[n0](2) * t_node_diff_ksi[n1](1);
71  t_edge_cross[ee](1) = t_node_diff_ksi[n0](2) * t_node_diff_ksi[n1](0) -
72  t_node_diff_ksi[n0](0) * t_node_diff_ksi[n1](2);
73  t_edge_cross[ee](2) = t_node_diff_ksi[n0](0) * t_node_diff_ksi[n1](1) -
74  t_node_diff_ksi[n0](1) * t_node_diff_ksi[n1](0);
75  }
76  } else {
77  for (int ee = 0; ee < 3; ee++) {
78  t_edge_cross[ee](0) = 1;
79  t_edge_cross[ee](1) = 0;
80  t_edge_cross[ee](2) = 0;
81  }
82  }
83  double psi_l[p + 1], diff_psi_l[3 * (p + 1)];
84  boost::shared_ptr<FTensor::Tensor2<FTensor::PackPtr<double *, 9>, 3, 3>>
85  t_diff_phi_f_e_ptr;
86 
87  for (int ee = 0; ee != 3; ee++) {
88  const int i0 = faces_nodes[face_edges_nodes[ee][0]];
89  const int i1 = faces_nodes[face_edges_nodes[ee][1]];
90  const int iO = faces_nodes[face_opposite_edges_node[ee]];
91  FTensor::Tensor1<double *, 3> t_psi_f_e(&phi_f_e[ee][0], &phi_f_e[ee][1],
92  &phi_f_e[ee][2], 3);
93  if (diff_phi_f_e) {
94  t_diff_phi_f_e_ptr = boost::shared_ptr<
97  &diff_phi_f_e[ee][HVEC0_0], &diff_phi_f_e[ee][HVEC0_1],
98  &diff_phi_f_e[ee][HVEC0_2], &diff_phi_f_e[ee][HVEC1_0],
99  &diff_phi_f_e[ee][HVEC1_1], &diff_phi_f_e[ee][HVEC1_2],
100  &diff_phi_f_e[ee][HVEC2_0], &diff_phi_f_e[ee][HVEC2_1],
101  &diff_phi_f_e[ee][HVEC2_2]));
102  }
103  for (int ii = 0; ii != gdim; ii++) {
104  const int node_shift = ii * nb;
105  const double n0 = N[node_shift + i0];
106  const double n1 = N[node_shift + i1];
107  const double lambda = N[node_shift + iO];
108  const double ksi0i = n1 - n0;
109  if (diff_phi_f_e) {
110  ierr = base_polynomials(p, ksi0i, &t_diff_ksi0i[ee](0), psi_l,
111  diff_psi_l, 3);
112  CHKERRG(ierr);
113  } else {
114  ierr = base_polynomials(p, ksi0i, NULL, psi_l, NULL, 3);
115  CHKERRG(ierr);
116  }
119  &diff_psi_l[0], &diff_psi_l[p + 1], &diff_psi_l[2 * p + 2]);
120  for (int l = 0; l <= p - 1; l++) {
121  t_psi_f_e(i) = lambda * t_psi_l * t_edge_cross[ee](i);
122  if (t_diff_phi_f_e_ptr) {
123  (*t_diff_phi_f_e_ptr)(i, j) =
124  (t_node_diff_ksi[iO](j) * t_psi_l + lambda * t_diff_psi_l(j)) *
125  t_edge_cross[ee](i);
126  ++t_diff_psi_l;
127  ++(*t_diff_phi_f_e_ptr);
128  }
129  ++t_psi_f_e;
130  ++t_psi_l;
131  }
132  }
133  }
135 }

◆ 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 368 of file Hdiv.cpp.

373  {
374 
375  const int faces_nodes[4][3] = {{0, 1, 3}, {1, 2, 3}, {0, 2, 3}, {0, 1, 2}};
376 
378  if (p < 3)
380 
381  FTensor::Tensor1<double, 3> t_coords[4] = {
382  FTensor::Tensor1<double, 3>(0., 0., 0.),
383  FTensor::Tensor1<double, 3>(1., 0., 0.),
384  FTensor::Tensor1<double, 3>(0., 1., 0.),
385  FTensor::Tensor1<double, 3>(0., 0., 1.)};
386 
387  FTensor::Tensor1<double *, 3> t_node_diff_ksi[4] = {
388  FTensor::Tensor1<double *, 3>(&diffN[0], &diffN[1], &diffN[2]),
389  FTensor::Tensor1<double *, 3>(&diffN[3], &diffN[4], &diffN[5]),
390  FTensor::Tensor1<double *, 3>(&diffN[6], &diffN[7], &diffN[8]),
391  FTensor::Tensor1<double *, 3>(&diffN[9], &diffN[10], &diffN[11])};
392 
395 
396  FTensor::Tensor1<double, 3> t_tau0i[4], t_tau0j[4];
397  FTensor::Tensor1<double, 3> t_diff_ksi0i[4], t_diff_ksi0j[4];
398  for (int ff = 0; ff != 4; ff++) {
399  const int v0 = faces_nodes[ff][0];
400  const int vi = faces_nodes[ff][1];
401  const int vj = faces_nodes[ff][2];
402  t_tau0i[ff](i) = t_coords[vi](i) - t_coords[v0](i);
403  t_tau0j[ff](i) = t_coords[vj](i) - t_coords[v0](i);
404  t_diff_ksi0i[ff](i) = t_node_diff_ksi[vi](i) - t_node_diff_ksi[v0](i);
405  t_diff_ksi0j[ff](i) = t_node_diff_ksi[vj](i) - t_node_diff_ksi[v0](i);
406  }
407 
408  double psi_l[p + 1], psi_m[p + 1];
409  double diff_psi_l[3 * (p + 1)], diff_psi_m[3 * (p + 1)];
410  for (int ff = 0; ff != 4; ff++) {
411  const int v0 = faces_nodes[ff][0];
412  const int vi = faces_nodes[ff][1];
413  const int vj = faces_nodes[ff][2];
415  &phi_v_f[ff][HVEC0], &phi_v_f[ff][HVEC1], &phi_v_f[ff][HVEC2], 3);
416  FTensor::Tensor2<double *, 3, 3> t_diff_phi_v_f(
417  &diff_phi_v_f[ff][HVEC0_0], &diff_phi_v_f[ff][HVEC0_1],
418  &diff_phi_v_f[ff][HVEC0_2], &diff_phi_v_f[ff][HVEC1_0],
419  &diff_phi_v_f[ff][HVEC1_1], &diff_phi_v_f[ff][HVEC1_2],
420  &diff_phi_v_f[ff][HVEC2_0], &diff_phi_v_f[ff][HVEC2_1],
421  &diff_phi_v_f[ff][HVEC2_2], 9);
422  for (int ii = 0; ii < gdim; ii++) {
423  const int node_shift = 4 * ii;
424  const double n0 = N[node_shift + v0];
425  const double ni = N[node_shift + vi];
426  const double nj = N[node_shift + vj];
427  const double beta_f = n0 * ni * nj;
428  FTensor::Tensor1<double, 3> t_diff_beta_f;
429  t_diff_beta_f(i) = (ni * nj) * t_node_diff_ksi[v0](i) +
430  (n0 * nj) * t_node_diff_ksi[vi](i) +
431  (n0 * ni) * t_node_diff_ksi[vj](i);
432  const double ksi0i = ni - n0;
433  const double ksi0j = nj - n0;
434  ierr = base_polynomials(p, ksi0i, &t_diff_ksi0i[ff](0), psi_l, diff_psi_l,
435  3);
436  CHKERRG(ierr);
437  ierr = base_polynomials(p, ksi0j, &t_diff_ksi0j[ff](0), psi_m, diff_psi_m,
438  3);
439  CHKERRG(ierr);
441  int jj = 0;
442  for (int oo = 0; oo <= p - 3; oo++) {
443  FTensor::Tensor0<double *> t_psi_l(&psi_l[0], 1);
444  FTensor::Tensor1<double *, 3> t_diff_psi_l(
445  diff_psi_l, &diff_psi_l[p + 1], &diff_psi_l[2 * p + 2], 1);
446  for (int l = 0; l <= oo; l++) {
447  int m = oo - l;
448  if (m >= 0) {
449 
450  FTensor::Tensor1<double *, 3> t_diff_psi_m(
451  &diff_psi_m[m], &diff_psi_m[p + 1 + m],
452  &diff_psi_m[2 * p + 2 + m], 1);
453  const double a = beta_f * t_psi_l * psi_m[m];
454  t_phi_v_f(i) = a * t_tau0i[ff](i);
455  ++t_phi_v_f;
456  ++jj;
457  t_phi_v_f(i) = a * t_tau0j[ff](i);
458  ++t_phi_v_f;
459  ++jj;
460 
461  t_diff_a(j) = (t_psi_l * psi_m[m]) * t_diff_beta_f(j) +
462  (beta_f * psi_m[m]) * t_diff_psi_l(j) +
463  (beta_f * t_psi_l) * t_diff_psi_m(j);
464  t_diff_phi_v_f(i, j) = t_diff_a(j) * t_tau0i[ff](i);
465  ++t_diff_phi_v_f;
466  t_diff_phi_v_f(i, j) = t_diff_a(j) * t_tau0j[ff](i);
467  ++t_diff_phi_v_f;
468 
469  ++t_psi_l;
470  ++t_diff_psi_l;
471  }
472  }
473  }
474  if (jj != NBVOLUMETET_AINSWORTH_FACE_HDIV(p)) {
475  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
476  "wrong order %d != %d", jj,
478  }
479  }
480  }
482 }

◆ 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 137 of file Hdiv.cpp.

142  {
143 
145  for (int ff = 0; ff < 4; ff++) {
146  double *diff;
147  if (diff_phi_f != NULL) {
148  diff = diff_phi_f[ff];
149  } else {
150  diff = NULL;
151  }
153  &faces_nodes[3 * ff], p[ff], N, diffN, phi_f[ff], diff, gdim, 4,
154  base_polynomials);
155  CHKERRG(ierr);
156  }
158 }

◆ 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 160 of file Hdiv.cpp.

165  {
168 
170  if (p < 3)
172 
173  const int vert_i = face_nodes[1];
174  const int vert_j = face_nodes[2];
175  const int i0 = face_nodes[0];
177  FTensor::Tensor1<double, 3> t_node_diff_ksi[4];
178  FTensor::Tensor1<double, 3> t_diff_ksi0i;
179  FTensor::Tensor1<double, 3> t_diff_ksi0j;
180 
181  if (diffN) {
182  t_node_diff_ksi[0] =
183  FTensor::Tensor1<double, 3>(diffN[0], diffN[1], diffN[2]);
184  t_node_diff_ksi[1] =
185  FTensor::Tensor1<double, 3>(diffN[3], diffN[4], diffN[5]);
186  t_node_diff_ksi[2] =
187  FTensor::Tensor1<double, 3>(diffN[6], diffN[7], diffN[8]);
188  t_node_diff_ksi[3] =
189  FTensor::Tensor1<double, 3>(diffN[9], diffN[10], diffN[11]);
190  t_diff_ksi0i(i) = t_node_diff_ksi[vert_i](i) - t_node_diff_ksi[i0](i);
191  t_diff_ksi0j(i) = t_node_diff_ksi[vert_j](i) - t_node_diff_ksi[i0](i);
192  t_cross(0) = t_node_diff_ksi[vert_i](1) * t_node_diff_ksi[vert_j](2) -
193  t_node_diff_ksi[vert_i](2) * t_node_diff_ksi[vert_j](1);
194  t_cross(1) = t_node_diff_ksi[vert_i](2) * t_node_diff_ksi[vert_j](0) -
195  t_node_diff_ksi[vert_i](0) * t_node_diff_ksi[vert_j](2);
196  t_cross(2) = t_node_diff_ksi[vert_i](0) * t_node_diff_ksi[vert_j](1) -
197  t_node_diff_ksi[vert_i](1) * t_node_diff_ksi[vert_j](0);
198  } else {
199  t_cross(0) = 1;
200  t_cross(1) = 0;
201  t_cross(2) = 0;
202  }
203 
204  double psi_l[p + 1], diff_psi_l[3 * (p + 1)];
205  double psi_m[p + 1], diff_psi_m[3 * (p + 1)];
206  FTensor::Tensor1<double, 3> t_diff_beta_0ij(0.,0.,0.);
207 
208  FTensor::Tensor1<double *, 3> t_psi_f(&phi_f[HVEC0], &phi_f[HVEC1],
209  &phi_f[HVEC2], 3);
210 
211  boost::shared_ptr<FTensor::Tensor2<double *, 3, 3> > t_diff_phi_f_ptr;
212  if (diff_phi_f) {
213  t_diff_phi_f_ptr = boost::shared_ptr<FTensor::Tensor2<double *, 3, 3> >(
215  &diff_phi_f[HVEC0_0], &diff_phi_f[HVEC0_1], &diff_phi_f[HVEC0_2],
216  &diff_phi_f[HVEC1_0], &diff_phi_f[HVEC1_1], &diff_phi_f[HVEC1_2],
217  &diff_phi_f[HVEC2_0], &diff_phi_f[HVEC2_1], &diff_phi_f[HVEC2_2],
218  9));
219  }
220 
221  for (int ii = 0; ii < gdim; ii++) {
222 
223  int node_shift = ii * nb;
224  const double ni = N[node_shift + vert_i];
225  const double nj = N[node_shift + vert_j];
226  const double n0 = N[node_shift + i0];
227  const double ksi0i = ni - n0;
228  const double ksi0j = nj - n0;
229  double beta_0ij = n0 * ni * nj;
230  if (diff_phi_f) {
231  t_diff_beta_0ij(i) = (ni * nj) * t_node_diff_ksi[i0](i) +
232  (n0 * nj) * t_node_diff_ksi[vert_i](i) +
233  (n0 * ni) * t_node_diff_ksi[vert_j](i);
234  ierr = base_polynomials(p, ksi0i, &t_diff_ksi0i(0), psi_l, diff_psi_l, 3);
235  CHKERRG(ierr);
236  ierr = base_polynomials(p, ksi0j, &t_diff_ksi0j(0), psi_m, diff_psi_m, 3);
237  CHKERRG(ierr);
238  } else {
239  ierr = base_polynomials(p, ksi0i, NULL, psi_l, NULL, 3);
240  CHKERRG(ierr);
241  ierr = base_polynomials(p, ksi0j, NULL, psi_m, NULL, 3);
242  CHKERRG(ierr);
243  }
244 
245  int jj = 0;
246  int oo = 0;
247  for (; oo <= p - 3; oo++) {
248  FTensor::Tensor0<double *> t_psi_l(&psi_l[0]);
249  FTensor::Tensor1<double *, 3> t_diff_psi_l(diff_psi_l, &diff_psi_l[p + 1],
250  &diff_psi_l[2 * p + 2], 1);
251  for (int l = 0; l <= oo; l++) {
252  int m = oo - l;
253  if (m >= 0) {
254  FTensor::Tensor1<double, 3> t_diff_psi_m(
255  diff_psi_m[m], diff_psi_m[p + 1 + m], diff_psi_m[2 * p + 2 + m]);
256  t_psi_f(i) = (beta_0ij * t_psi_l * psi_m[m]) * t_cross(i);
257  ++t_psi_f;
258  if (diff_phi_f) {
259  (*t_diff_phi_f_ptr)(i, j) =
260  ((t_psi_l * psi_m[m]) * t_diff_beta_0ij(j) +
261  (beta_0ij * psi_m[m]) * t_diff_psi_l(j) +
262  (beta_0ij * t_psi_l) * t_diff_psi_m(j)) *
263  t_cross(i);
264  ++(*t_diff_phi_f_ptr);
265  }
266  }
267  ++t_psi_l;
268  ++t_diff_psi_l;
269  ++jj;
270  }
271  }
272  if (jj != NBFACETRI_AINSWORTH_FACE_HDIV(p)) {
273  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
274  "wrong order %d != %d", jj, NBFACETRI_AINSWORTH_FACE_HDIV(p));
275  }
276  }
278 }

◆ 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 484 of file Hdiv.cpp.

489  {
490 
492  if (p < 4)
494 
495  FTensor::Tensor1<double *, 3> t_node_diff_ksi[4] = {
496  FTensor::Tensor1<double *, 3>(&diffN[0], &diffN[1], &diffN[2]),
497  FTensor::Tensor1<double *, 3>(&diffN[3], &diffN[4], &diffN[5]),
498  FTensor::Tensor1<double *, 3>(&diffN[6], &diffN[7], &diffN[8]),
499  FTensor::Tensor1<double *, 3>(&diffN[9], &diffN[10], &diffN[11])};
500 
506 
507  FTensor::Tensor1<double, 3> t_diff_ksi0i;
508  FTensor::Tensor1<double, 3> t_diff_ksi0j;
509  FTensor::Tensor1<double, 3> t_diff_ksi0k;
510 
511  t_diff_ksi0i(i) = t_node_diff_ksi[1](i) - t_node_diff_ksi[0](i);
512  t_diff_ksi0j(i) = t_node_diff_ksi[2](i) - t_node_diff_ksi[0](i);
513  t_diff_ksi0k(i) = t_node_diff_ksi[3](i) - t_node_diff_ksi[0](i);
514 
515  double psi_l[p + 1];
516  double diff_psi_l[3 * (p + 1)];
517  double psi_m[p + 1];
518  double diff_psi_m[3 * (p + 1)];
519  double psi_n[p + 1];
520  double diff_psi_n[3 * (p + 1)];
521 
522  FTensor::Tensor1<double *, 3> t_phi_v(phi_v, &phi_v[HVEC1], &phi_v[HVEC2], 3);
524  diff_phi_v, &diff_phi_v[HVEC0_1], &diff_phi_v[HVEC0_2],
525  &diff_phi_v[HVEC1_0], &diff_phi_v[HVEC1_1], &diff_phi_v[HVEC1_2],
526  &diff_phi_v[HVEC2_0], &diff_phi_v[HVEC2_1], &diff_phi_v[HVEC2_2], 9);
527 
528  FTensor::Tensor1<double, 3> t_diff_beta_v;
529  for (int ii = 0; ii < gdim; ii++) {
530  const int node_shift = ii * 4;
531  const double n0 = N[node_shift + 0];
532  const double ni = N[node_shift + 1];
533  const double nj = N[node_shift + 2];
534  const double nk = N[node_shift + 3];
535  const double ksi0i = ni - n0;
536  const double ksi0j = nj - n0;
537  const double ksi0k = nk - n0;
538  const double beta_v = n0 * ni * nj * nk;
539  t_diff_beta_v(i) = (ni * nj * nk) * t_node_diff_ksi[0](i) +
540  (n0 * nj * nk) * t_node_diff_ksi[1](i) +
541  (n0 * ni * nk) * t_node_diff_ksi[2](i) +
542  (n0 * ni * nj) * t_node_diff_ksi[3](i);
543  ierr = base_polynomials(p, ksi0i, &t_diff_ksi0i(0), psi_l, diff_psi_l, 3);
544  CHKERRG(ierr);
545  ierr = base_polynomials(p, ksi0j, &t_diff_ksi0j(0), psi_m, diff_psi_m, 3);
546  CHKERRG(ierr);
547  ierr = base_polynomials(p, ksi0k, &t_diff_ksi0k(0), psi_n, diff_psi_n, 3);
548  CHKERRG(ierr);
549 
551 
552  int jj = 0;
553  for (int oo = 0; oo <= p - 4; oo++) {
554  FTensor::Tensor0<double *> t_psi_l(&psi_l[0]);
555  FTensor::Tensor1<double *, 3> t_diff_psi_l(diff_psi_l, &diff_psi_l[p + 1],
556  &diff_psi_l[2 * p + 2], 1);
557  for (int l = 0; l <= oo; l++) {
558  FTensor::Tensor0<double *> t_psi_m(&psi_m[0]);
559  FTensor::Tensor1<double *, 3> t_diff_psi_m(
560  diff_psi_m, &diff_psi_m[p + 1], &diff_psi_m[2 * p + 2], 1);
561  for (int m = 0; (l + m) <= oo; m++) {
562  int n = oo - l - m;
563  if (n >= 0) {
564  FTensor::Tensor1<double, 3> t_diff_psi_n(diff_psi_n[n],
565  diff_psi_n[p + 1 + n],
566  diff_psi_n[2 * p + 2 + n]);
567  const double a = beta_v * t_psi_l * t_psi_m * psi_n[n];
568  t_phi_v(0) = a;
569  t_phi_v(1) = 0;
570  t_phi_v(2) = 0;
571  ++t_phi_v;
572  t_phi_v(0) = 0;
573  t_phi_v(1) = a;
574  t_phi_v(2) = 0;
575  ++t_phi_v;
576  t_phi_v(0) = 0;
577  t_phi_v(1) = 0;
578  t_phi_v(2) = a;
579  ++t_phi_v;
580  t_diff_a(j) = (t_psi_l * t_psi_m * psi_n[n]) * t_diff_beta_v(j) +
581  (beta_v * t_psi_m * psi_n[n]) * t_diff_psi_l(j) +
582  (beta_v * t_psi_l * psi_n[n]) * t_diff_psi_m(j) +
583  (beta_v * t_psi_l * t_psi_m) * t_diff_psi_n(j);
584  t_diff_phi_v(N0, j) = t_diff_a(j);
585  t_diff_phi_v(N1, j) = 0;
586  t_diff_phi_v(N2, j) = 0;
587  ++t_diff_phi_v;
588  t_diff_phi_v(N0, j) = 0;
589  t_diff_phi_v(N1, j) = t_diff_a(j);
590  t_diff_phi_v(N2, j) = 0;
591  ++t_diff_phi_v;
592  t_diff_phi_v(N0, j) = 0;
593  t_diff_phi_v(N1, j) = 0;
594  t_diff_phi_v(N2, j) = t_diff_a(j);
595  ++t_diff_phi_v;
596  ++jj;
597  }
598  ++t_psi_m;
599  ++t_diff_psi_m;
600  }
601  ++t_psi_l;
602  ++t_diff_psi_l;
603  }
604  }
605 
606  if (3 * jj != NBVOLUMETET_AINSWORTH_VOLUME_HDIV(p)) {
607  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
608  "wrong order %d != %d", jj,
610  }
611  }
612 
614 }

◆ 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 617 of file Hdiv.cpp.

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

◆ 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 762 of file Hdiv.cpp.

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

◆ id_from_handle()

auto MoFEM::id_from_handle ( const EntityHandle  h)
inline

Definition at line 1868 of file Templates.hpp.

1868  {
1869  return static_cast<EntityID>(h & MB_ID_MASK);
1870 };

◆ 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 1795 of file Templates.hpp.

1796  {
1797  moab::Range::iterator hint = r.begin();
1798  while (begin_iter != end_iter) {
1799  size_t j = 0;
1800  auto bi = Extractor::extract(begin_iter);
1801  Iterator pj = begin_iter;
1802  while (pj != end_iter && (bi + j) == Extractor::extract(pj)) {
1803  ++pj;
1804  ++j;
1805  }
1806  hint = r.insert(hint, bi, bi + (j - 1));
1807  begin_iter = pj;
1808  }
1809  return hint;
1810 };

◆ 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

Definition at line 1749 of file Templates.hpp.

1750  {
1751  return InvertTensorImpl<FTensor::Tensor2<T1, DIM, DIM>, T2,
1752  FTensor::Tensor2<T3, DIM, DIM>, DIM>::invert(t, det,
1753  inv_t);
1754 }

◆ 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 1758 of file Templates.hpp.

1759  {
1760  return InvertTensorImpl<FTensor::Tensor2_symmetric<T1, DIM>, T2,
1762  DIM>::invert(t, det, inv_t);
1763 }

◆ 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 1627 of file Templates.hpp.

1627  {
1629  const auto inv_det = 1. / det;
1630  inv_t(0, 0) = t(1, 1) * inv_det;
1631  inv_t(0, 1) = -t(0, 1) * inv_det;
1632  inv_t(1, 0) = -t(1, 0) * inv_det;
1633  inv_t(1, 1) = t(0, 0) * inv_det;
1635 }

◆ 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 1607 of file Templates.hpp.

1607  {
1609  const auto inv_det = 1. / det;
1610  inv_t(0, 0) = (t(1, 1) * t(2, 2) - t(1, 2) * t(2, 1)) * inv_det;
1611  inv_t(0, 1) = (t(0, 2) * t(2, 1) - t(0, 1) * t(2, 2)) * inv_det;
1612  inv_t(0, 2) = (t(0, 1) * t(1, 2) - t(0, 2) * t(1, 1)) * inv_det;
1613  inv_t(1, 0) = (t(1, 2) * t(2, 0) - t(1, 0) * t(2, 2)) * inv_det;
1614  inv_t(1, 1) = (t(0, 0) * t(2, 2) - t(0, 2) * t(2, 0)) * inv_det;
1615  inv_t(1, 2) = (t(0, 2) * t(1, 0) - t(0, 0) * t(1, 2)) * inv_det;
1616  inv_t(2, 0) = (t(1, 0) * t(2, 1) - t(1, 1) * t(2, 0)) * inv_det;
1617  inv_t(2, 1) = (t(0, 1) * t(2, 0) - t(0, 0) * t(2, 1)) * inv_det;
1618  inv_t(2, 2) = (t(0, 0) * t(1, 1) - t(0, 1) * t(1, 0)) * inv_det;
1620 }

◆ 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 1566 of file Templates.hpp.

1568  {
1570  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
1571  "Specialization for this template not yet implemented");
1573 }

◆ 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 1968 of file Templates.hpp.

1968  {
1969  if constexpr (std::is_same<void, Dest>::value)
1970  return std::array<std::common_type_t<std::decay_t<Arg>...>, sizeof...(Arg)>{
1971  {std::forward<Arg>(arg)...}};
1972  else
1973  return std::array<Dest, sizeof...(Arg)>{{std::forward<Arg>(arg)...}};
1974 }

◆ mat_zero()

static PetscErrorCode MoFEM::mat_zero ( Mat  m)
static

Definition at line 1472 of file Schur.cpp.

1472  {
1474  BlockStructure *ctx;
1475  CHKERR MatShellGetContext(m, (void **)&ctx);
1476  if (ctx->dataBlocksPtr)
1477  std::fill(ctx->dataBlocksPtr->begin(), ctx->dataBlocksPtr->end(), 0.);
1478  if (ctx->dataInvBlocksPtr)
1479  std::fill(ctx->dataInvBlocksPtr->begin(), ctx->dataInvBlocksPtr->end(), 0.);
1480  if (ctx->preconditionerBlocksPtr)
1481  std::fill(ctx->preconditionerBlocksPtr->begin(),
1482  ctx->preconditionerBlocksPtr->end(), 0.);
1484 }

◆ 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, elasticity.cpp, and EshelbianPlasticity.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 1634 of file EntitiesFieldData.hpp.

1637  {
1638  static_assert(!std::is_same<T, T>::value,
1639  "MatSetValues value for this data storage is not implemented");
1640  return MOFEM_NOT_IMPLEMENTED;
1641 }

◆ 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 1660 of file EntitiesFieldData.hpp.

1663  {
1664  return MatSetValues<T>(M, row_data, col_data, &*mat.data().begin(), iora);
1665 }

◆ 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 262 of file Schur.hpp.

265  {
266  return MatSetValues<BlockStructure>(M, row_data, col_data, mat, iora);
267 }

◆ 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 335 of file Schur.hpp.

338  {
339  return MatSetValues<SchurElemMatsPreconditionedBlock>(M, row_data, col_data,
340  mat, iora);
341 }

◆ 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 303 of file Schur.hpp.

306  {
307  return MatSetValues<SchurElemMatsBlock>(M, row_data, col_data, mat, iora);
308 }

◆ 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 2865 of file Schur.cpp.

2868  {
2869  return MatSetValues<SchurElemMats>(M, row_data, col_data, mat, iora);
2870 }

◆ 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 2875 of file Schur.cpp.

2877  {
2878  return shell_block_mat_asmb_wrap(M, row_data, col_data, mat, iora);
2879 }

◆ 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 1669 of file EntitiesFieldData.hpp.

1671  {
1672  return MatSetValues(
1673  M, row_data.getIndices().size(), &*row_data.getIndices().begin(),
1674  col_data.getIndices().size(), &*col_data.getIndices().begin(), ptr, iora);
1675 }

◆ 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 2831 of file Schur.cpp.

2833  {
2834  return SchurElemMats::MatSetValues(M, row_data, col_data, mat, iora);
2835 }

◆ 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 2907 of file Schur.cpp.

2910  {
2911  return SchurElemMatsBlock::MatSetValues(M, row_data, col_data, mat, iora);
2912 }

◆ 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 2938 of file Schur.cpp.

2941  {
2942  return SchurElemMatsPreconditionedBlock::MatSetValues(M, row_data, col_data,
2943  mat, iora);
2944 }

◆ 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 209 of file MedInterface.cpp.

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

◆ MoFEMSNESMonitorFields()

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

Sens monitor printing residual field by field.

Examples
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 1367 of file Schur.cpp.

1367  {
1368  return mult_schur_block_shell(mat, x, y, INSERT_VALUES);
1369 }

◆ mult_add()

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

Definition at line 1370 of file Schur.cpp.

1370  {
1371  return mult_schur_block_shell(mat, x, y, ADD_VALUES);
1372 }

◆ mult_schur_block_shell()

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

Definition at line 1539 of file Schur.cpp.

1540  {
1542  BlockStructure *ctx;
1543  CHKERR MatShellGetContext(mat, (void **)&ctx);
1544 
1545  PetscLogEventBegin(SchurEvents::MOFEM_EVENT_BlockStructureMult, 0, 0, 0, 0);
1546 
1547  int x_loc_size;
1548  CHKERR VecGetLocalSize(x, &x_loc_size);
1549  int y_loc_size;
1550  CHKERR VecGetLocalSize(y, &y_loc_size);
1551 
1552  Vec ghost_x = ctx->ghostX;
1553  Vec ghost_y = ctx->ghostY;
1554 
1555  CHKERR VecCopy(x, ghost_x);
1556 
1557  double *y_array;
1558  Vec loc_ghost_y;
1559  CHKERR VecGhostGetLocalForm(ghost_y, &loc_ghost_y);
1560  int nb_y;
1561  CHKERR VecGetLocalSize(loc_ghost_y, &nb_y);
1562  CHKERR VecGetArray(loc_ghost_y, &y_array);
1563  for (auto i = 0; i != nb_y; ++i)
1564  y_array[i] = 0.;
1565  CHKERR VecRestoreArray(loc_ghost_y, &y_array);
1566  CHKERR VecGhostRestoreLocalForm(ghost_y, &loc_ghost_y);
1567 
1568  auto mult = [&](int low_x, int hi_x, int low_y, int hi_y) {
1570 
1571  double *x_array;
1572  Vec loc_ghost_x;
1573  CHKERR VecGhostGetLocalForm(ghost_x, &loc_ghost_x);
1574  CHKERR VecGetArray(loc_ghost_x, &x_array);
1575 
1576  double *y_array;
1577  Vec loc_ghost_y;
1578  CHKERR VecGhostGetLocalForm(ghost_y, &loc_ghost_y);
1579  int nb_y;
1580  CHKERR VecGetLocalSize(loc_ghost_y, &nb_y);
1581  CHKERR VecGetArray(loc_ghost_y, &y_array);
1582 
1583  double *block_ptr = &*ctx->dataBlocksPtr->begin();
1584  auto it = ctx->blockIndex.get<0>().lower_bound(0);
1585  auto hi = ctx->blockIndex.get<0>().end();
1586 
1587  while (it != hi) {
1588  if (it->getLocRow() < low_y || it->getLocRow() >= hi_y ||
1589  it->getLocCol() < low_x || it->getLocCol() >= hi_x) {
1590  ++it;
1591  continue;
1592  }
1593 
1594  auto nb_rows = it->getNbRows();
1595  auto nb_cols = it->getNbCols();
1596  auto x_ptr = &x_array[it->getLocCol()];
1597  auto y_ptr = &y_array[it->getLocRow()];
1598  auto ptr = &block_ptr[it->getMatShift()];
1599 
1600  if (std::min(nb_rows, nb_cols) > max_gemv_size) {
1601  cblas_dgemv(CblasRowMajor, CblasNoTrans, nb_rows, nb_cols, 1.0, ptr,
1602  nb_cols, x_ptr, 1, 1.0, y_ptr, 1);
1603  } else {
1604  for (auto r = 0; r != nb_rows; ++r) {
1605  for (auto c = 0; c != nb_cols; ++c) {
1606  y_ptr[r] += ptr[r * nb_cols + c] * x_ptr[c];
1607  }
1608  }
1609  }
1610  ++it;
1611  }
1612 
1613  if (ctx->multiplyByPreconditioner) {
1614 
1615  if (!ctx->preconditionerBlocksPtr)
1616  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1617  "No parentBlockStructurePtr");
1618 
1619  auto preconditioner_ptr = &*ctx->preconditionerBlocksPtr->begin();
1620 
1621  auto it = ctx->blockIndex.get<0>().lower_bound(0);
1622  auto hi = ctx->blockIndex.get<0>().end();
1623 
1624  while (it != hi) {
1625  if (it->getLocRow() < low_y || it->getLocRow() >= hi_y ||
1626  it->getLocCol() < low_x || it->getLocCol() >= hi_x) {
1627  ++it;
1628  continue;
1629  }
1630 
1631  if (it->getInvShift() != -1) {
1632  auto nb_rows = it->getNbRows();
1633  auto nb_cols = it->getNbCols();
1634  auto x_ptr = &x_array[it->getLocCol()];
1635  auto y_ptr = &y_array[it->getLocRow()];
1636  auto ptr = &preconditioner_ptr[it->getInvShift()];
1637  if (std::min(nb_rows, nb_cols) > max_gemv_size) {
1638  cblas_dgemv(CblasRowMajor, CblasNoTrans, nb_rows, nb_cols, 1.0, ptr,
1639  nb_cols, x_ptr, 1, 1.0, y_ptr, 1);
1640  } else {
1641  for (auto r = 0; r != nb_rows; ++r) {
1642  for (auto c = 0; c != nb_cols; ++c) {
1643  y_ptr[r] += ptr[r * nb_cols + c] * x_ptr[c];
1644  }
1645  }
1646  }
1647  }
1648 
1649  ++it;
1650  }
1651  }
1652 
1653  CHKERR VecRestoreArray(loc_ghost_x, &x_array);
1654  CHKERR VecRestoreArray(loc_ghost_y, &y_array);
1655  CHKERR VecGhostRestoreLocalForm(ghost_x, &loc_ghost_x);
1656  CHKERR VecGhostRestoreLocalForm(ghost_y, &loc_ghost_y);
1658  };
1659 
1660  constexpr auto max_int = std::numeric_limits<int>::max();
1661  CHKERR VecGhostUpdateBegin(ghost_x, INSERT_VALUES, SCATTER_FORWARD);
1662  CHKERR mult(0, x_loc_size, 0, max_int);
1663  CHKERR VecGhostUpdateEnd(ghost_x, INSERT_VALUES, SCATTER_FORWARD);
1664  CHKERR mult(x_loc_size, max_int, 0, max_int);
1665 
1666  CHKERR VecGhostUpdateBegin(ghost_y, ADD_VALUES, SCATTER_REVERSE);
1667  CHKERR VecGhostUpdateEnd(ghost_y, ADD_VALUES, SCATTER_REVERSE);
1668 
1669  switch (iora) {
1670  case INSERT_VALUES:
1671  CHKERR VecCopy(ghost_y, y);
1672  break;
1673  case ADD_VALUES:
1674  CHKERR VecAXPY(y, 1., ghost_y);
1675  break;
1676  default:
1677  CHK_MOAB_THROW(MOFEM_NOT_IMPLEMENTED, "Wrong InsertMode");
1678  }
1679 
1680 #ifndef NDEBUG
1681 
1682  auto print_norm = [&](auto msg, auto y) {
1684  PetscReal norm;
1685  CHKERR VecNorm(y, NORM_2, &norm);
1686  int nb_loc_y;
1687  CHKERR VecGetLocalSize(y, &nb_loc_y);
1688  int nb_y;
1689  CHKERR VecGetSize(y, &nb_y);
1690  MOFEM_LOG("WORLD", Sev::noisy)
1691  << msg << " " << nb_y << " " << nb_loc_y << " norm " << norm;
1693  };
1694 
1695  switch (iora) {
1696  case INSERT_VALUES:
1697  print_norm("mult_schur_block_shell insert x", x);
1698  print_norm("mult_schur_block_shell insert y", y);
1699  break;
1700  case ADD_VALUES:
1701  print_norm("mult_schur_block_shell add x", x);
1702  print_norm("mult_schur_block_shell add y", y);
1703  break;
1704  default:
1705  CHK_MOAB_THROW(MOFEM_NOT_IMPLEMENTED, "Wrong InsertMode");
1706  }
1707 
1708 #endif // NDEBUG
1709 
1710  // PetscLogFlops(xxx)
1711  PetscLogEventEnd(SchurEvents::MOFEM_EVENT_BlockStructureMult, 0, 0, 0, 0);
1712 
1714 }

◆ 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 526 of file FieldMultiIndices.cpp.

526  {
527  os << e.getNameRef() << " field_id " << e.getId().to_ulong() << " space "
528  << e.getSpaceName() << " field continuity " << e.getContinuityName()
529  << " approximation base " << e.getApproxBaseName() << " nb coefficients "
530  << e.getNbOfCoeffs() << " meshset " << e.meshSet;
531  return os;
532 }

◆ 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 541 of file FieldMultiIndices.cpp.

542  {
543  os << "byWhat " << std::bitset<3>(e.byWhat) << " " << *e.entFieldPtr
544  << std::endl
545  << *e.entFePtr->getFiniteElementPtr();
546  return os;
547 }

◆ 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 907 of file MedInterface.cpp.

908  {
909  os << "field name: " << field_data.fieldName;
910  os << " mesh name: " << field_data.meshName;
911  os << " local mesh: " << ((field_data.localMesh) ? "true" : "false");
912  os << std::endl;
913  // os << " field type: ";
914  // switch (field_data.fieldType) {
915  // case MED_FLOAT64: os << "MED_FLOAT64"; break;
916  // case MED_INT32: os << "MED_INT32"; break;
917  // case MED_INT64: os << "MED_INT64"; break;
918  // case MED_INT: os << "MED_INT"; break;
919  // };
920  os << " componentNames:";
921  for (unsigned int ff = 0; ff != field_data.componentNames.size(); ff++) {
922  os << " " << field_data.componentNames[ff];
923  }
924  os << std::endl;
925  os << " componentUnits:";
926  for (unsigned int ff = 0; ff != field_data.componentUnits.size(); ff++) {
927  os << " " << field_data.componentUnits[ff];
928  }
929  os << std::endl;
930  os << " dtUnit: " << field_data.dtUnit << endl;
931  os << " number of steps: " << field_data.ncSteps;
932  return os;
933 }

◆ 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 1923 of file Templates.hpp.

1924  {
1926 
1927  auto first = f;
1928  while (first != s)
1929  if (tester(first)) {
1930 
1931  auto second = first;
1932  ++second;
1933 
1934  while (second != s) {
1935  if (tester(second))
1936  ++second;
1937  else
1938  break;
1939  }
1940 
1941  CHKERR inserter(first, second);
1942 
1943  first = second;
1944  if (first != s)
1945  ++first;
1946 
1947  } else {
1948  ++first;
1949  }
1950 
1952 }

◆ 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 1831 of file Templates.hpp.

1832  {
1834  for (auto it = mi.begin(); it != mi.end(); ++it) {
1835  if (!const_cast<MI &>(mi).modify(it, mo))
1836  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1837  "Houston we have a problem");
1838  }
1840 }

◆ 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 2838 of file Schur.cpp.

2840  {
2841  return MatSetValues<AssemblyTypeSelector<PETSC>>(M, row_data, col_data, mat,
2842  iora);
2843 }

◆ 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 2962 of file Schur.cpp.

2963  {
2965 
2966  moab::Core core;
2967  moab::Interface &moab = core;
2968 
2969  ReadUtilIface *iface;
2970  CHKERR moab.query_interface(iface);
2971 
2972  auto size = block_mat_data->blockIndex.size();
2973 
2974  EntityHandle starting_vertex;
2975  vector<double *> arrays_coord;
2976  CHKERR iface->get_node_coords(3, 4 * size, 0, starting_vertex, arrays_coord);
2977  EntityHandle starting_handle;
2978  EntityHandle *array;
2979  CHKERR iface->get_element_connect(size, 4, MBQUAD, 0, starting_handle, array);
2980 
2981  double def_val_nrm2 = 0;
2982  Tag th_nrm2;
2983  CHKERR moab.tag_get_handle("nrm2", 1, MB_TYPE_DOUBLE, th_nrm2,
2984  MB_TAG_CREAT | MB_TAG_DENSE, &def_val_nrm2);
2985 
2986  int def_val_mat_shift = 0;
2987  Tag th_mat_shift;
2988  CHKERR moab.tag_get_handle("mat_shift", 1, MB_TYPE_INTEGER, th_mat_shift,
2989  MB_TAG_CREAT | MB_TAG_DENSE, &def_val_mat_shift);
2990 
2991  int i = 0;
2992  for (auto &d : block_mat_data->blockIndex) {
2993  auto row = d.getRow();
2994  auto col = d.getCol();
2995  auto nb_rows = d.getNbRows();
2996  auto nb_cols = d.getNbCols();
2997  auto mat_shift = d.getMatShift();
2998 
2999  // q0
3000  arrays_coord[0][4 * i + 0] = row;
3001  arrays_coord[1][4 * i + 0] = col;
3002  arrays_coord[2][4 * i + 0] = 0;
3003 
3004  // q1
3005  arrays_coord[0][4 * i + 1] = row + nb_rows;
3006  arrays_coord[1][4 * i + 1] = col;
3007  arrays_coord[2][4 * i + 1] = 0;
3008 
3009  // q2
3010  arrays_coord[0][4 * i + 2] = row + nb_rows;
3011  arrays_coord[1][4 * i + 2] = col + nb_cols;
3012  arrays_coord[2][4 * i + 2] = 0;
3013 
3014  // q3
3015  arrays_coord[0][4 * i + 3] = row;
3016  arrays_coord[1][4 * i + 3] = col + nb_cols;
3017  arrays_coord[2][4 * i + 3] = 0;
3018 
3019  // ele conn
3020  array[4 * i + 0] = starting_vertex + 4 * i + 0;
3021  array[4 * i + 1] = starting_vertex + 4 * i + 1;
3022  array[4 * i + 2] = starting_vertex + 4 * i + 2;
3023  array[4 * i + 3] = starting_vertex + 4 * i + 3;
3024 
3025  auto prt = &(*block_mat_data->dataBlocksPtr)[d.getMatShift()];
3026  auto nrm2 = cblas_dnrm2(nb_rows * nb_cols, prt, 1);
3027  EntityHandle ele = starting_handle + i;
3028  CHKERR moab.tag_set_data(th_nrm2, &ele, 1, &nrm2);
3029  CHKERR moab.tag_set_data(th_mat_shift, &ele, 1, &mat_shift);
3030 
3031  ++i;
3032  }
3033 
3034  CHKERR iface->update_adjacencies(starting_handle, size, 4, array);
3035  CHKERR moab.write_file(filename.c_str(), "VTK", "");
3036 
3038 }

◆ 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 2947 of file Schur.cpp.

2947  {
2949  if (block_mat_data->multiplyByPreconditioner) {
2950  block_mat_data->multiplyByPreconditioner = false;
2951  } else {
2952  if (!block_mat_data->preconditionerBlocksPtr) {
2953  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
2954  "preconditionerBlocksPtr not set");
2955  }
2956  block_mat_data->multiplyByPreconditioner = true;
2957  }
2959 }

◆ 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
schur_test_diag_mat.cpp, and test_broken_space.cpp.

Definition at line 2805 of file Schur.cpp.

2805  {
2807 
2808  auto apply = [](PC pc, Vec f, Vec x) {
2810  Mat A, P;
2811  CHKERR PCGetOperators(pc, &A, &P);
2812  CHKERR MatSolve(P, f, x);
2814  };
2815 
2816  CHKERR PCSetType(pc, PCSHELL);
2817  CHKERR PCShellSetApply(pc, apply);
2818  CHKERR PCShellSetName(pc, "MoFEMSchurBlockPC");
2819 
2821 }

◆ setSchurBlockMatOps()

static MoFEMErrorCode MoFEM::setSchurBlockMatOps ( Mat  mat_raw)
static

Definition at line 1486 of file Schur.cpp.

1486  {
1488  CHKERR MatShellSetManageScalingShifts(mat_raw);
1489  CHKERR MatShellSetOperation(mat_raw, MATOP_MULT, (void (*)(void))mult);
1490  CHKERR MatShellSetOperation(mat_raw, MATOP_MULT_ADD,
1491  (void (*)(void))mult_add);
1492  CHKERR MatShellSetOperation(mat_raw, MATOP_SOLVE, (void (*)(void))solve);
1493  CHKERR MatShellSetOperation(mat_raw, MATOP_SOLVE_ADD,
1494  (void (*)(void))solve_add);
1495  CHKERR MatShellSetOperation(mat_raw, MATOP_ZERO_ENTRIES,
1496  (void (*)(void))mat_zero);
1497  CHKERR MatShellSetOperation(mat_raw, MATOP_ZERO_ROWS_COLUMNS,
1498  (void (*)(void))zero_rows_columns);
1499 
1501 };

◆ setSchurMatSolvePC()

DEPRECATED MoFEMErrorCode MoFEM::setSchurMatSolvePC ( SmartPetscObj< PC >  pc)
Examples
plastic.cpp.

Definition at line 2823 of file Schur.cpp.

2823  {
2824  return setSchurA00MatSolvePC(pc);
2825 }

◆ 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 2205 of file Schur.cpp.

2207  {
2209  PetscBool is_mat_shell = PETSC_FALSE;
2210  PetscObjectTypeCompare((PetscObject)M, MATSHELL, &is_mat_shell);
2211  if (is_mat_shell) {
2212  BlockStructure *ctx;
2213  CHKERR MatShellGetContext(M, (void **)&ctx);
2215  ctx, row_data, col_data, mat, iora,
2216  [](const DiagBlockIndex::Indexes *idx) { return idx->getMatShift(); },
2217  ctx->dataBlocksPtr);
2218  } else {
2219  CHKERR MatSetValues<AssemblyTypeSelector<PETSC>>(M, row_data, col_data, mat,
2220  iora);
2221  }
2223 }

◆ 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 1944 of file Schur.cpp.

1949  {
1950 
1952 
1953  if (row_data.getIndices().empty())
1955  if (col_data.getIndices().empty())
1957 
1958 #ifndef NDEBUG
1959 
1960  PetscLogEventBegin(SchurEvents::MOFEM_EVENT_BlockStructureSetValues, 0, 0, 0,
1961  0);
1962 
1963 #endif // NDEBUG
1964 
1965  auto get_row_data = [&]() -> std::pair<bool, VectorInt> {
1966  if (auto e_ptr = row_data.getFieldEntities()[0]) {
1967  if (auto stored_data_ptr =
1968  e_ptr->getSharedStoragePtr<EssentialBcStorage>()) {
1969  return std::make_pair(true, stored_data_ptr->entityIndices);
1970  }
1971  }
1972  return std::make_pair(false, row_data.getIndices());
1973  };
1974 
1975  auto row_indices = get_row_data();
1976  auto it_r = std::find(row_indices.second.begin(), row_indices.second.end(),
1977  -1) == row_indices.second.end();
1978  auto it_c =
1979  std::find(col_data.getIndices().begin(), col_data.getIndices().end(),
1980  -1) == col_data.getIndices().end();
1981 
1982  if (
1983 
1984  !row_indices.first
1985 
1986  && row_data.getFieldEntities()[0]->getNbDofsOnEnt() ==
1987  row_indices.second.size()
1988 
1989  && col_data.getFieldEntities()[0]->getNbDofsOnEnt() ==
1990  col_data.getIndices().size()
1991 
1992  && it_r && it_c
1993 
1994  ) {
1995 
1996  auto it = ctx->blockIndex.get<1>().find(
1997 
1998  boost::make_tuple(row_indices.second[0], col_data.getIndices()[0],
1999  row_indices.second.size(),
2000  col_data.getIndices().size())
2001 
2002  );
2003 
2004 #ifndef NDEBUG
2005 
2006  if (it == ctx->blockIndex.get<1>().end()) {
2007  MOFEM_LOG_CHANNEL("SELF");
2008  MOFEM_TAG_AND_LOG("SELF", Sev::error, "BlockMat")
2009  << "missing block: row " << row_data.getFieldDofs()[0]->getName()
2010  << " col " << col_data.getFieldDofs()[0]->getName();
2011  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Block not allocated");
2012  }
2013 
2014 #endif
2015 
2016  auto shift = shift_extractor(&*it);
2017  if (shift != -1) {
2018 
2019  auto nbr = row_indices.second.size();
2020  auto nbc = col_data.getIndices().size();
2021  auto mat_row_ptr = &mat(0, 0);
2022  auto s_mat = &(*data_blocks_ptr)[shift];
2023  if (iora == ADD_VALUES) {
2024  for (int r = 0; r != nbr; ++r) {
2025  for (int c = 0; c != nbc; ++c) {
2026  *s_mat += *mat_row_ptr;
2027  ++mat_row_ptr;
2028  ++s_mat;
2029  }
2030  }
2031  } else {
2032  for (int r = 0; r != nbr; ++r) {
2033  for (int c = 0; c != nbc; ++c) {
2034  *s_mat = *mat_row_ptr;
2035  ++mat_row_ptr;
2036  ++s_mat;
2037  }
2038  }
2039  }
2040  }
2041 
2042  } else {
2043 
2044  // This is to manage all complexities with negative indices, etc., nodes
2045  // etc. It is much slower than the above, but it is more general
2046 
2047  std::vector<int> row_ent_idx;
2048  std::vector<int> col_ent_idx;
2049 
2050  auto get_ent_idx = [&](auto lo, auto hi, auto &idx) {
2051  idx.clear();
2052  idx.reserve(std::distance(lo, hi));
2053  for (; lo != hi; ++lo) {
2054  idx.emplace_back((*lo)->getEntDofIdx());
2055  }
2056  };
2057 
2058  auto row = 0;
2059  for (auto &rent : row_data.getFieldEntities()) {
2060  if (auto r_cache = rent->entityCacheRowDofs.lock()) {
2061 
2062  auto rlo = r_cache->loHi[0];
2063  auto rhi = r_cache->loHi[1];
2064  if (rlo == rhi)
2065  continue;
2066 
2067  get_ent_idx(rlo, rhi, row_ent_idx);
2068  auto gr = (*rlo)->getPetscGlobalDofIdx();
2069  auto nbr = std::distance(rlo, rhi);
2070  auto col = 0;
2071 
2072  for (auto &cent : col_data.getFieldEntities()) {
2073  if (auto c_cache = cent->entityCacheColDofs.lock()) {
2074 
2075  auto clo = c_cache->loHi[0];
2076  auto chi = c_cache->loHi[1];
2077  if (clo == chi)
2078  continue;
2079 
2080  auto nbc = std::distance(clo, chi);
2081  auto it = ctx->blockIndex.get<1>().find(
2082 
2083  boost::make_tuple(gr, (*clo)->getPetscGlobalDofIdx(), nbr, nbc)
2084 
2085  );
2086 
2087 #ifndef NDEBUG
2088 
2089  if (it == ctx->blockIndex.get<1>().end()) {
2090  MOFEM_LOG_CHANNEL("SELF");
2091  MOFEM_TAG_AND_LOG("SELF", Sev::error, "BlockMat")
2092  << "missing block: " << row_data.getFieldDofs()[0]->getName()
2093  << " : " << col_data.getFieldDofs()[0]->getName();
2094  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
2095  "Block not allocated");
2096  }
2097 
2098 #endif
2099 
2100  auto shift = shift_extractor(&*it);
2101  if (shift != -1) {
2102 
2103  auto mat_row_ptr0 = &mat(row, col);
2104  auto s_mat = &(*data_blocks_ptr)[shift];
2105 
2106  if (
2107 
2108  nbr == rent->getNbDofsOnEnt() && nbc == cent->getNbDofsOnEnt()
2109 
2110  && it_r && it_c
2111 
2112  ) {
2113 
2114  if (iora == ADD_VALUES) {
2115  for (int r = 0; r != nbr; ++r) {
2116  auto mat_row_ptr = mat_row_ptr0 + r * mat.size2();
2117  for (int c = 0; c != nbc; ++c) {
2118  *s_mat += *mat_row_ptr;
2119  ++mat_row_ptr;
2120  ++s_mat;
2121  }
2122  }
2123  } else {
2124  for (int r = 0; r != nbr; ++r) {
2125  auto mat_row_ptr = mat_row_ptr0 + r * mat.size2();
2126  for (int c = 0; c != nbc; ++c) {
2127  *s_mat = *mat_row_ptr;
2128  ++mat_row_ptr;
2129  ++s_mat;
2130  }
2131  }
2132  }
2133 
2134  } else if (
2135 
2136  nbc == cent->getNbDofsOnEnt()
2137 
2138  && it_r && it_c
2139 
2140  ) {
2141 
2142  if (iora == ADD_VALUES) {
2143  for (auto r : row_ent_idx) {
2144  auto mat_row_ptr = mat_row_ptr0 + r * mat.size2();
2145  for (int c = 0; c != nbc; ++c) {
2146  *s_mat += *mat_row_ptr;
2147  ++mat_row_ptr;
2148  ++s_mat;
2149  }
2150  }
2151  } else {
2152  for (auto r : row_ent_idx) {
2153  auto mat_row_ptr = mat_row_ptr0 + r * mat.size2();
2154  for (int c = 0; c != nbc; ++c) {
2155  *s_mat = *mat_row_ptr;
2156  ++mat_row_ptr;
2157  ++s_mat;
2158  }
2159  }
2160  }
2161 
2162  } else {
2163 
2164  get_ent_idx(clo, chi, col_ent_idx);
2165  auto row_idx = &row_indices.second[row];
2166  auto col_idx = &col_data.getIndices()[col];
2167  if (iora == ADD_VALUES) {
2168  for (auto r : row_ent_idx) {
2169  auto mat_row_ptr = mat_row_ptr0 + r * mat.size2();
2170  for (auto c : col_ent_idx) {
2171  if (row_idx[r] != -1 && col_idx[c] != -1)
2172  *s_mat += mat_row_ptr[c];
2173  ++s_mat;
2174  }
2175  }
2176  } else {
2177  for (auto r : row_ent_idx) {
2178  auto mat_row_ptr = mat_row_ptr0 + r * mat.size2();
2179  for (auto c : col_ent_idx) {
2180  if (row_idx[r] != -1 && col_idx[c] != -1)
2181  *s_mat = mat_row_ptr[c];
2182  ++s_mat;
2183  }
2184  }
2185  }
2186  }
2187  }
2188  }
2189  col += cent->getNbDofsOnEnt();
2190  }
2191  }
2192  row += rent->getNbDofsOnEnt();
2193  }
2194  }
2195 
2196 #ifndef NDEBUG
2197  PetscLogEventEnd(SchurEvents::MOFEM_EVENT_BlockStructureSetValues, 0, 0, 0,
2198  0);
2199 #endif // NDEBUG
2200 
2202 }

◆ 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 2225 of file Schur.cpp.

2228  {
2230  PetscBool is_mat_shell = PETSC_FALSE;
2231  PetscObjectTypeCompare((PetscObject)M, MATSHELL, &is_mat_shell);
2232  if (is_mat_shell) {
2233  BlockStructure *ctx;
2234  CHKERR MatShellGetContext(M, (void **)&ctx);
2235  if (!ctx->preconditionerBlocksPtr)
2236  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
2237  "No preconditionerBlocksPtr");
2239  ctx, row_data, col_data, mat, iora,
2240  [](const DiagBlockIndex::Indexes *idx) { return idx->getInvShift(); },
2241  ctx->preconditionerBlocksPtr);
2242  } else {
2243  CHKERR MatSetValues<AssemblyTypeSelector<PETSC>>(M, row_data, col_data, mat,
2244  iora);
2245  }
2247 }

◆ 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 1373 of file Schur.cpp.

1373  {
1374  return solve_schur_block_shell(mat, x, y, INSERT_VALUES);
1375 }

◆ solve_add()

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

Definition at line 1376 of file Schur.cpp.

1376  {
1377  return solve_schur_block_shell(mat, x, y, ADD_VALUES);
1378 }

◆ solve_schur_block_shell()

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

Definition at line 1716 of file Schur.cpp.

1717  {
1719  BlockStructure *ctx;
1720  CHKERR MatShellGetContext(mat, (void **)&ctx);
1721 
1722  PetscLogEventBegin(SchurEvents::MOFEM_EVENT_BlockStructureSolve, 0, 0, 0, 0);
1723 
1724  // Note that for solver those two are swapped
1725  Vec ghost_x = ctx->ghostY;
1726  Vec ghost_y = ctx->ghostX;
1727 
1728  CHKERR VecCopy(y, ghost_y);
1729  CHKERR VecZeroEntries(ghost_x);
1730 
1731  // CHKERR VecGhostUpdateBegin(ghost_y, INSERT_VALUES, SCATTER_FORWARD);
1732  // CHKERR VecGhostUpdateEnd(ghost_y, INSERT_VALUES, SCATTER_FORWARD);
1733 
1734  double *x_array;
1735  Vec loc_ghost_x;
1736  CHKERR VecGhostGetLocalForm(ghost_x, &loc_ghost_x);
1737  CHKERR VecGetArray(loc_ghost_x, &x_array);
1738 
1739  Vec loc_ghost_y;
1740  CHKERR VecGhostGetLocalForm(ghost_y, &loc_ghost_y);
1741  auto inv_y = vectorDuplicate(loc_ghost_y);
1742  auto add_y = vectorDuplicate(loc_ghost_y);
1743  CHKERR VecZeroEntries(inv_y);
1744  CHKERR VecCopy(loc_ghost_y, add_y);
1745  double *y_inv_array;
1746  CHKERR VecGetArray(inv_y, &y_inv_array);
1747  double *y_add_array;
1748  CHKERR VecGetArray(add_y, &y_add_array);
1749  double *y_array;
1750  CHKERR VecGetArray(loc_ghost_y, &y_array);
1751 
1752  auto data_inv_blocks = ctx->dataInvBlocksPtr;
1753  auto inv_block_ptr = &*data_inv_blocks->begin();
1754  auto data_blocks = ctx->dataBlocksPtr;
1755 
1756  auto *data_inv = dynamic_cast<DiagBlockInvStruture *>(ctx);
1757  auto index_view = &data_inv->indexView;
1758 
1759  std::vector<double> f;
1760 
1761  // That make a pass over block, applying lower diagonal
1762  for (auto s1 = 0; s1 != index_view->diagUpRange.size() - 1; ++s1) {
1763  auto lo = index_view->diagUpRange[s1];
1764  auto hi = index_view->diagUpRange[s1 + 1];
1765 
1766  // first index is off diag
1767  auto diag_index_ptr =
1768  index_view->upView[lo]; // First index is inverted diagonal
1769  ++lo;
1770 
1771  auto row = diag_index_ptr->getLocRow();
1772  auto col = diag_index_ptr->getLocCol();
1773  auto nb_rows = diag_index_ptr->getNbRows();
1774  auto nb_cols = diag_index_ptr->getNbCols();
1775  auto inv_shift = diag_index_ptr->getInvShift();
1776 
1777  for (; lo != hi; ++lo) {
1778  auto off_index_ptr = index_view->upView[lo];
1779  auto off_col = off_index_ptr->getLocCol();
1780  auto off_nb_cols = off_index_ptr->getNbCols();
1781  auto off_shift = off_index_ptr->getInvShift();
1782 #ifndef NDEBUG
1783  if (off_shift == -1)
1784  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "off_shift == -1");
1785 #endif // NDEBUG
1786  auto ptr = &inv_block_ptr[off_shift];
1787  if (std::min(nb_rows, off_nb_cols) > max_gemv_size) {
1788  cblas_dgemv(CblasRowMajor, CblasNoTrans, nb_rows, off_nb_cols, -1.0,
1789  ptr, off_nb_cols, &y_inv_array[off_col], 1, 1.0,
1790  &y_add_array[row], 1);
1791  } else {
1792  for (auto r = 0; r != nb_rows; ++r) {
1793  for (auto c = 0; c != off_nb_cols; ++c) {
1794  y_add_array[row + r] -=
1795  ptr[r * off_nb_cols + c] * y_inv_array[off_col + c];
1796  }
1797  }
1798  }
1799  }
1800 
1801 #ifndef NDEBUG
1802  if (inv_shift == -1)
1803  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "inv_shift == -1");
1804  if (inv_shift + nb_rows * nb_cols > data_inv_blocks->size())
1805  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1806  "inv_shift out of range %d > %d", inv_shift + nb_rows * nb_cols,
1807  data_inv_blocks->size());
1808 #endif // NDEBUG
1809 
1810  auto ptr = &inv_block_ptr[inv_shift];
1811  if (std::min(nb_rows, nb_cols) > max_gemv_size) {
1812  cblas_dgemv(CblasRowMajor, CblasNoTrans, nb_rows, nb_cols, -1.0, ptr,
1813  nb_cols, &y_add_array[col], 1, 1.0, &y_inv_array[row], 1);
1814  } else {
1815  for (auto r = 0; r != nb_rows; ++r) {
1816  for (auto c = 0; c != nb_cols; ++c) {
1817  y_inv_array[row + r] -= ptr[r * nb_cols + c] * y_add_array[col + c];
1818  }
1819  }
1820  }
1821  }
1822 
1823  // That make a pass over block, applying lower diagonal
1824  for (auto s1 = 0; s1 != index_view->diagLoRange.size() - 1; ++s1) {
1825  auto lo = index_view->diagLoRange[s1];
1826  auto hi = index_view->diagLoRange[s1 + 1];
1827 
1828  // first index is off diag
1829  auto diag_index_ptr =
1830  index_view->lowView[lo]; // First index is inverted diagonal
1831  ++lo;
1832 
1833  auto row = diag_index_ptr->getLocRow();
1834  auto col = diag_index_ptr->getLocCol();
1835  auto nb_rows = diag_index_ptr->getNbRows();
1836  auto nb_cols = diag_index_ptr->getNbCols();
1837  auto inv_shift = diag_index_ptr->getInvShift();
1838 
1839  f.resize(nb_cols);
1840  std::copy(&y_add_array[col], &y_add_array[col + nb_cols], f.begin());
1841 
1842  for (; lo != hi; ++lo) {
1843  auto off_index_ptr = index_view->lowView[lo];
1844  auto off_col = off_index_ptr->getLocCol();
1845  auto off_nb_cols = off_index_ptr->getNbCols();
1846  auto off_shift = off_index_ptr->getInvShift();
1847 #ifndef NDEBUG
1848  if (off_shift == -1)
1849  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "off_shift == -1");
1850 #endif // NDEBUG
1851  auto x_ptr = &x_array[off_col];
1852  auto ptr = &inv_block_ptr[off_shift];
1853  if (std::min(nb_rows, nb_cols) > max_gemv_size) {
1854  cblas_dgemv(CblasRowMajor, CblasNoTrans, nb_rows, off_nb_cols, -1.0,
1855  ptr, off_nb_cols, x_ptr, 1, 1.0, &f[0], 1);
1856  } else {
1857  for (auto r = 0; r != nb_rows; ++r) {
1858  for (auto c = 0; c != off_nb_cols; ++c) {
1859  f[r] -= ptr[r * off_nb_cols + c] * x_ptr[c];
1860  }
1861  }
1862  }
1863  }
1864 
1865 #ifndef NDEBUG
1866  if (inv_shift == -1)
1867  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "inv_shift == -1");
1868  if (inv_shift + nb_rows * nb_cols > data_inv_blocks->size())
1869  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1870  "inv_shift out of range %d > %d", inv_shift + nb_rows * nb_cols,
1871  data_inv_blocks->size());
1872 #endif // NDEBUG
1873 
1874  auto ptr = &inv_block_ptr[inv_shift];
1875  if (std::min(nb_rows, nb_cols) > max_gemv_size) {
1876  cblas_dgemv(CblasRowMajor, CblasNoTrans, nb_rows, nb_cols, -1.0, ptr,
1877  nb_cols, &f[0], 1, 1.0, &x_array[row], 1);
1878  } else {
1879  for (auto r = 0; r != nb_rows; ++r) {
1880  for (auto c = 0; c != nb_cols; ++c) {
1881  x_array[row + r] -= ptr[r * nb_cols + c] * f[c];
1882  }
1883  }
1884  }
1885  }
1886 
1887  CHKERR VecRestoreArray(loc_ghost_x, &x_array);
1888  CHKERR VecRestoreArray(inv_y, &y_inv_array);
1889  CHKERR VecRestoreArray(add_y, &y_add_array);
1890  CHKERR VecRestoreArray(loc_ghost_y, &y_array);
1891  CHKERR VecGhostRestoreLocalForm(ghost_x, &loc_ghost_x);
1892  CHKERR VecGhostRestoreLocalForm(ghost_y, &loc_ghost_y);
1893 
1894  // CHKERR VecGhostUpdateBegin(ghost_y, ADD_VALUES, SCATTER_REVERSE);
1895  // CHKERR VecGhostUpdateEnd(ghost_y, ADD_VALUES, SCATTER_REVERSE);
1896 
1897  switch (iora) {
1898  case INSERT_VALUES:
1899  CHKERR VecCopy(ghost_x, x);
1900  break;
1901  case ADD_VALUES:
1902  CHKERR VecAXPY(x, 1., ghost_x);
1903  break;
1904  default:
1905  CHK_MOAB_THROW(MOFEM_NOT_IMPLEMENTED, "Wrong InsertMode");
1906  }
1907 
1908 #ifndef NDEBUG
1909 
1910  auto print_norm = [&](auto msg, auto y) {
1912  PetscReal norm;
1913  CHKERR VecNorm(y, NORM_2, &norm);
1914  int nb_loc_y;
1915  CHKERR VecGetLocalSize(y, &nb_loc_y);
1916  int nb_y;
1917  CHKERR VecGetSize(y, &nb_y);
1918  MOFEM_LOG("WORLD", Sev::noisy)
1919  << msg << " " << nb_y << " " << nb_loc_y << " norm " << norm;
1921  };
1922 
1923  switch (iora) {
1924  case INSERT_VALUES:
1925  print_norm("solve_schur_block_shell insert x", x);
1926  print_norm("solve_schur_block_shell insert y", y);
1927  break;
1928  case ADD_VALUES:
1929  print_norm("solve_schur_block_shell add x", x);
1930  print_norm("solve_schur_block_shell add y", y);
1931  break;
1932  default:
1933  CHK_MOAB_THROW(MOFEM_NOT_IMPLEMENTED, "Wrong InsertMode");
1934  }
1935 
1936 #endif // NDEBUG
1937 
1938  // PetscLogFlops(xxx)
1939  PetscLogEventEnd(SchurEvents::MOFEM_EVENT_BlockStructureSolve, 0, 0, 0, 0);
1940 
1942 }

◆ 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 1413 of file Templates.hpp.

1414  {
1416  // copy matrix since on output lapack returns factorisation
1417  auto mat_copy = mat;
1418  CHKERR solveLinearSystem(mat_copy, f);
1420 }

◆ 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 1379 of file Templates.hpp.

1379  {
1381 
1382  const size_t M = mat.size1();
1383  const size_t N = mat.size2();
1384 
1385  if (M == 0 || M != N)
1386  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1387  "The input matrix for inverse computation is not square %d != %d",
1388  M, N);
1389  if (f.size() != M)
1390  f.resize(M, false);
1391 
1392  const int nrhs = 1;
1393  int info;
1394  int *ipiv = new int[M];
1395  info = lapack_dgesv(M, nrhs, &*mat.data().begin(), M, ipiv,
1396  &*f.data().begin(), nrhs);
1397 
1398  if (info != 0) {
1399  SETERRQ1(PETSC_COMM_SELF, 1, "error lapack solve dgesv info = %d", info);
1400  }
1401 
1402  delete[] ipiv;
1404 }

◆ 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, and plastic.cpp.

Definition at line 1876 of file Templates.hpp.

1876  {
1877  return static_cast<EntityType>(h >> MB_ID_WIDTH);
1878 };

◆ type_name_from_handle()

auto MoFEM::type_name_from_handle ( const EntityHandle  h)
inline

get entity type name from handle

Definition at line 1900 of file Templates.hpp.

1900  {
1901  return moab::CN::EntityTypeName(type_from_handle(h));
1902 };

◆ 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 1579 of file EntitiesFieldData.hpp.

1581  {
1582  static_assert(!std::is_same<T, T>::value,
1583  "VecSetValues value for this data storage is not implemented");
1584  return MOFEM_NOT_IMPLEMENTED;
1585 }

◆ 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 1611 of file EntitiesFieldData.hpp.

1613  {
1614  return VecSetValues<T>(V, data, &*vec.data().begin(), iora);
1615 }

◆ 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 273 of file Schur.hpp.

275  {
276  return VecSetValues<EssentialBcStorage>(V, data, nf, iora);
277 }

◆ 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 348 of file Schur.hpp.

350  {
351  return ::VecSetValues(V, data.getIndices().size(),
352  &*data.getIndices().begin(), &*nf.begin(), iora);
353 }

◆ 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 314 of file Schur.hpp.

316  {
317  return VecSetValues<EssentialBcStorage>(V, data, nf, iora);
318 }

◆ 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 243 of file Schur.hpp.

245  {
246  return VecSetValues<SchurElemMats>(V, data, nf, iora);
247 }

◆ VecSetValues< EntityStorage >()

template<>
MoFEMErrorCode MoFEM::VecSetValues< EntityStorage > ( Vec  V,
const EntitiesFieldData::EntData data,
const double ptr,
InsertMode  iora 
)
inline

Definition at line 1589 of file EntitiesFieldData.hpp.

1590  {
1591  return VecSetValues(V, data.getIndices().size(), &*data.getIndices().begin(),
1592  ptr, iora);
1593 }

◆ VecSetValues< SchurElemMats >()

template<>
MoFEMErrorCode MoFEM::VecSetValues< SchurElemMats > ( Vec  V,
const EntitiesFieldData::EntData data,
const VectorDouble nf,
InsertMode  iora 
)
inline

Definition at line 231 of file Schur.hpp.

232  {
233  return VecSetValues<EssentialBcStorage>(V, data, nf, iora);
234 }

◆ VecSetValues< SchurElemMatsBlock >()

template<>
MoFEMErrorCode MoFEM::VecSetValues< SchurElemMatsBlock > ( Vec  V,
const EntitiesFieldData::EntData data,
const VectorDouble nf,
InsertMode  iora 
)
inline

Definition at line 294 of file Schur.hpp.

295  {
296  return VecSetValues<EssentialBcStorage>(V, data, nf, iora);
297 }

◆ 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 1380 of file Schur.cpp.

1382  {
1383 
1385  BlockStructure *ctx;
1386  CHKERR MatShellGetContext(A, (void **)&ctx);
1387 
1388  PetscLogEventBegin(SchurEvents::MOFEM_EVENT_zeroRowsAndCols, 0, 0, 0, 0);
1389 
1390  const int *ptr = &rows[0];
1391  int is_nb_rows = N;
1392  SmartPetscObj<IS> is_local;
1393 
1394  MPI_Comm comm;
1395  CHKERR PetscObjectGetComm((PetscObject)A, &comm);
1396  int size;
1397  MPI_Comm_size(comm, &size);
1398  if (size > 1) {
1399  auto is = createISGeneral(comm, N, rows, PETSC_USE_POINTER);
1400  is_local = isAllGather(is);
1401  }
1402  if (is_local) {
1403  CHKERR ISGetSize(is_local, &is_nb_rows);
1404 #ifndef NDEBUG
1405  if constexpr (debug_schur) {
1406  CHKERR ISView(is_local, PETSC_VIEWER_STDOUT_WORLD);
1407  }
1408 #endif
1409  CHKERR ISGetIndices(is_local, &ptr);
1410  }
1411 
1412  int loc_m, loc_n;
1413  CHKERR MatGetLocalSize(A, &loc_m, &loc_n);
1414 
1415  for (auto n = 0; n != is_nb_rows; ++n) {
1416  auto row = ptr[n];
1417  auto rlo = ctx->blockIndex.get<2>().lower_bound(row);
1418  auto rhi = ctx->blockIndex.get<2>().end();
1419  for (; rlo != rhi; ++rlo) {
1420  auto r_shift = row - rlo->getRow();
1421  if (r_shift >= 0 && r_shift < rlo->getNbRows()) {
1422  auto *ptr = &(*ctx->dataBlocksPtr)[rlo->getMatShift()];
1423  for (auto i = 0; i != rlo->getNbCols(); ++i) {
1424  ptr[i + r_shift * rlo->getNbCols()] = 0;
1425  }
1426  } else if (rlo->getRow() + rlo->getNbRows() > row) {
1427  break;
1428  }
1429  }
1430  }
1431 
1432  for (auto n = 0; n != is_nb_rows; ++n) {
1433  auto col = ptr[n];
1434  auto clo = ctx->blockIndex.get<3>().lower_bound(col);
1435  auto chi = ctx->blockIndex.get<3>().end();
1436  for (; clo != chi; ++clo) {
1437  auto c_shift = col - clo->getCol();
1438  if (c_shift >= 0 && c_shift < clo->getNbCols()) {
1439 
1440  auto *ptr = &(*ctx->dataBlocksPtr)[clo->getMatShift()];
1441  for (auto i = 0; i != clo->getNbRows(); ++i) {
1442  ptr[c_shift + i * clo->getNbCols()] = 0;
1443  }
1444 
1445  // diagonal
1446  if (
1447 
1448  clo->getRow() == clo->getCol() && clo->getLocRow() < loc_m &&
1449  clo->getLocCol() < loc_n
1450 
1451  ) {
1452  auto r_shift = col - clo->getCol();
1453  if (r_shift >= 0 && r_shift < clo->getNbRows()) {
1454  ptr[c_shift + r_shift * clo->getNbCols()] = diag;
1455  }
1456  }
1457  } else if (clo->getCol() + clo->getNbCols() > col) {
1458  break;
1459  }
1460  }
1461  }
1462 
1463  if (is_local) {
1464  CHKERR ISRestoreIndices(is_local, &ptr);
1465  }
1466 
1467  PetscLogEventEnd(SchurEvents::MOFEM_EVENT_zeroRowsAndCols, 0, 0, 0, 0);
1468 
1470 }

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 1779 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 1537 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::solve_schur_block_shell
static MoFEMErrorCode solve_schur_block_shell(Mat mat, Vec x, Vec y, InsertMode iora)
Definition: Schur.cpp:1716
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:1380
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:1634
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
PCMGSubMatrixCtx::X
Vec X
Definition: PCMGSetUpViaApproxOrders.hpp:11
MOFEM_STD_EXCEPTION_THROW
@ MOFEM_STD_EXCEPTION_THROW
Definition: definitions.h:39
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
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
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:1611
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:2875
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
DMCoarsen_MGViaApproxOrders
MoFEMErrorCode DMCoarsen_MGViaApproxOrders(DM dm, MPI_Comm comm, DM *dmc)
Coarsen DM.
Definition: PCMGSetUpViaApproxOrders.cpp:461
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
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:37
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:1944
phi
static double phi
Definition: poisson_2d_dis_galerkin.cpp:29
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:1376
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
DMMGViaApproxOrdersCtx
Structure for DM for multi-grid via approximation orders.
Definition: PCMGSetUpViaApproxOrders.hpp:22
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
HVEC0_0
@ HVEC0_0
Definition: definitions.h:205
HVEC1_1
@ HVEC1_1
Definition: definitions.h:209
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:1579
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
GET_DM_FIELD
#define GET_DM_FIELD(DM)
Definition: PCMGSetUpViaApproxOrders.cpp:214
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:1566
MoFEM::DiagBlockIndex::Indexes
block data indexes
Definition: Schur.cpp:240
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:2002
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:1370
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:1472
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::mult_schur_block_shell
static MoFEMErrorCode mult_schur_block_shell(Mat mat, Vec x, Vec y, InsertMode iora)
Definition: Schur.cpp:1539
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:946
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:1795
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
PCMGSubMatrixCtx::F
Vec F
Definition: PCMGSetUpViaApproxOrders.hpp:11
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:193
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:1537
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
PCMGSubMatrixCtx
Definition: PCMGSetUpViaApproxOrders.hpp:9
MoFEM::solve
static PetscErrorCode solve(Mat mat, Vec x, Vec y)
Definition: Schur.cpp:1373
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:1876
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:1367
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:2738
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:2938
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:160
MoFEM::matDuplicate
SmartPetscObj< Mat > matDuplicate(Mat mat, MatDuplicateOption op)
Definition: PetscSmartObj.hpp:234
DMCreateMatrix_MGViaApproxOrders
MoFEMErrorCode DMCreateMatrix_MGViaApproxOrders(DM dm, Mat *M)
Create matrix for Multi-Grid via approximation orders.
Definition: PCMGSetUpViaApproxOrders.cpp:429
t
constexpr double t
plate stiffness
Definition: plate.cpp:59
ksp_set_operators
static MoFEMErrorCode ksp_set_operators(KSP ksp, Mat A, Mat B, void *ctx)
Definition: PCMGSetUpViaApproxOrders.cpp:403
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::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:1585
MoFEM::TsCtx::postProcessRHSFunction
BasicMethodsSequence postProcessRHSFunction
Definition: TsCtx.hpp:43
PCMGSubMatrixCtx::A
Mat A
Definition: PCMGSetUpViaApproxOrders.hpp:10
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:2805
LASTSET_BC
@ LASTSET_BC
Definition: definitions.h:179
MoFEM::determinantTensor2by2
MoFEMErrorCode determinantTensor2by2(T1 &t, T2 &det)
Calculate determinant 2 by 2.
Definition: Templates.hpp:1596
N
const int N
Definition: speed_test.cpp:3
MoFEM::determinantTensor3by3
static auto determinantTensor3by3(T &t)
Calculate the determinant of a 3x3 matrix or a tensor of rank 2.
Definition: Templates.hpp:1518
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:1498
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
Range
MoFEM::Exceptions::MoFEMException::errorCode
const int errorCode
Definition: Exceptions.hpp:21
SnesCtx
MoFEM::setSchurBlockMatOps
static MoFEMErrorCode setSchurBlockMatOps(Mat mat_raw)
Definition: Schur.cpp:1486
adouble
PCMGSubMatrixCtx::sCat
VecScatter sCat
Definition: PCMGSetUpViaApproxOrders.hpp:13
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:1660
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:2205
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:2831
MoFEM::Core
CoreTmp< 0 > Core
Definition: Core.hpp:1140
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:935
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
DMCreateGlobalVector_MGViaApproxOrders
MoFEMErrorCode DMCreateGlobalVector_MGViaApproxOrders(DM dm, Vec *g)
Create global vector for DMGViaApproxOrders.
Definition: PCMGSetUpViaApproxOrders.cpp:575
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::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:231
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
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:2907
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::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::getNestSchurData
boost::shared_ptr< NestSchurData > getNestSchurData(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:2249
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:476
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:1413