m_MEF90_DefMech_class Module



Variables

Type Visibility Attributes Name Initial
character(len=MEF90MXSTRLEN), protected, dimension(6) :: MEF90DefMech_BTTypeList = [character(len=MEF90MXSTRLEN)::'Null', 'Backward', 'Forward', 'MEF90DefMech_BTType', '_MEF90DefMech_BTType', '']
character(len=MEF90MXSTRLEN), protected, dimension(5) :: MEF90DefMech_DamageSolverTypeList = [character(len=MEF90MXSTRLEN)::'SNES', 'Tao', 'MEF90DefMech_DamageSolverType', '_MEF90DefMech_DamageSolverType', '']
character(len=MEF90MXSTRLEN), protected, dimension(6) :: MEF90DefMech_SolverTypeList = [character(len=MEF90MXSTRLEN)::'AltMin', 'QuasiNewton1', 'QuasiNewton2', 'MEF90DefMech_SolverType', '_MEF90DefMech_SolverType', '']
character(len=MEF90MXSTRLEN), protected, dimension(5) :: MEF90DefMech_TimeSteppingTypeList = [character(len=MEF90MXSTRLEN)::'Null', 'QuasiStatic', 'MEF90DefMech_TimeSteppingType', '_MEF90DefMech_TimeSteppingType', '']
character(len=MEF90MXSTRLEN), protected, dimension(13) :: MEF90DefMech_plasticityTypeList = [character(len=MEF90MXSTRLEN)::'None', 'Tresca', 'VonMises', 'VonMisesPlaneTheory', 'CapModel', 'DruckerPragerCapModel', 'VonMises1D', 'HillPlaneTheory', 'Green', 'Gurson', 'MEF90DefMech_plasticityType', '_MEF90DefMech_plasticityType', '']
character(len=MEF90MXSTRLEN), protected, dimension(7) :: MEF90DefMech_unilateralContactTypeList = [character(len=MEF90MXSTRLEN)::'None', 'HydrostaticDeviatoric', 'Hydrostatic', 'Deviatoric', 'MEF90DefMech_unilateralContactTypeList', '_MEF90DefMech_unilateralContactTypeList', '']

Enumerations

enum, bind(c)

Enumerators

enumerator:: MEF90DefMech_SolverTypeAltMin = 0
enumerator:: MEF90DefMech_SolverTypeQuasiNewton1 = 1
enumerator:: MEF90DefMech_SolverTypeQuasiNewton2 = 2

Description

Author
Blaise Bourdin (2012-20, bourdin@lsu.edu) Blaise Bourdin (2026, bourdin@mcmaster.ca)

MEF90DefMech_Type: The class holding the state and the options of a defect mechanics problem

enum, bind(c)

Enumerators

enumerator:: MEF90DefMech_TimeSteppingTypeNULL = 0
enumerator:: MEF90DefMech_TimeSteppingTypeQuasiStatic = 1

enum, bind(c)

Enumerators

enumerator:: MEF90DefMech_DamageSolverTypeSNES = 0
enumerator:: MEF90DefMech_DamageSolverTypeTAO = 1

enum, bind(c)

Enumerators

enumerator:: MEF90DefMech_BTTypeNULL = 0
enumerator:: MEF90DefMech_BTTypeBackward = 1
enumerator:: MEF90DefMech_BTTypeForward = 2

enum, bind(c)

Enumerators

enumerator:: MEF90DefMech_plasticityTypeNone = 0
enumerator:: MEF90DefMech_plasticityTypeTresca = 1
enumerator:: MEF90DefMech_plasticityTypeVonMises = 2
enumerator:: MEF90DefMech_plasticityTypeVonMisesPlaneTheory = 3
enumerator:: MEF90DefMech_plasticityTypeCapModel = 4
enumerator:: MEF90DefMech_plasticityTypeDruckerPragerCapModel = 5
enumerator:: MEF90DefMech_plasticityTypeVonMises1D = 6
enumerator:: MEF90DefMech_plasticityTypeHillPlaneTheory = 7
enumerator:: MEF90DefMech_PlasticityTypeGreen = 8
enumerator:: MEF90DefMech_PlasticityTypeGurson = 9

