Heterogeneous material such as position-dependent Youngs modulus

Are there examples with position-dependent material parameters, e.g. elasticity or permeability, entered either as function or read in from a mesh file (parameter set as node or element data)?

Naively trying

 18             <constitutive_relation>
 19                 <type>LinearElasticIsotropic</type>
 20                 <youngs_modulus>E</youngs_modulus>
 21                 <poissons_ratio>nu</poissons_ratio>
 22             </constitutive_relation>

134         <parameter>
135             <mesh>cube_hex_domain</mesh>
136             <name>E</name>
137             <type>Function</type>
138             <expression>1.1*(1.0-0.1*z)*300e6</expression>
139         </parameter>

fails

critical: /home/dominik/OGS/ogs/ParameterLib/FunctionParameter.h:120 operator()() 
error: FunctionParameter: The spatial position has to be set by coordinates.

The keyword is MeshElement (for parameters evaluated on elements and MeshNode for parameters evaluated on nodes) which brings some examples, revealing that the variable parameter is then read from the cell data in the domain mesh. In addition to the MaterialID field, there may be further user-defined fields. This is solution A, the variable parameter is defined on a mesh.

Still I wonder, why the above function fails (solution B to enter a variable parameter).

What I would do is defining such data on the mesh beforehand.
I added some functionality to VTUinterface to do that:

Thank you, this is a convenient way to generate the corresponding mesh. As I understand this script it generates an additional mesh with appended function values at the nodes (point data). This conforms to OGS parameter type MeshNode. I am not sure, if OGS can handle element evaluations of node data (at least then needs to be specified how). Starting with your script, I will try to add function values to elements (cell data) of the domain mesh (for use as MeshElement) and report soon about my results. Paraview (Point-to-cell-data filter) can do it, but I prefer a scriptable solution.

OGS can handle meshelements: OGS: [case] MeshElement
VTUinterface can’t handle MeshElements yet, but if you need to code something anyway, I would be gratefull if you can add such a functionality :slight_smile: