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  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  CreateRowComressedADJMatrix
 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  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  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< 2, S, T >
 
struct  GetFTensor1FromPtrImpl< 3, 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  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  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  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  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  OpSchurAssembleBegin
 Clear Schur complement internal data. More...
 
struct  OpSchurAssembleEnd
 Assemble Schur complement. More...
 
struct  OpSchurAssembleEnd< SCHUR_DGESV >
 
struct  OpSchurAssembleEnd< SCHUR_DSYSV >
 
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  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  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  SCHUR_DGESV
 
struct  SCHUR_DSYSV
 
struct  SchurL2Mats
 Schur complement data storage. 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 comminitactor such that is destroyed when is out of scope. More...
 

Typedefs

template<typename T >
using ShardVec = boost::shared_ptr< std::vector< T > >
 
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 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 >
 
template<CubitBC BC>
using BcTemperature = BcScalarMeshsetType< BC >
 
using Core = CoreTmp< 0 >
 
using Sev = MoFEM::LogManager::SeverityLevel
 
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, 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 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...
 
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)
 
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< SchurL2Mats > (Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora)
 
template<>
MoFEMErrorCode VecSetValues< SchurL2Mats > (Vec V, const EntitiesFieldData::EntData &data, const VectorDouble &nf, 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 VecSetValues< AssemblyTypeSelector< 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<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...
 
auto getProblemPtr (DM dm)
 get problem pointer from DM More...
 
auto createDMMatrix (DM dm)
 Get smart matrix from DM. More...
 
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...
 
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
 
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 1117 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 562 of file ProblemsMultiIndices.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 158 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, 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_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 1094 of file Core.hpp.

◆ 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 563 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 152 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 475 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.

◆ 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, 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_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 1975 of file Interface.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 3105 of file UserDataOperators.hpp.

◆ OpSetContravariantPiolaTransformOnFace2D

◆ OpSetContravariantPiolaTransformOnFace2DEmbeddedIn3DSpace

Definition at line 3082 of file UserDataOperators.hpp.

◆ OpSetCovariantPiolaTransformOnFace2D

Definition at line 3032 of file UserDataOperators.hpp.

◆ OpSetInvJacHcurlFace

◆ OpSetInvJacHcurlFaceEmbeddedIn3DSpace

Definition at line 2983 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.

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

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

1493  {
1495  for (int ii = 0; ii != DIM; ii++)
1496  for (int jj = 0; jj != DIM; jj++)
1497  eigen_vec(ii, jj) = mat(ii, jj);
1498 
1499  CHKERR computeEigenValuesSymmetric(eigen_vec, eig);
1500 
1502 }

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

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

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

1465  {
1467 
1468  const int n = DIM;
1469  const int lda = DIM;
1470  const int lwork = (DIM + 2) * DIM;
1471  std::array<double, (DIM + 2) * DIM> work;
1472 
1473  if (lapack_dsyev('V', 'U', n, &eigen_vec(0, 0), lda, &eig(0), work.data(),
1474  lwork) > 0)
1475  SETERRQ(PETSC_COMM_SELF, MOFEM_INVALID_DATA,
1476  "The algorithm failed to compute eigenvalues.");
1478 }

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

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

◆ 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 322 of file PetscSmartObj.hpp.

323  {
324  AO ao;
325  CHK_THROW_MESSAGE(AOCreateMapping(comm, napp, myapp, mypetsc, &ao),
326  "create ao");
327  return SmartPetscObj<AO>(ao);
328 }

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

Definition at line 302 of file PetscSmartObj.hpp.

302  {
303  AO ao;
304  CHK_THROW_MESSAGE(AOCreateMappingIS(isapp, ispetsc, &ao),
305  "Failed to create AO");
306  return SmartPetscObj<AO>(ao);
307 };

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

Definition at line 137 of file PetscSmartObj.hpp.

137  {
138  DM dm;
139  CHK_THROW_MESSAGE(DMCreate(comm, &dm), "Failed to create DM");
140  CHK_THROW_MESSAGE(DMSetType(dm, dm_type_name.c_str()), "Failed set DM type");
141  return SmartPetscObj<DM>(dm);
142 };

◆ 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 175 of file PetscSmartObj.hpp.

176  {
177  Vec vv;
178  CHK_THROW_MESSAGE(VecCreateGhost(comm, n, N, nghost, ghosts, &vv),
179  "Failed to create ghosted Vec");
180  return SmartPetscObj<Vec>(vv);
181 };

◆ 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 283 of file PetscSmartObj.hpp.

284  {
285  IS is;
286  CHK_THROW_MESSAGE(ISCreateGeneral(comm, n, idx, mode, &is), "Create IS");
287  return SmartPetscObj<IS>(is);
288 }

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

Definition at line 257 of file PetscSmartObj.hpp.

257  {
258  KSP ksp;
259  CHK_THROW_MESSAGE(KSPCreate(comm, &ksp), "Failed to create KSP");
260  return SmartPetscObj<KSP>(ksp);
261 };

◆ createPC()

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

Definition at line 263 of file PetscSmartObj.hpp.

263  {
264  PC pc;
265  CHK_THROW_MESSAGE(PCCreate(comm, &pc), "Failed to create PC");
266  return SmartPetscObj<PC>(pc);
267 };

◆ 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 145 of file PetscSmartObj.hpp.

146  {
147  return createDM(comm, dm_type_name);
148 }

◆ createSmartGhostVector()

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

Definition at line 184 of file PetscSmartObj.hpp.

186  {
187  return createGhostVector(comm, n, N, nghost, ghosts);
188 }

◆ createSmartVectorMPI()

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

Definition at line 205 of file PetscSmartObj.hpp.

206  {
207  return createVectorMPI(comm, n, N);
208 }

◆ 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 251 of file PetscSmartObj.hpp.

251  {
252  SNES snes;
253  CHK_THROW_MESSAGE(SNESCreate(comm, &snes), "Failed to create SNES");
254  return SmartPetscObj<SNES>(snes);
255 };

◆ createTS()

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

Definition at line 245 of file PetscSmartObj.hpp.

245  {
246  TS ts;
247  CHK_THROW_MESSAGE(TSCreate(comm, &ts), "Failed to create TS");
248  return SmartPetscObj<TS>(ts);
249 };

◆ 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 345 of file PetscSmartObj.hpp.

345  {
346  VecScatter s;
347  CHK_THROW_MESSAGE(VecScatterCreate(x, ix, y, iy, &s), "create scatter");
348  return SmartPetscObj<VecScatter>(s);
349 }

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

Definition at line 198 of file PetscSmartObj.hpp.

198  {
199  Vec vv;
200  CHK_THROW_MESSAGE(VecCreateMPI(comm, n, N, &vv), "Failed to create Vec");
201  return SmartPetscObj<Vec>(vv);
202 };

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

1542  {
1543  return DeterminantTensorImpl<FTensor::Tensor2<T, DIM, DIM>, DIM>::get(t);
1544 }

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

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

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

1524  {
1525  return t(0, 0) * t(1, 1) - t(0, 1) * t(1, 0);
1526 }

◆ determinantTensor2by2() [2/2]

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

Calculate determinant 2 by 2.

Definition at line 1589 of file Templates.hpp.

1589  {
1591  det = determinantTensor2by2(t);
1593 }

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

1511  {
1512  return t(0, 0) * t(1, 1) * t(2, 2) + t(1, 0) * t(2, 1) * t(0, 2) +
1513  t(2, 0) * t(0, 1) * t(1, 2) - t(0, 0) * t(2, 1) * t(1, 2) -
1514  t(2, 0) * t(1, 1) * t(0, 2) - t(1, 0) * t(0, 1) * t(2, 2);
1515 }

◆ determinantTensor3by3() [2/2]

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

Calculate determinant 3 by 3.

Definition at line 1578 of file Templates.hpp.

1578  {
1580  det = determinantTensor3by3(t);
1582 }

◆ dimension_from_handle()

auto MoFEM::dimension_from_handle ( const EntityHandle  h)
inline

get entity dimension form handle

Definition at line 1885 of file Templates.hpp.

1885  {
1886  return moab::CN::Dimension(type_from_handle(h));
1887 };

◆ 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 304 of file DMMoFEM.cpp.

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

◆ DMMoFEMAddSubFieldCol() [2/3]

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

Add field to sub dm problem on columns

Definition at line 300 of file DMMoFEM.cpp.

300  {
301  return DMMoFEMAddSubFieldCol(dm, field_name.c_str());
302 }

◆ 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 321 of file DMMoFEM.cpp.

322  {
323  return DMMoFEMAddSubFieldCol(dm, field_name.c_str(), r_ptr);
324 }

◆ DMMoFEMAddSubFieldRow() [1/2]

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

Add field to sub dm problem on rows

Definition at line 258 of file DMMoFEM.cpp.

258  {
259  return DMMoFEMAddSubFieldRow(dm, field_name.c_str());
260 }

◆ 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 279 of file DMMoFEM.cpp.

280  {
281  return DMMoFEMAddSubFieldRow(dm, field_name.c_str(), r_ptr);
282 }

◆ DMMoFEMDuplicateDMCtx()

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

Duplicate internal data struture.

Parameters
dm
dm_duplicate
Returns
PetscErrorCode

Definition at line 184 of file DMMoFEM.cpp.

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

◆ 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 451 of file DMMoFEM.cpp.

451  {
453  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
455  DMCtx *dm_field = static_cast<DMCtx *>(dm->data);
456  *destroy_problem = dm_field->destroyProblem;
458 }

◆ 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 353 of file DMMoFEM.cpp.

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

◆ 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 335 of file DMMoFEM.cpp.

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

◆ 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 663 of file DMMoFEM.cpp.

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

◆ 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 622 of file DMMoFEM.cpp.

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

◆ 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 442 of file DMMoFEM.cpp.

442  {
444  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
446  DMCtx *dm_field = static_cast<DMCtx *>(dm->data);
447  dm_field->destroyProblem = destroy_problem;
449 }

◆ 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 1507 of file DMMoFEM.cpp.

1507  {
1508  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1510  DMCtx *dm_field = static_cast<DMCtx *>(dm->data);
1511  dm_field->verbosity = verb;
1513 }

◆ 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 703 of file DMMoFEM.cpp.

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

◆ 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 744 of file DMMoFEM.cpp.

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

◆ DMMoFEMSwapDMCtx()

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

Swap internal data struture.

Parameters
dm
dm_swap
Returns
PetscErrorCode

Definition at line 200 of file DMMoFEM.cpp.

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

◆ 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 949 of file DMMoFEM.cpp.

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

◆ 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 992 of file DMMoFEM.cpp.

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

◆ 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 785 of file DMMoFEM.cpp.

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

◆ 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 828 of file DMMoFEM.cpp.

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

◆ 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 1049 of file DMMoFEM.cpp.

1052  {
1053  return DMMoFEMTSSetMonitor<const char *, MoFEM::FEMethod *,
1055  dm, ts, fe_name, method, pre_only, post_only);
1057 }