enum, bind(c)

Enumerators

enumerator:: MEF90DefMech_unilateralContactTypeNone = 0
enumerator:: MEF90DefMech_unilateralContactTypeHydrostaticDeviatoric = 1
enumerator:: MEF90DefMech_unilateralContactTypeHydrostatic = 2
enumerator:: MEF90DefMech_unilateralContactTypeDeviatoric = 3

Derived Types

type, public, extends(MEF90Object) ::  MEF90DefMechCellSetOptions_Type

Components

Type Visibility Attributes Name Initial
logical(kind=C_BOOL), public :: CrackVolumeControlled = PETSC_FALSE
logical(kind=C_BOOL), public :: Has_damageBC = PETSC_FALSE
logical(kind=C_BOOL), public, dimension(3) :: Has_displacementBC = [PETSC_FALSE, PETSC_FALSE, PETSC_FALSE]
logical(kind=C_BOOL), public :: WorkControlled = PETSC_FALSE
real(kind=C_DOUBLE), public, dimension(3) :: bodyforce = [0.0_kr, 0.0_kr, 0.0_kr]
real(kind=C_DOUBLE), public :: boundaryDamage = 0.0_kr
real(kind=C_DOUBLE), public, dimension(3) :: boundaryDisplacement = [0.0_kr, 0.0_kr, 0.0_kr]
real(kind=C_DOUBLE), public, dimension(3) :: cohesiveDisplacement = [0.0_kr, 0.0_kr, 0.0_kr]
real(kind=C_DOUBLE), public :: cohesiveStiffness = 0.0_kr
integer(kind=C_INT32_T), public :: comm
real(kind=C_DOUBLE), public :: crackPressure = 0.0_kr
real(kind=C_DOUBLE), public, dimension(3) :: displacementLowerBound = [MEF90NINFINITY, MEF90NINFINITY, MEF90NINFINITY]
real(kind=C_DOUBLE), public, dimension(3) :: displacementUpperBound = [MEF90INFINITY, MEF90INFINITY, MEF90INFINITY]
class(mef90Mat), public, allocatable :: linearThermalExpansion

Material properties. linearThermalExpansion is a symmetric matrix, so it is dimension dependent and allocated by MEF90DefMechCellSetOptionsSetFromOptions

character(kind=c_char, len=MEF90MXSTRLEN), public :: name = "NULL"
integer(kind=C_INT32_T), public :: plasticityType = MEF90DefMech_plasticityTypeNone
character(kind=c_char, len=MEF90MXSTRLEN), public :: prefix

Type-Bound Procedures

procedure, public, pass(self) :: setFromOptions => MEF90Object_setFromOptions
procedure, public, pass(self) :: view => MEF90Object_view
procedure, public, pass(self) :: view_internal => MEF90DefMechCellSetOptionsView

type, public, extends(MEF90Object) ::  MEF90DefMechFaceSetOptions_Type

Components

Type Visibility Attributes Name Initial
logical(kind=C_BOOL), public :: Has_damageBC = PETSC_FALSE
logical(kind=C_BOOL), public, dimension(3) :: Has_displacementBC = [PETSC_FALSE, PETSC_FALSE, PETSC_FALSE]
real(kind=C_DOUBLE), public :: boundaryDamage = 0.0_kr
real(kind=C_DOUBLE), public, dimension(3) :: boundaryDisplacement = [0.0_kr, 0.0_kr, 0.0_kr]
real(kind=C_DOUBLE), public, dimension(3) :: boundaryforce = [0.0_kr, 0.0_kr, 0.0_kr]
integer(kind=C_INT32_T), public :: comm
real(kind=C_DOUBLE), public, dimension(3) :: displacementLowerBound = [MEF90NINFINITY, MEF90NINFINITY, MEF90NINFINITY]
real(kind=C_DOUBLE), public, dimension(3) :: displacementUpperBound = [MEF90INFINITY, MEF90INFINITY, MEF90INFINITY]
character(kind=c_char, len=MEF90MXSTRLEN), public :: name = "NULL"
character(kind=c_char, len=MEF90MXSTRLEN), public :: prefix
real(kind=C_DOUBLE), public :: pressureForce = 0.0_kr

Type-Bound Procedures

procedure, public, pass(self) :: setFromOptions => MEF90Object_setFromOptions
procedure, public, pass(self) :: view => MEF90Object_view
procedure, public, pass(self) :: view_internal => MEF90DefMechFaceSetOptionsView

type, public, extends(MEF90Object) ::  MEF90DefMechGlobalOptions_Type

MEF90DefMechGlobalOptions_Type: the problem-wide options of a MEF90DefMech_Type. The values given here are the defaults used by setFromOptions

Components

Type Visibility Attributes Name Initial
integer(kind=C_INT32_T), public :: BTInterval = -1_ki
integer(kind=C_INT32_T), public :: BTScope = -1_ki
real(kind=C_DOUBLE), public :: BTTol = 1.0e-2_kr
integer(kind=C_INT32_T), public :: BTType = MEF90DefMech_BTTypeNULL
integer(kind=C_INT32_T), public :: CrackPressureScaling = MEF90Scaling_Linear
real(kind=C_DOUBLE), public :: InjectedVolumeATol = 1.0e-3_kr
integer(kind=C_INT32_T), public :: PCLag = 10_ki
real(kind=C_DOUBLE), public :: SOROmega = 1.0_kr
integer(kind=C_INT32_T), public :: bodyForceScaling = MEF90Scaling_Linear
integer(kind=C_INT32_T), public :: boundaryDamageScaling = MEF90Scaling_CST
integer(kind=C_INT32_T), public :: boundaryDisplacementScaling = MEF90Scaling_Linear

scaling = time (step) scaling law currently CST, Linear, or File

integer(kind=C_INT32_T), public :: boundaryForceScaling = MEF90Scaling_Linear
integer(kind=C_INT32_T), public :: cohesiveDisplacementScaling = MEF90Scaling_CST
integer(kind=C_INT32_T), public :: comm
logical(kind=C_BOOL), public :: cumulatedPlasticDissipationExport = PETSC_FALSE
real(kind=C_DOUBLE), public :: damageATol = 1.0e-3_kr
logical(kind=C_BOOL), public :: damageExport = PETSC_TRUE
integer(kind=C_INT32_T), public :: damageMaxIt = 1000_ki
integer(kind=C_INT32_T), public :: damageSolverType = MEF90DefMech_DamageSolverTypeSNES
real(kind=C_DOUBLE), public :: dampingCoefficientDamage = 0.0_kr
real(kind=C_DOUBLE), public :: dampingCoefficientDisplacement = 0.0_kr
logical(kind=C_BOOL), public :: displacementExport = PETSC_TRUE
integer(kind=C_INT32_T), public :: displacementLowerBoundScaling = MEF90Scaling_CST
integer(kind=C_INT32_T), public :: displacementUpperBoundScaling = MEF90Scaling_CST
real(kind=C_DOUBLE), public :: irrevthres = 0.0_kr
logical(kind=C_BOOL), public :: multiPhaseField = PETSC_FALSE
character(kind=c_char, len=MEF90MXSTRLEN), public :: name = "NULL"
real(kind=C_DOUBLE), public :: plasticStrainATol = 1.0e-4_kr
logical(kind=C_BOOL), public :: plasticStrainExport = PETSC_FALSE
character(kind=c_char, len=MEF90MXSTRLEN), public :: prefix
integer(kind=C_INT32_T), public :: pressureForceScaling = MEF90Scaling_Linear
integer(kind=C_INT32_T), public :: solverType = MEF90DefMech_SolverTypeAltMin
logical(kind=C_BOOL), public :: stressExport = PETSC_TRUE
logical(kind=C_BOOL), public :: temperatureExport = PETSC_FALSE
integer(kind=C_INT32_T), public :: timeSteppingType = MEF90DefMech_TimeSteppingTypeQuasiStatic

Type-Bound Procedures

procedure, public, pass(self) :: setFromOptions => MEF90Object_setFromOptions
procedure, public, pass(self) :: view => MEF90Object_view
procedure, public, pass(self) :: view_internal => MEF90DefMechGlobalOptionsView

