Skip to main content

SolidMaterial

Solid material

SolidMaterial_ is a subclass of AbstractMaterial class. Its purpose is to handle solid materials, like steel, brass, copper, among others.

SolidMaterial_ also encapsulates the abstract model for defining the material constitutive behavior. The structure of SolidMaterial_ is given below.

TYPE, EXTENDS(AbstractMaterial_) :: SolidMaterial_
CLASS(AbstractSolidMechanicsModel_), POINTER :: stressStrainModel => NULL()
!! Pointer to stress strain material behavior of solids
END TYPE

How to initiate?

There are three ways to initiate an instance of SolidMaterial_. In this section we will cover constructing the instance by using Initiate.

info

We will consider the following example to learn about the SolidMaterial_.

Click here to see example
PROGRAM main
USE easifemBase
USE easifemClasses
USE easifemMaterials

CHARACTER(*), PARAMETER :: myName = "main"
CHARACTER(*), PARAMETER :: modName = "main"
TYPE(SolidMaterial_) :: obj
TYPE(ParameterList_) :: param
CLASS(UserFunction_), POINTER :: func => NULL()
INTEGER(I4B) :: ierr

CALL FPL_Init(); CALL param%Initiate()

! Set parameter
CALL SetSolidMaterialParam(param=param, name="SolidMaterial")

! Initiate an instance of `SolidMaterial_`
CALL obj%Initiate(param)

! Adding a material property
CALL obj%AddMaterial("massDensity")

func => obj%GetMaterialPointer("massDensity")

IF (.NOT. ASSOCIATED(func)) THEN
CALL e%RaiseError(modName//'::'//myName//' - '// &
& '[error 1]')
END IF

CALL SetUserFunctionParam(param=param, name="massDensity", &
& returnType=Scalar, argType=Constant)
CALL func%Initiate(param)
CALL func%Set(scalarValue=1.0_DFP)

CALL obj%Display(msg="SolidMaterial")

CALL FPL_FINALIZE; CALL param%DEALLOCATE()
END PROGRAM main

To initiate an instance of SolidMaterial_ follow the steps give below.

Step 1: Set parameter

First, we call SetSolidMaterialParam method.

CALL SetSolidMaterialParam(param=param, name="SolidMaterial")

Step 2: Initiate

Then, we will call Initiate method.

CALL obj%Initiate(param)

Step 3: Add material

After we have initiated an instance of AbstractMaterial_, we will ADD material to it by calling AddMaterial.

CALL obj%AddMaterial("massDensity")
note

This routine just register a material name and allocate space for defining materal as a UserFunction.

Step 4: Get material pointer

After registering a material, we can get the pointer of UserFunction by calling the method GetMaterialPointer. We should initiate this pointer as described in the documentation of UserFunction.

! Adding a material property
CALL obj%AddMaterial("massDensity")

func => obj%GetMaterialPointer("massDensity")

IF (.NOT. ASSOCIATED(func)) THEN
CALL e%RaiseError(modName//'::'//myName//' - '// &
& '[error 1]')
END IF

CALL SetUserFunctionParam(param=param, name="massDensity", &
& returnType=Scalar, argType=Constant)
CALL func%Initiate(param)
CALL func%Set(scalarValue=1.0_DFP)

Further reading

There is more to SolidMaterial_, and you can learn about them from following pages.

Methods