◆ 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 1060 of file DMMoFEM.cpp.

1063  {
1064  return DMMoFEMTSSetMonitor<const std::string,
1065  boost::shared_ptr<MoFEM::FEMethod>,
1066  boost::shared_ptr<MoFEM::BasicMethod>,
1067  boost::shared_ptr<MoFEM::BasicMethod>>(
1068  dm, ts, fe_name, method, pre_only, post_only);
1070 }

◆ 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 1033 of file DMMoFEM.cpp.

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

◆ 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 898 of file DMMoFEM.cpp.

901  {
902  return DMMoFEMTSSetRHSFunction<const char *, MoFEM::FEMethod *,
904  dm, fe_name, method, pre_only, post_only);
906 }

◆ 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 886 of file DMMoFEM.cpp.

889  {
890  return DMMoFEMTSSetRHSFunction<const std::string,
891  boost::shared_ptr<MoFEM::FEMethod>,
892  boost::shared_ptr<MoFEM::BasicMethod>,
893  boost::shared_ptr<MoFEM::BasicMethod>>(
894  dm, fe_name, method, pre_only, post_only);
896 }

◆ 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 869 of file DMMoFEM.cpp.

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

◆ 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 938 of file DMMoFEM.cpp.

941  {
942  return DMMoFEMTSSetRHSJacobian<const char *, MoFEM::FEMethod *,
944  dm, fe_name, method, pre_only, post_only);
946 }

◆ 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 926 of file DMMoFEM.cpp.

929  {
930  return DMMoFEMTSSetRHSJacobian<const std::string,
931  boost::shared_ptr<MoFEM::FEMethod>,
932  boost::shared_ptr<MoFEM::BasicMethod>,
933  boost::shared_ptr<MoFEM::BasicMethod>>(
934  dm, fe_name, method, pre_only, post_only);
936 }

◆ 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 909 of file DMMoFEM.cpp.

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

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

1877  {
1878  return (static_cast<EntityHandle>(type) << MB_ID_WIDTH) | id;
1879 };

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

1901  {
1902  return BitFieldId().set(bit_number - 1);
1903 };

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

1857  {
1858  return boost::make_shared<TempMeshset>(moab);
1859 };

◆ 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 156 of file PetscSmartObj.hpp.

156  {
157  MPI_Comm comm;
158  CHK_THROW_MESSAGE(PetscObjectGetComm(obj, &comm),
159  "Failed to get comm from PETSc object");
160  return comm;
161 };

◆ getDMKspCtx()

auto MoFEM::getDMKspCtx ( DM  dm)
inline

Get KSP context data structure used by DM.

Examples
level_set.cpp.

Definition at line 1032 of file DMMoFEM.hpp.

1032  {
1033  boost::shared_ptr<MoFEM::KspCtx> ksp_ctx;
1034  ierr = DMMoFEMGetKspCtx(dm, ksp_ctx);
1035  CHKERRABORT(getCommFromPetscObject(reinterpret_cast<PetscObject>(dm)), ierr);
1036  return ksp_ctx;
1037 };

◆ 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 1046 of file DMMoFEM.hpp.

1046  {
1047  boost::shared_ptr<MoFEM::SnesCtx> snes_ctx;
1048  ierr = DMMoFEMGetSnesCtx(dm, snes_ctx);
1049  CHKERRABORT(getCommFromPetscObject(reinterpret_cast<PetscObject>(dm)), ierr);
1050  return snes_ctx;
1051 };

◆ getDMSubData()

auto MoFEM::getDMSubData ( DM  dm)
inline

Get sub problem data structure.

Parameters
dm
Returns
auto
Examples
plastic.cpp.

Definition at line 1076 of file DMMoFEM.hpp.

1076  {
1077  auto prb_ptr = getProblemPtr(dm);
1078  return prb_ptr->getSubData();
1079 };

◆ 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 1060 of file DMMoFEM.hpp.

1060  {
1061  boost::shared_ptr<MoFEM::TsCtx> ts_ctx;
1062  ierr = DMMoFEMGetTsCtx(dm, ts_ctx);
1063  CHKERRABORT(getCommFromPetscObject(reinterpret_cast<PetscObject>(dm)), ierr);
1064  return ts_ctx;
1065 };

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

1146  {
1147  return GetFTensor1FromArray<DIM, S>::get(data);
1148 }

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

1154  {
1155  return GetFTensor1FromArray<3, 0>::get(data);
1156 }

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

1204  {
1205  static_assert(DIM != DIM, "not implemented");
1207 }

◆ getFTensor1FromArrayDiag() [2/2]

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

Definition at line 1211 of file Templates.hpp.

1211  {
1212  return FTensor::Tensor1<FTensor::PackPtr<double *, 2>, 2>{&data(rr + 0, 0),
1213  &data(rr + 1, 1)};
1214 }

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

1164  {
1165  return FTensor::Tensor1<FTensor::PackPtr<double *, 1>, 2>{&data(rr + 0, 0),
1166  &data(rr + 1, 0)};
1167 }

◆ getFTensor1FromMat() [3/4]

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

Definition at line 1164 of file Templates.hpp.

1164  {
1165  return FTensor::Tensor1<FTensor::PackPtr<double *, 1>, 2>{&data(rr + 0, 0),
1166  &data(rr + 1, 0)};
1167 }

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

809  {
810  return GetFTensor1FromPtrImpl<DIM, S, adouble>::get(ptr);
811 };

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

802  {
803  return GetFTensor1FromPtrImpl<DIM, S, double>::get(ptr);
804 };

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

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

◆ getFTensor2FromArray() [1/3]

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

Definition at line 1322 of file Templates.hpp.

1322  {
1323  return GetFTensor2FromArrayImpl<DIM1, DIM2, S, adouble, ublas::row_major,
1324  VecAllocator<adouble>>::get(data, rr);
1325 }

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

1299  {
1300  return GetFTensor2FromArrayRawPtrImpl<DIM1, DIM2, double, ublas::row_major,
1301  VecAllocator<double>>::get(data, rr, cc,
1302  ss);
1303 }

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

1291  {
1292  return GetFTensor2FromArrayImpl<DIM1, DIM2, S, double, ublas::row_major,
1293  VecAllocator<double>>::get(data, rr, cc);
1294 }

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

1308  {
1309  return GetFTensor2FromArrayImpl<2, 2, S, T, L, A>::get(data, rr, cc);
1310 }

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

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

◆ 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,
281  DoubleAllocator>::get(data);
282 }

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

889  {
890  return GetFTensor2FromPtr<DIM1, DIM2, S, double>::get(ptr);
891 };

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

901  {
902  return GetFTensor2FromPtr<DIM1, DIM2, S, std::complex<double>>::get(ptr);
903 };

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

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

◆ getFTensor2FromVec() [2/2]

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

Template specialization for getFTensor2FromMat

Definition at line 293 of file Templates.hpp.

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

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

914  {
915  static_assert(DIM1 == DIM1 || DIM2 != DIM2,
916  "Such getFTensor2HVecFromPtr is not implemented");
917 };

◆ getFTensor2HVecFromPtr< 3, 2 >()

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

Definition at line 921 of file Templates.hpp.

921  {
923  &ptr[HVEC0_0], &ptr[HVEC0_1],
924 
925  &ptr[HVEC1_0], &ptr[HVEC1_1],
926 
927  &ptr[HVEC2_0], &ptr[HVEC2_1]);
928 };

◆ getFTensor2HVecFromPtr< 3, 3 >()

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

Definition at line 932 of file Templates.hpp.

932  {
934  &ptr[HVEC0_0], &ptr[HVEC0_1], &ptr[HVEC0_2],
935 
936  &ptr[HVEC1_0], &ptr[HVEC1_1], &ptr[HVEC1_2],
937 
938  &ptr[HVEC2_0], &ptr[HVEC2_1], &ptr[HVEC2_2]);
939 };

◆ getFTensor2SymmetricFromMat() [1/2]

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

Definition at line 340 of file Templates.hpp.

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

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

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

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

1026  {
1027  static_assert(DIM, "Such getFTensor2SymmetricFromPtr is not implemented");
1028 }

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

992  {
993  static_assert(DIM, "Such getFTensor2SymmetricFromPtr is not implemented");
994 }

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

Definition at line 1043 of file Templates.hpp.

1043  {
1045  &ptr[0], &ptr[1], &ptr[2]);
1046 };

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

Definition at line 1009 of file Templates.hpp.

1009  {
1011  &ptr[0], &ptr[1], &ptr[2]);
1012 };

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

Definition at line 1032 of file Templates.hpp.

1032  {
1034  &ptr[0], &ptr[1], &ptr[2],
1035 
1036  &ptr[3], &ptr[4],
1037 
1038  &ptr[5]);
1039 };

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

Definition at line 998 of file Templates.hpp.

998  {
1000  &ptr[0], &ptr[1], &ptr[2],
1001 
1002  &ptr[3], &ptr[4],
1003 
1004  &ptr[5]);
1005 };

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

1059  {
1060  static_assert(DIM,
1061  "Such getFTensor2SymmetricLowerFromPtr is not implemented");
1062 }

◆ getFTensor2SymmetricLowerFromPtr< 2 >()

Examples
plate.cpp.

Definition at line 1077 of file Templates.hpp.

1077  {
1079  &ptr[0], &ptr[1], &ptr[3]);
1080 };

◆ getFTensor2SymmetricLowerFromPtr< 3 >()

Definition at line 1066 of file Templates.hpp.

1066  {
1068  &ptr[HVEC0_0], &ptr[HVEC0_1], &ptr[HVEC0_2],
1069 
1070  &ptr[HVEC1_0], &ptr[HVEC1_1],
1071 
1072  &ptr[HVEC2_2]);
1073 };

◆ getFTensor3DgFromMat() [1/2]

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

Definition at line 505 of file Templates.hpp.

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

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

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

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

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

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

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

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

952  {
953  static_assert(DIM1 == DIM1 || DIM2 != DIM2 || DIM3 != DIM3,
954  "Such getFTensor3FromPtr is not implemented");
955 };

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

959  {
961  &ptr[0], &ptr[1], &ptr[2],
962 
963  &ptr[3], &ptr[4], &ptr[5],
964 
965  &ptr[6], &ptr[7], &ptr[8],
966 
967  &ptr[9], &ptr[10], &ptr[11]
968 
969  );
970 };

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

974  {
976  &ptr[0], &ptr[1], &ptr[2], &ptr[3], &ptr[4], &ptr[5], &ptr[6], &ptr[7],
977  &ptr[8], &ptr[9], &ptr[10], &ptr[11], &ptr[12], &ptr[13], &ptr[14],
978  &ptr[15], &ptr[16], &ptr[17], &ptr[18], &ptr[19], &ptr[20], &ptr[21],
979  &ptr[22], &ptr[23], &ptr[24], &ptr[25], &ptr[26]);
980 };