type, public, extends(MEF90Object) ::  MEF90DefMechVertexSetOptions_Type

Components

Type Visibility Attributes Name Initial
logical(kind=C_BOOL), public :: Has_damageBC = PETSC_FALSE
logical(kind=C_BOOL), public, dimension(3) :: Has_displacementBC = [PETSC_FALSE, PETSC_FALSE, PETSC_FALSE]
real(kind=C_DOUBLE), public :: boundaryDamage = 0.0_kr
real(kind=C_DOUBLE), public, dimension(3) :: boundaryDisplacement = [0.0_kr, 0.0_kr, 0.0_kr]
integer(kind=C_INT32_T), public :: comm
real(kind=C_DOUBLE), public, dimension(3) :: displacementLowerBound = [MEF90NINFINITY, MEF90NINFINITY, MEF90NINFINITY]
real(kind=C_DOUBLE), public, dimension(3) :: displacementUpperBound = [MEF90INFINITY, MEF90INFINITY, MEF90INFINITY]
character(kind=c_char, len=MEF90MXSTRLEN), public :: name = "NULL"
character(kind=c_char, len=MEF90MXSTRLEN), public :: prefix

Type-Bound Procedures

procedure, public, pass(self) :: setFromOptions => MEF90Object_setFromOptions
procedure, public, pass(self) :: view => MEF90Object_view
procedure, public, pass(self) :: view_internal => MEF90DefMechVertexSetOptionsView

type, public, extends(MEF90Object) ::  MEF90DefMech_Type

Components

Type Visibility Attributes Name Initial
type(tPetscSF), public :: IOToBodyForceSF
type(tPetscSF), public :: IOToBoundaryForceSF
type(tPetscSF), public :: IOToCohesiveDisplacementSF
type(tPetscSF), public :: IOToCumulatedPlasticDissSF
type(tPetscSF), public :: IOToDamageSF
type(tPetscSF), public :: IOToDisplacementSF
type(tPetscSF), public :: IOToPlasticStrainSF
type(tPetscSF), public :: IOToPressureForceSF
type(tPetscSF), public :: IOToStressSF
type(tPetscSF), public :: IOToTemperatureSF
type(MEF90Ctx_Type), public, pointer :: MEF90Ctx => null()
type(c_ptr), public :: PETScCtx = C_NULL_PTR

Handle on self, set once in MEF90DefMechCreate with PETScCtx = c_loc(DefMech), and handed to PETSc wherever an application context is expected: SNESSetFunction, SNESSetJacobian, TAOSetObjective, ... The callbacks in m_MEF90_DefMech recover the context with call c_f_pointer(PETScCtx, MEF90DefMechCtx)

Read more…
real(kind=C_DOUBLE), public :: analysisTime
type(tVec), public, pointer :: bodyForce => null()

cell based vec

type(tPetscSF), public :: bodyForceToIOSF
type(tVec), public, pointer :: boundaryForce => null()
type(tPetscSF), public :: boundaryForceToIOSF
type(tVec), public, pointer :: cohesiveDisplacement => null()
type(tPetscSF), public :: cohesiveDisplacementToIOSF
integer(kind=C_INT32_T), public :: comm
type(tPetscSF), public :: cumulatedPlasticDissToIOSF
type(tVec), public, pointer :: cumulatedPlasticDissipation => null()
integer(kind=C_INT32_T), public :: currentSet = 0_Ki
type(tPetscSF), public :: damageConstraintsSF
type(tVec), public, pointer :: damageLocal => null()
type(tPetscSF), public :: damageToIOSF
integer(kind=C_INT32_T), public :: dim
type(tPetscSF), public :: displacementConstraintsSF
type(tVec), public, pointer :: displacementLocal => null()

vertex based vec

type(tVec), public, pointer :: displacementLowerBoundLocal => null()
type(tVec), public, pointer :: displacementPreviousStepLocal => null()
type(tPetscSF), public :: displacementToIOSF
type(tVec), public, pointer :: displacementUpperBoundLocal => null()
type(tPetscViewer), public :: globalEnergyViewer

Neither the problem-wide nor the per-set options are stored: they are read from the options database where they are needed, with MEF90DefMechGlobalOptionsSetFromOptions and MEF90DefMech[Cell,Face,Vertex]SetOptionsSetFromOptions, the same way the AT model, the energy split, and the Hooke's law are obtained. The number of sets is obtained from the megaDM with MEF90DMGetNumSets.

logical(kind=C_BOOL), public :: hasDisplacementBounds = PETSC_FALSE
logical(kind=C_BOOL), public :: hasUnilateralContact = PETSC_FALSE
type(tDM), public :: megaDM
character(kind=c_char, len=MEF90MXSTRLEN), public :: name = "NULL"
type(tVec), public, dimension(:), pointer :: partialDamageLocal => null()
type(tVec), public, pointer :: plasticStrain => null()
type(tPetscSF), public :: plasticStrainToIOSF
character(kind=c_char, len=MEF90MXSTRLEN), public :: prefix
type(tVec), public, pointer :: pressureForce => null()
type(tPetscSF), public :: pressureForceToIOSF
type(tPetscViewer), public, dimension(:), pointer :: setEnergyViewer => null()
type(tVec), public, pointer :: stress => null()
type(tPetscSF), public :: stressToIOSF
type(tVec), public, pointer :: temperatureLocal => null()
type(tPetscSF), public :: temperatureToIOSF
real(kind=C_DOUBLE), public :: timeStep

Type-Bound Procedures

procedure, public, pass(self) :: setFromOptions => MEF90DefMechSetFromOptions
procedure, public, pass(self) :: view => MEF90Object_view
procedure, public, pass(self) :: view_internal => MEF90DefMechView

Subroutines

public subroutine MEF90DefMechCellSetOptionsSetFromOptions(comm, prefix, dim, options, ierr)

Author
Blaise Bourdin (2026, bourdin@mcmaster.ca)

MEF90DefMechCellSetOptionsSetFromOptions: reads the options of a single cell set

Arguments

Type IntentOptional Attributes Name
integer(kind=C_INT32_T), intent(in) :: comm
character(len=*), intent(in) :: prefix
integer(kind=C_INT32_T), intent(in) :: dim
type(MEF90DefMechCellSetOptions_Type), intent(out) :: options
integer(kind=C_INT32_T), intent(inout) :: ierr

public subroutine MEF90DefMechCellSetOptionsView(self, viewer, ierr)

Author
Blaise Bourdin (2026, bourdin@mcmaster.ca)

MEF90DefMechCellSetOptionsView: the default viewer for a MEF90DefMechCellSetOptions_Type

Arguments

Type IntentOptional Attributes Name
class(MEF90DefMechCellSetOptions_Type), intent(in) :: self
type(tPetscViewer), intent(in) :: viewer
integer(kind=C_INT32_T), intent(inout) :: ierr

public subroutine MEF90DefMechCreate(DefMechCtx, dm, MEF90Ctx, prefix, ierr)

Author
Blaise Bourdin (2012-20, bourdin@lsu.edu) Blaise Bourdin (2026, bourdin@mcmaster.ca)

MEF90DefMechCreate: allocates all the fields of a MEF90DefMech_Type

Arguments

Type IntentOptional Attributes Name
type(MEF90DefMech_Type), intent(out), target :: DefMechCtx

DefMech has the target attribute so that DefMech%PETScCtx can be handed over to PETSc as an application context. The actual argument MUST therefore also have the target attribute.

type(tDM), intent(in), target :: dm
type(MEF90Ctx_Type), intent(in), target :: MEF90Ctx
character(len=*), intent(in) :: prefix
integer(kind=C_INT32_T), intent(inout) :: ierr

public subroutine MEF90DefMechDestroy(DefMech, ierr)

Author
Blaise Bourdin (2012-14, bourdin@lsu.edu) Blaise Bourdin (2026, bourdin@mcmaster.ca)

MEF90DefMechDestroy: destroys a MEF90DefMech_Type

Arguments

Type IntentOptional Attributes Name
type(MEF90DefMech_Type), intent(inout) :: DefMech
integer(kind=C_INT32_T), intent(inout) :: ierr

public subroutine MEF90DefMechFaceSetOptionsSetFromOptions(comm, prefix, options, ierr)

