Model generators

Model generators are used to create and extend the model. They are used to create the mesh, the material points, the cells, the elements, and sets.

2D generators

edelweissmeshfree.generators.rectangulargridgenerator.generateModelData(model, journal, name='rectangular_grid', x0=0.0, y0=0.0, h=1.0, l=1.0, nX=10, nY=10, firstCellNumber=1, firstNodeNumber=1, cellProvider=<class 'str'>, cellType=<class 'str'>, nodesPerCell=4)[source]

Generate a structured grid of nodes and cells.

Parameters:
  • model (FEModel) – The model to which the grid should be added.

  • journal (Journal) – The journal instance for logging purposes.

  • name (str) – The name of the grid.

  • x0 (float) – The x-coordinate of the origin.

  • y0 (float) – The y-coordinate of the origin.

  • h (float) – The height of the grid.

  • l (float) – The length of the grid.

  • nX (int) – The number of elements along the x-axis.

  • nY (int) – The number of elements along the y-axis.

  • cellProvider (str) – The name of the cell provider class.

  • cellType (str) – The type of the cell.

  • firstNodeNumber (int) – The first node number.

  • nodesPerCell (int) – The number of nodes per cell.

edelweissmeshfree.generators.rectangularbsplinegridgenerator.generateModelData(model, journal, **kwargs)[source]

A mesh generator, for rectangular geometries and structured quad meshes:

    <-----l----->
     nX elements
     __ __ __ __
    |__|__|__|__|  A
    |__|__|__|__|  |
    |__|__|__|__|  | h
    |__|__|__|__|  | nY elements
  | |__|__|__|__|  |
  | |__|__|__|__|  V
x0|_____
  y0

nSets, elSets, surface : ‘name’_top, _bottom, _left, _right, … are automatically generated

Datalines:

edelweissmeshfree.generators.rectangularmpgenerator.generateModelData(model, journal, name='rectangular_grid', x0=0.0, y0=0.0, h=1.0, l=1.0, nX=10, nY=10, firstMPNumber=1, mpProvider=None, mpType=None, thickness=1.0, material=None)[source]

Generate a structured rectangular grid of material points.

Parameters:
  • model (MPMModel) – The model instance.

  • journal (Journal) – The Journal instance for logging purposes.

  • name (str) – The name of the mesh.

  • x0 (float) – The origin at x axis.

  • y0 (float) – The origin at y axis.

  • h (float) – The height of the body.

  • l (float) – The length of the body.

  • nX (int) – The number of material points along x.

  • nY (int) – The number of material points along y.

  • firstMPNumber (int) – The first material point number.

  • mpProvider (str) – The providing class for the MaterialPoint.

  • mpType (str) – The type of MaterialPoint.

  • thickness (float) – The thickness of the material point.

  • material (str) – The material of the material point.

Returns:

The updated model.

Return type:

MPMModel

A mesh generator, for rectangular geometries and structured quad meshes:

    <-----l----->
     nX elements
     __ __ __ __
    |__|__|__|__|  A
    |__|__|__|__|  |
    |__|__|__|__|  | h
    |__|__|__|__|  | nY elements
  | |__|__|__|__|  |
  | |__|__|__|__|  V
x0|_____
  y0

nSets, elSets, surface : ‘name’_top, _bottom, _left, _right, … are automatically generated

Datalines:

edelweissmeshfree.generators.rectangularcellelementgridgenerator.generateModelData(model, journal, **kwargs)[source]

Generate a structured grid of nodes and cells.

Parameters:
  • model (FEModel) – The model to which the grid should be added.

  • journal (Journal) – The journal instance for logging purposes.

  • name (str) – The name of the grid.

  • x0 (float) – The x-coordinate of the origin.

  • y0 (float) – The y-coordinate of the origin.

  • h (float) – The height of the grid.

  • l (float) – The length of the grid.

  • nX (int) – The number of elements along the x-axis.

  • nY (int) – The number of elements along the y-axis.

  • firstNodeNumber (int) – The first node number.

  • nodesPerCell (int) – The number of nodes per cell.

  • mpType (str) – The type of the material point.

  • mpClass (str) – The name of the material point class.

  • thickness (float) – The thickness of the material point.

  • mpNumberStart (int) – The first material point number.

  • cellelementProvider (str) – The name of the cell element provider class.

  • cellelementType (str) – The type of the cell element.

  • material (dict) – The material definition.