◆ getFTensor4DdgFromMat() [1/2]

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

Definition at line 424 of file Templates.hpp.

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

◆ getFTensor4DdgFromMat() [2/2]

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

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

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

Definition at line 418 of file Templates.hpp.

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

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

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

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

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

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

◆ 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 991 of file DMMoFEM.hpp.

991  {
992  const MoFEM::Problem *problem_ptr;
993  CHK_THROW_MESSAGE(DMMoFEMGetProblemPtr(dm, &problem_ptr),
994  "Get cot get problem ptr from DM");
995  return problem_ptr;
996 };

◆ 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_oposite_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_oposite_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 [30]

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_oposite_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_oposite_edges_node[0]],
637  faces_nodes[face_oposite_edges_node[1]],
638  faces_nodes[face_oposite_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 [30]

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

1861  {
1862  return static_cast<EntityID>(h & MB_ID_MASK);
1863 };

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

1789  {
1790  moab::Range::iterator hint = r.begin();
1791  while (begin_iter != end_iter) {
1792  size_t j = 0;
1793  auto bi = Extractor::extract(begin_iter);
1794  Iterator pj = begin_iter;
1795  while (pj != end_iter && (bi + j) == Extractor::extract(pj)) {
1796  ++pj;
1797  ++j;
1798  }
1799  hint = r.insert(hint, bi, bi + (j - 1));
1800  begin_iter = pj;
1801  }
1802  return hint;
1803 };

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

1743  {
1744  return InvertTensorImpl<FTensor::Tensor2<T1, DIM, DIM>, T2,
1745  FTensor::Tensor2<T3, DIM, DIM>, DIM>::invert(t, det,
1746  inv_t);
1747 }

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

1752  {
1753  return InvertTensorImpl<FTensor::Tensor2_symmetric<T1, DIM>, T2,
1755  DIM>::invert(t, det, inv_t);
1756 }

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

1620  {
1622  const auto inv_det = 1. / det;
1623  inv_t(0, 0) = t(1, 1) * inv_det;
1624  inv_t(0, 1) = -t(0, 1) * inv_det;
1625  inv_t(1, 0) = -t(1, 0) * inv_det;
1626  inv_t(1, 1) = t(0, 0) * inv_det;
1628 }

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

1600  {
1602  const auto inv_det = 1. / det;
1603  inv_t(0, 0) = (t(1, 1) * t(2, 2) - t(1, 2) * t(2, 1)) * inv_det;
1604  inv_t(0, 1) = (t(0, 2) * t(2, 1) - t(0, 1) * t(2, 2)) * inv_det;
1605  inv_t(0, 2) = (t(0, 1) * t(1, 2) - t(0, 2) * t(1, 1)) * inv_det;
1606  inv_t(1, 0) = (t(1, 2) * t(2, 0) - t(1, 0) * t(2, 2)) * inv_det;
1607  inv_t(1, 1) = (t(0, 0) * t(2, 2) - t(0, 2) * t(2, 0)) * inv_det;
1608  inv_t(1, 2) = (t(0, 2) * t(1, 0) - t(0, 0) * t(1, 2)) * inv_det;
1609  inv_t(2, 0) = (t(1, 0) * t(2, 1) - t(1, 1) * t(2, 0)) * inv_det;
1610  inv_t(2, 1) = (t(0, 1) * t(2, 0) - t(0, 0) * t(2, 1)) * inv_det;
1611  inv_t(2, 2) = (t(0, 0) * t(1, 1) - t(0, 1) * t(1, 0)) * inv_det;
1613 }

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

1561  {
1563  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
1564  "Specialization for this template not yet implemented");
1566 }

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

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

1961  {
1962  if constexpr (std::is_same<void, Dest>::value)
1963  return std::array<std::common_type_t<std::decay_t<Arg>...>, sizeof...(Arg)>{
1964  {std::forward<Arg>(arg)...}};
1965  else
1966  return std::array<Dest, sizeof...(Arg)>{{std::forward<Arg>(arg)...}};
1967 }

◆ matDuplicate()

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

Definition at line 230 of file PetscSmartObj.hpp.

230  {
231  Mat duplicate;
232  CHK_THROW_MESSAGE(MatDuplicate(mat, op, &duplicate),
233  "Failed to duplicate Mat");
234  return SmartPetscObj<Mat>(duplicate);
235 };

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

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

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

1660  {
1661  return MatSetValues<T>(M, row_data, col_data, &*mat.data().begin(), iora);
1662 }

◆ 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 109 of file FormsIntegrators.hpp.

112  {
113  return MatSetValues<EssentialBcStorage>(M, row_data, col_data, ptr, iora);
114 }

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

Definition at line 203 of file Schur.hpp.

206  {
207  return MatSetValues<SchurL2Mats>(M, row_data, col_data, mat, iora);
208 }

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

1668  {
1669  return MatSetValues(
1670  M, row_data.getIndices().size(), &*row_data.getIndices().begin(),
1671  col_data.getIndices().size(), &*col_data.getIndices().begin(), ptr, iora);
1672 }

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

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

Definition at line 189 of file Schur.hpp.

191  {
192  return SchurL2Mats::MatSetValues(M, row_data, col_data, mat, iora);
193 }

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

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