Author
Blaise Bourdin (2026, bourdin@mcmaster.ca)

MEF90DefMechFaceSetOptionsSetFromOptions: reads the options of a single face set

Arguments

Type IntentOptional Attributes Name
integer(kind=C_INT32_T), intent(in) :: comm
character(len=*), intent(in) :: prefix
type(MEF90DefMechFaceSetOptions_Type), intent(out) :: options
integer(kind=C_INT32_T), intent(inout) :: ierr

public subroutine MEF90DefMechFaceSetOptionsView(self, viewer, ierr)

Author
Blaise Bourdin (2026, bourdin@mcmaster.ca)

MEF90DefMechFaceSetOptionsView: the default viewer for a MEF90DefMechFaceSetOptions_Type

Arguments

Type IntentOptional Attributes Name
class(MEF90DefMechFaceSetOptions_Type), intent(in) :: self
type(tPetscViewer), intent(in) :: viewer
integer(kind=C_INT32_T), intent(inout) :: ierr

public subroutine MEF90DefMechGlobalOptionsSetFromOptions(comm, prefix, options, ierr)

Author
Blaise Bourdin (2026, bourdin@mcmaster.ca)

MEF90DefMechGlobalOptionsSetFromOptions: reads the problem-wide options of a MEF90DefMech_Type

Arguments

Type IntentOptional Attributes Name
integer(kind=C_INT32_T), intent(in) :: comm
character(len=*), intent(in) :: prefix
type(MEF90DefMechGlobalOptions_Type), intent(out) :: options
integer(kind=C_INT32_T), intent(inout) :: ierr

public subroutine MEF90DefMechGlobalOptionsView(self, viewer, ierr)

Author
Blaise Bourdin (2026, bourdin@mcmaster.ca)

MEF90DefMechGlobalOptionsView: the default viewer for a MEF90DefMechGlobalOptions_Type

Arguments

Type IntentOptional Attributes Name
class(MEF90DefMechGlobalOptions_Type), intent(in) :: self
type(tPetscViewer), intent(in) :: viewer
integer(kind=C_INT32_T), intent(inout) :: ierr

public subroutine MEF90DefMechSetFromOptions(self, ierr)

Author
Blaise Bourdin (2012-14, bourdin@lsu.edu) Blaise Bourdin (2026, bourdin@mcmaster.ca)

MEF90DefMechSetFromOptions: initializes a MEF90DefMech_Type from options

Arguments

Type IntentOptional Attributes Name
class(MEF90DefMech_Type), intent(inout) :: self
integer(kind=C_INT32_T), intent(inout) :: ierr

public subroutine MEF90DefMechVertexSetOptionsSetFromOptions(comm, prefix, options, ierr)

Author
Blaise Bourdin (2026, bourdin@mcmaster.ca)

MEF90DefMechVertexSetOptionsSetFromOptions: reads the options of a single vertex set

Arguments

Type IntentOptional Attributes Name
integer(kind=C_INT32_T), intent(in) :: comm
character(len=*), intent(in) :: prefix
type(MEF90DefMechVertexSetOptions_Type), intent(out) :: options
integer(kind=C_INT32_T), intent(inout) :: ierr

public subroutine MEF90DefMechVertexSetOptionsView(self, viewer, ierr)

Author
Blaise Bourdin (2026, bourdin@mcmaster.ca)

MEF90DefMechVertexSetOptionsView: the default viewer for a MEF90DefMechVertexSetOptions_Type

Arguments

Type IntentOptional Attributes Name
class(MEF90DefMechVertexSetOptions_Type), intent(in) :: self
type(tPetscViewer), intent(in) :: viewer
integer(kind=C_INT32_T), intent(inout) :: ierr

public subroutine MEF90DefMechView(self, viewer, ierr)

Author
Blaise Bourdin (2026, bourdin@mcmaster.ca)

MEF90DefMechView: the default viewer for a MEF90DefMech_Type

Arguments

Type IntentOptional Attributes Name
class(MEF90DefMech_Type), intent(in) :: self
type(tPetscViewer), intent(in) :: viewer
integer(kind=C_INT32_T), intent(inout) :: ierr