Models

Model are the core of the MPM simulation. They hold information about the domain (cells, material points), the materials, the sets, etc.

MPMModel class

class edelweissmeshfree.models.mpmmodel.MPMModel(dimension)[source]

This is is a standard mpm model tree. It takes care of the correct number of variables, for nodes and scalar degrees of freedom, and it manages the fields.

Parameters:

dimension (int) – The dimension of the model.

Methods

advanceToTime(time)

Accept the current state of the model and sub instances, and set the new time.

getActiveSubModel()

For many applications only a part of the model is active.

makePrettyTableSummary()

Create a pretty table with a summary of the model properties.

prepareYourself(journal)

Prepare the model for a simulation.

readRestart(restartFile)

Read the state of the model from a restart file.

writeRestart(restartFile)

Write the current state of the model to a restart file.

goToPreviousTimeStep

_createAndAssignScalarVariableForConstraints(journal)

Create ScalarVariables for constraints.

Parameters:

journal (Journal) – The journal intance.

_createNodeFieldsFromNodes(nodes, nodeSets)[source]

Bundle nodal FieldVariables together in contiguous NodeFields.

Parameters:
  • nodes (list) – The list of Nodes from which the NodeFields should be created.

  • nodeSets (list) – The list of NodeSets, which should be considered in the index map of the NodeFields.

Returns:

The dictionary containing the NodeField instances for every active field.

Return type:

dict[str,NodeField]

_linkFieldVariableObjects(nodes)

Link NodeFields to individual FieldVariable objects.

Parameters:

nodes – Nodes to be linked

_populateNodeFieldVariablesFromCellElements()[source]

Creates FieldVariables on Nodes depending on the all MaterialPointCells .

_populateNodeFieldVariablesFromCells()[source]

Creates FieldVariables on Nodes depending on the all MaterialPointCells .

_populateNodeFieldVariablesFromConstraints()

Creates FieldVariables on Nodes depending on the all constraints.

_populateNodeFieldVariablesFromElements()

Creates FieldVariables on Nodes depending on the all elements.

_populateNodeFieldVariablesFromParticleKernelDomains()[source]

Creates FieldVariables on Nodes depending on the all defined particle-kernel interactions. For particles and kernels, the situation is a bit more complicated compared to elements or cells: Unlike for elements or cells, there is no direct connection between a particle and a node. Hence, the fields on the nodes are not necessarily known at the beginning of simulation.

For this reason, we force the user to tell us which particles (which have fields) are interacting with which kernelfunctions during the simulation.

_prepareElements(journal)

Prepare elements for a simulation. In detail, sections are assigned.

Parameters:

journal (Journal) – The journal instance.

_prepareMaterialPoints(journal)[source]

Prepare elements for a simulation. In detail, sections are assigned.

Parameters:

journal (Journal) – The journal instance.

_prepareParticles(journal)[source]

Prepare elements for a simulation. In detail, sections are assigned.

Parameters:

journal (Journal) – The journal instance.

_prepareVariablesAndFields(journal)[source]

Prepare all variables and fields for a simulation.

Parameters:

journal – The journal instance.

_requestAdditionalScalarVariable(name)

Create a new scalar variables

Parameters:

name (str) – The name of the variable.

Returns:

The instance of the variable.

Return type:

ScalarVariable

advanceToTime(time)[source]

Accept the current state of the model and sub instances, and set the new time.

Parameters:

time (float) – The new time.

getActiveSubModel()[source]

For many applications only a part of the model is active. For instance, in MPM simulations only cells occupied by material points are active. In order to create a numerical model, we need to know which part of the model is active, and which is not. This function returns the active sub model, based on the current state of the model.

Returns:

The active sub model.

Return type:

MPMModel

makePrettyTableSummary()[source]

Create a pretty table with a summary of the model properties.

prepareYourself(journal)[source]

Prepare the model for a simulation. Creates the variables, bundles the fields, and initializes elements.

Parameters:

journal (Journal) – The journal instance.

readRestart(restartFile)[source]

Read the state of the model from a restart file.

Parameters:
  • fileName – The name of the restart file.

  • restartFile (File)

writeRestart(restartFile)[source]

Write the current state of the model to a restart file.

Parameters:
  • fileName – The name of the restart file.

  • restartFile (File)

additionalParameters

Additional information.

analyticalFields

AnalyticalFields in the model.

cellElementSets

The collection of CellElementSets in the present model.

cellElements

The collection of CellElements in the present model.

cellSets

The collection of CellSets in the present model.

cells

The collection of Cells in the present model.

constraintSets

ConstraintsSets in the model.

constraints

Constraints in the model.

domainSize

Spatial dimension of the model

elementSets

ElementSets in the model.

elements

Elements in the model.

materialPointSets

The collection of MaterialPointSets in the present model.

materialPoints

The collection of MaterialPoints in the present model.

materials

Materials in the model.

meshfreeKernelFunctions

The collection of MeshfreeKernelFunctions in the present model.

nodeFields

NodeFields in the model.

nodeSets

NodeSets in the model.

nodes

Nodes in the model.

particleKernelDomains

The collection of ParticleKernelDomains in the present model.

particleSets

The collection of ParticleSets in the present model.

particles

The collection of Particles in the present model.

scalarVariables

ScalarVariables in the model.

sections

Sections in the model.

surfaces

Surface definitions in the model.

time

Current time of the model.

vertexSets

The collection of VertexSets for per particle in the present model.