386  {
387  os << e.getNameRef() << " field_id " << e.getId().to_ulong() << " space "
388  << FieldSpaceNames[e.getSpace()] << " approximation base "
389  << ApproximationBaseNames[e.getApproxBase()] << " nb coefficients "
390  << e.getNbOfCoeffs() << " meshset " << e.meshSet;
391  return os;
392 }

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

402  {
403  os << "byWhat " << std::bitset<3>(e.byWhat) << " " << *e.entFieldPtr
404  << std::endl
405  << *e.entFePtr->getFiniteElementPtr();
406  return os;
407 }

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

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

1917  {
1919 
1920  auto first = f;
1921  while (first != s)
1922  if (tester(first)) {
1923 
1924  auto second = first;
1925  ++second;
1926 
1927  while (second != s) {
1928  if (tester(second))
1929  ++second;
1930  else
1931  break;
1932  }
1933 
1934  CHKERR inserter(first, second);
1935 
1936  first = second;
1937  if (first != s)
1938  ++first;
1939 
1940  } else {
1941  ++first;
1942  }
1943 
1945 }

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

1825  {
1827  for (auto it = mi.begin(); it != mi.end(); ++it) {
1828  if (!const_cast<MI &>(mi).modify(it, mo))
1829  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1830  "Houston we have a problem");
1831  }
1833 }

◆ scalar_fun_one()

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

Definition at line 138 of file FormsIntegrators.hpp.

138  {
139  return 1;
140 }

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

26  {
27  return MatSetValues<AssemblyTypeSelector<PETSC>>(M, row_data, col_data, mat,
28  iora);
29 }

◆ 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 866 of file Core.cpp.

866  {
867  RefEntityTmp<V>::basicDataPtr = ptr;
868 };

◆ setMPCParentAdjacency()

MoFEMErrorCode MoFEM::setMPCParentAdjacency ( )

Definition at line 15 of file EssentialMPCsData.cpp.

15  {
17 
19 }

◆ 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 1040 of file DMMoFEM.hpp.

1040 { return getDMKspCtx(dm); }

◆ smartGetDMSnesCtx()

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

Definition at line 1054 of file DMMoFEM.hpp.

1054 { return getDMSnesCtx(dm); }

◆ smartGetDMTsCtx()

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

Definition at line 1068 of file DMMoFEM.hpp.