3D generators

edelweissmeshfree.generators.boxgridgenerator.generateModelData(model, journal, name='box_grid', x0=0.0, y0=0.0, z0=0.0, h=1.0, l=1.0, d=1.0, nX=10, nY=10, nZ=10, firstNodeNumber=1, cellClass=None, cellType=None, nodesPerCell=8)[source]

Generate a structured box grid of material points.

Parameters:
  • model (MPMModel) – The model instance.

  • journal (Journal) – The Journal instance for logging purposes.

  • name (str) – The name of the mesh.

  • x0 (float) – The origin at x axis.

  • y0 (float) – The origin at y axis.

  • z0 (float) – The origin at z axis.

  • h (float) – The height of the body.

  • l (float) – The length of the body.

  • d (float) – The depth of the body.

  • nX (int) – The number of material points along x.

  • nY (int) – The number of material points along y.

  • nZ (int) – The number of material points along z.

  • firstNodeNumber (int) – The first node number.

  • cellClass (str) – The providing class for the Cell.

  • cellType (str) – The type of Cell.

  • nodesPerCell (int)

Returns:

The updated model.

Return type:

MPMModel

edelweissmeshfree.generators.boxbsplinegridgenerator.generateModelData(model, journal, name='boxgrid', x0=0.0, y0=0.0, z0=0.0, l=1.0, h=1.0, d=1.0, nX=10, nY=10, nZ=10, order=1, firstNodeNumber=1, cellProvider=None, cellType=None)[source]

Generates a B-Spline grid of cells in a box.

Parameters:
  • model (MPMModel) – The model to which the grid will be added.

  • journal (Journal) – The journal instance for logging purposes.

  • name (str) – The name of the grid.

  • x0 (float) – The origin at x axis.

  • y0 (float) – The origin at y axis.

  • z0 (float) – The origin at z axis.

  • l (float) – The length of the box.

  • h (float) – The height of the box.

  • d (float) – The depth of the box.

  • nX (int) – The number of cells in x direction.

  • nY (int) – The number of cells in y direction.

  • nZ (int) – The number of cells in z direction.

  • order (int) – The order of the B-Spline basis functions.

  • firstNodeNumber (int) – The first node number.

  • cellProvider (type) – The providing class for the Cell.

  • cellType (str) – The type of Cell.

Returns:

The model with the added grid.

Return type:

MPMModel

edelweissmeshfree.generators.boxmpgenerator.generateModelData(model, journal, name='box_grid', x0=0.0, y0=0.0, z0=0.0, l=1.0, h=1.0, d=1.0, nX=10, nY=10, nZ=10, firstMaterialPointNumber=1, mpProvider=None, mpType=None, material=None)[source]

Generate a structured box grid of material points.

Parameters:
  • model (MPMModel) – The model instance.

  • journal (Journal) – The Journal instance for logging purposes.

  • name (str) – The name of the mesh.

  • x0 (float) – The origin at x axis.

  • y0 (float) – The origin at y axis.

  • z0 (float) – The origin at z axis.

  • h (float) – The height of the body.

  • l (float) – The length of the body.

  • nX (int) – The number of material points along x.

  • nY (int) – The number of material points along y.

  • nZ (int) – The number of material points along z.

  • firstMaterialPointNumber (int) – The first material point number.

  • mpProvider (str) – The providing class for the MaterialPoint.

  • mpType (str) – The type of MaterialPoint.

  • material (str) – The material of the material point.

  • d (float)

Returns:

The updated model.

Return type:

MPMModel

utitilty generators

edelweissmeshfree.generators.findclosestmp.generateModelData(mpmModel, journal, coordinates, storeIn)[source]

Find the mateiral point closest to a given coordinate and store it in a material point set in the model.

Parameters:
  • mpmModel (MPMModel) – The model instance.

  • journal (Journal) – The Journal instance for logging purposes.

  • coordinates (ndarray) – The coordinates for which the closest material point should be found.

  • storeIn (str) – The name of the material point set, in which the found material point is stored.

Returns:

The updated model.

Return type:

MPMModel