1068 { 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 240 of file PetscSmartObj.hpp.

241  {
242  return matDuplicate(mat, op);
243 }

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

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

1407  {
1409  // copy matrix since on output lapack returns factorisation
1410  auto mat_copy = mat;
1411  CHKERR solveLinearSystem(mat_copy, f);
1413 }

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

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

◆ 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

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

1869  {
1870  return static_cast<EntityType>(h >> MB_ID_WIDTH);
1871 };

◆ type_name_from_handle()

auto MoFEM::type_name_from_handle ( const EntityHandle  h)
inline

get entity type name from handle

Definition at line 1893 of file Templates.hpp.

1893  {
1894  return moab::CN::EntityTypeName(type_from_handle(h));
1895 };

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

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

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

1610  {
1611  return VecSetValues<T>(V, data, &*vec.data().begin(), iora);
1612 }

◆ VecSetValues< AssemblyTypeSelector< PETSC > >()

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

Definition at line 117 of file FormsIntegrators.hpp.

119  {
120  return VecSetValues<EssentialBcStorage>(V, data, ptr, iora);
121 }

◆ VecSetValues< AssemblyTypeSelector< SCHUR > >()

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

Definition at line 211 of file Schur.hpp.

213  {
214  return VecSetValues<SchurL2Mats>(V, data, nf, iora);
215 }

◆ VecSetValues< EntityStorage >()

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

Definition at line 1586 of file EntitiesFieldData.hpp.

1587  {
1588  return VecSetValues(V, data.getIndices().size(), &*data.getIndices().begin(),
1589  ptr, iora);
1590 }

◆ VecSetValues< SchurL2Mats >()

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

Definition at line 197 of file Schur.hpp.

198  {
199  return VecSetValues<EssentialBcStorage>(V, data, nf, iora);
200 }

◆ vectorDuplicate()

SmartPetscObj<Vec> MoFEM::vectorDuplicate ( Vec  vec)
inline

Create duplicate vector of smart vector.

For details abut arguments see here: VecDuplicate.

Examples
child_and_parent.cpp, dg_projection.cpp, eigen_elastic.cpp, elasticity.cpp, ep.cpp, free_surface.cpp, hanging_node_approx.cpp, hcurl_check_approx_in_2d.cpp, heat_method.cpp, helmholtz.cpp, higher_derivatives.cpp, level_set.cpp, mixed_poisson.cpp, navier_stokes.cpp, phase.cpp, plastic.cpp, plate.cpp, poisson_2d_dis_galerkin.cpp, poisson_2d_homogeneous.cpp, scalar_check_approximation.cpp, shallow_wave.cpp, simple_interface.cpp, and wave_equation.cpp.

Definition at line 217 of file PetscSmartObj.hpp.

217  {
218  Vec duplicate;
219  CHK_THROW_MESSAGE(VecDuplicate(vec, &duplicate), "Failed to duplicate Vec");
220  return SmartPetscObj<Vec>(duplicate);
221 };

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

◆ 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 996 of file ForcesAndSourcesCore.hpp.

◆ K

VectorDouble MoFEM::K

◆ L

VectorDouble MoFEM::L

◆ 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:175
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
Definition: UnknownInterface.hpp:93
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:127
MoFEM::DMMoFEMGetTsCtx
PetscErrorCode DMMoFEMGetTsCtx(DM dm, const boost::shared_ptr< MoFEM::TsCtx > &ts_ctx)
get MoFEM::TsCtx data structure
Definition: DMMoFEM.cpp:1154
g
constexpr double g
Definition: shallow_wave.cpp:63
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.
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:1631
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:284
MOFEM_STD_EXCEPTION_THROW
@ MOFEM_STD_EXCEPTION_THROW
Definition: definitions.h:39
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
EntityHandle
HVEC0_2
@ HVEC0_2
Definition: definitions.h:198
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:1608
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::TSAdaptDestroyMoFEM
PetscErrorCode TSAdaptDestroyMoFEM(TSAdapt adapt)
Definition: TsCtx.cpp:791
MoFEM::Exceptions::MoFEMException
Exception to catch.
Definition: Exceptions.hpp:20
CHK_THROW_MESSAGE
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
Definition: definitions.h:596
MoFEM::edge_mirror_cross
static constexpr int edge_mirror_cross[6]
Definition: EntityRefine.cpp:23
ApproximationBaseNames
const static char *const ApproximationBaseNames[]
Definition: definitions.h:72
MoFEM::getDMKspCtx
auto getDMKspCtx(DM dm)
Get KSP context data structure used by DM.
Definition: DMMoFEM.hpp:1032
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
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
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:195
MoFEM::oposite_edge
static constexpr int oposite_edge[]
Definition: EntityRefine.cpp:19
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:192
HVEC1_1
@ HVEC1_1
Definition: definitions.h:196
ts_ctx
MoFEM::TsCtx * ts_ctx
Definition: level_set.cpp:1932
MoFEM::TsCtx::loopsIJacobian
FEMethodsSequence loopsIJacobian
Definition: TsCtx.hpp:29
HVEC1
@ HVEC1
Definition: definitions.h:186
sdf.r
int r
Definition: sdf.py:8
MoFEM::createDMMatrix
auto createDMMatrix(DM dm)
Get smart matrix from DM.
Definition: DMMoFEM.hpp:1003
FTensor::Tensor2
Definition: Tensor2_value.hpp:16
order
constexpr int order
Definition: dg_projection.cpp:18
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:123
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:1559
MoFEM::TsCtx::loopsRHSJacobian
FEMethodsSequence loopsRHSJacobian
Definition: TsCtx.hpp:32
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
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:197
MB_TYPE_MASK
#define MB_TYPE_MASK
Definition: definitions.h:228
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:151
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:535
HcurlEdgeBase
Definition: Hcurl.cpp:1978
FTensor::Tensor3
Definition: Tensor3_value.hpp:12
HVEC2_2
@ HVEC2_2
Definition: definitions.h:200
HVEC1_2
@ HVEC1_2
Definition: definitions.h:199
MoFEM::createDMVector
auto createDMVector(DM dm)
Get smart vector from DM.
Definition: DMMoFEM.hpp:1018
MoFEM::createGhostVector
auto createGhostVector(MPI_Comm comm, PetscInt n, PetscInt N, PetscInt nghost, const PetscInt ghosts[])
Create smart ghost vector.
Definition: PetscSmartObj.hpp:175
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::edge_permutations
static constexpr int edge_permutations[6][6]
Definition: EntityRefine.cpp:20
MoFEM::VecSetValues< SchurL2Mats >
MoFEMErrorCode VecSetValues< SchurL2Mats >(Vec V, const EntitiesFieldData::EntData &data, const VectorDouble &nf, InsertMode iora)
Definition: Schur.hpp:197
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:137
a
constexpr double a
Definition: approx_sphere.cpp:30
MoFEM::TsCtx::mField
MoFEM::Interface & mField
Definition: TsCtx.hpp:19
MoFEM::MatSetValues< EssentialBcStorage >
MoFEMErrorCode MatSetValues< EssentialBcStorage >(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
Set values to matrix in operator.
Definition: FormsIntegrators.cpp:112
MoFEM::PetscOptionsGetReal
PetscErrorCode PetscOptionsGetReal(PetscOptions *, const char pre[], const char name[], PetscReal *dval, PetscBool *set)
Definition: DeprecatedPetsc.hpp:152
HcurlFaceBase::calculateOneFamily
MoFEMErrorCode calculateOneFamily(int p, int nb_integration_pts, int n0f0_idx, int n1f0_idx, int n2f0_idx, double n[], FTensor::Tensor1< double, 3 > t_grad_n[], FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > &t_phi, FTensor::Tensor2< FTensor::PackPtr< double *, DIM *3 >, 3, DIM > &t_diff_phi)
Definition: Hcurl.cpp:2186
MoFEM::getVectorAdaptor
auto getVectorAdaptor(T1 ptr, const size_t n)
Get Vector adaptor.
Definition: Templates.hpp:31
MoFEM::getFTensor2HVecFromPtr< 3, 3 >
FTensor::Tensor2< FTensor::PackPtr< double *, 9 >, 3, 3 > getFTensor2HVecFromPtr< 3, 3 >(double *ptr)
Definition: Templates.hpp:932
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:1788
MOFEM_LOG_C
#define MOFEM_LOG_C(channel, severity, format,...)
Definition: LogManager.hpp:311
MoFEM::DMMoFEMTSSetRHSFunction
static PetscErrorCode DMMoFEMTSSetRHSFunction(DM dm, S fe_name, T0 method, T1 pre_only, T2 post_only)
Definition: DMMoFEM.cpp:869
NBFACETRI_DEMKOWICZ_HDIV
#define NBFACETRI_DEMKOWICZ_HDIV(P)
Definition: h1_hdiv_hcurl_l2.h:139
DIM1
constexpr int DIM1
Definition: level_set.cpp:21
double
MoFEM::TsCtx::postProcessMonitor
BasicMethodsSequence postProcessMonitor
Definition: TsCtx.hpp:39
bit
auto bit
set bit
Definition: hanging_node_approx.cpp:75
convert.type
type
Definition: convert.py:64
MoFEM::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
COL
@ COL
Definition: definitions.h:123
MoFEM::TsCtx::zeroMatrix
bool zeroMatrix
Definition: TsCtx.hpp:45
MoFEM::DMRegister_MoFEM
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMoFEM.cpp:47
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
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::MatSetValues< SchurL2Mats >
MoFEMErrorCode MatSetValues< SchurL2Mats >(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora)
Definition: Schur.hpp:189
MoFEM::type_from_handle
auto type_from_handle(const EntityHandle h)
get type from entity handle
Definition: Templates.hpp:1869
MB_ID_WIDTH
#define MB_ID_WIDTH
Definition: definitions.h:227
MoFEM::MPC::TIE
@ TIE
MoFEM::BasicMethod
Data structure to exchange data between mofem and User Loop Methods.
Definition: LoopMethods.hpp:183
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:230
t
constexpr double t
plate stiffness
Definition: plate.cpp:59
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::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:1578
MoFEM::TsCtx::postProcessRHSFunction
BasicMethodsSequence postProcessRHSFunction
Definition: TsCtx.hpp:43
MoFEM::DMMoFEMGetKspCtx
PetscErrorCode DMMoFEMGetKspCtx(DM dm, const boost::shared_ptr< MoFEM::KspCtx > &ksp_ctx)
get MoFEM::KspCtx data structure
Definition: DMMoFEM.cpp:1081
LASTSET_BC
@ LASTSET_BC
Definition: definitions.h:166
MoFEM::determinantTensor2by2
MoFEMErrorCode determinantTensor2by2(T1 &t, T2 &det)
Calculate determinant 2 by 2.
Definition: Templates.hpp:1589
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:1511
MoFEM::DMMoFEMGetSnesCtx
PetscErrorCode DMMoFEMGetSnesCtx(DM dm, const boost::shared_ptr< MoFEM::SnesCtx > &snes_ctx)
get MoFEM::SnesCtx data structure
Definition: DMMoFEM.cpp:1107
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:1491
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
adouble
NBEDGE_AINSWORTH_HCURL
#define NBEDGE_AINSWORTH_HCURL(P)
Definition: h1_hdiv_hcurl_l2.h:97
MoFEM::PetscOptionsGetRealArray
PetscErrorCode PetscOptionsGetRealArray(PetscOptions *, const char pre[], const char name[], PetscReal dval[], PetscInt *nmax, PetscBool *set)
Definition: DeprecatedPetsc.hpp:192
FTensor::dd
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: ddTensor0.hpp:33
MoFEM::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:1657
FieldSpaceNames
const static char *const FieldSpaceNames[]
Definition: definitions.h:92
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:217
MoFEM::getFTensor2SymmetricFromMat
static auto getFTensor2SymmetricFromMat(MatrixDouble &data)
Definition: Templates.hpp:340
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
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:1033
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:921
BLOCKSET
@ BLOCKSET
Definition: definitions.h:148
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
eps
static const double eps
Definition: check_base_functions_derivatives_on_tet.cpp:11
Jacobi_polynomials
PetscErrorCode Jacobi_polynomials(int p, double alpha, double x, double t, double *diff_x, double *diff_t, double *L, double *diffL, const int dim)
Calculate Jacobi approximation basis.
Definition: base_functions.c:67
lapack_dsyev
static __CLPK_integer lapack_dsyev(char jobz, char uplo, __CLPK_integer n, __CLPK_doublereal *a, __CLPK_integer lda, __CLPK_doublereal *w, __CLPK_doublereal *work, __CLPK_integer lwork)
Definition: lapack_wrap.h:261
MoFEM::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:991
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:156
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:430
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:198
MoFEM::edges_conn
static constexpr int edges_conn[]
Definition: EntityRefine.cpp:18
DIM2
constexpr int DIM2
Definition: level_set.cpp:22
HVEC2_0
@ HVEC2_0
Definition: definitions.h:194
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:1046
NBVOLUMETET_AINSWORTH_TET_HCURL
#define NBVOLUMETET_AINSWORTH_TET_HCURL(P)
Definition: h1_hdiv_hcurl_l2.h:103
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
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:242
HVEC2
@ HVEC2
Definition: definitions.h:186
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:234
MoFEM::DMMoFEMTSSetRHSJacobian
static PetscErrorCode DMMoFEMTSSetRHSJacobian(DM dm, S fe_name, T0 method, T1 pre_only, T2 post_only)
Definition: DMMoFEM.cpp:909
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:416
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:1060
MoFEM::TsCtx::preProcessRHSFunction
BasicMethodsSequence preProcessRHSFunction
Definition: TsCtx.hpp:41
CHKERRG
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:483
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
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
HVEC1_0
@ HVEC1_0
Definition: definitions.h:193
MoFEM::MPC::COUPLING
@ COUPLING
HVEC0
@ HVEC0
Definition: definitions.h:186
F
@ F
Definition: free_surface.cpp:394
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:1406