The Mesh is a class which encapsulates Node, Material, Elements, Load, and Constraint objects that defines a finite element model. This object provides several member functions to add/erase/get Node, Material, Element, and Load objects to be used in the Solution Module.
The previous Figure shows an example of a finite element Mesh. The depicted Mesh has Node that are schematically represented by white-solid dots. The Mesh is also constructed with Element such as frame (represented in black-lines) and quadrilateral (represented in blue-rectangles). Each Node has two degree-of-freedom (in blue arrows) or three degree-of-freedom (in red arrows) depending on the element that forms. RESTRAIN
are applied to the Node that belongs to semi-circle boundary in thick-black line. In a similar manner, the connection between frame and quadrilateral elements is performed using Constraint. A point Load is prescribed at Node (1). In addition, several surface Load are prescribed to elements from 1 to 10.
REFERENCE:
The python 01-Pre_Process/Method/Display.py file provides with an interface to show the finite element mesh defined so far. The generated file (with extension .vtu) can be opened using ParaView. The SVL output options defined for POINT and CELL variables are:
The python mesh can be visualized at any level of the scripting process using the renderData() function. Once this function is called, a '.vtu' file will be created inside the Paraview folder.
Example
A ParaView file with name 'output.vtu' is generated as follows:
SVL.renderData('output')
The python 01-Pre_Process/Method/Builder.py file provides with an interface to populate the Entities
dictionary with Node, Material, Element and Constraint. A Domain can be created using the makeDomainVolume(), makeDomainArea() or makeDomainLine() function. These functions will transform the provided information into json format to be parse in the Run-Analysis.
makeDomainVolume(option):
Creates a volume domain in 3D. This function returns a dictionary with the fields 'Nodes' and 'Elements'. The option dictionary specifies the geometry, number of elements, type of elements for this mesh, some fields are:
Example
A 3D rectangular domain of 1 x 1 x 10 [m] with PML3DHexa8 elements is created using the python interface as follows:
opts = {
'ne' : [1, 1, 10],
'class': 'PML3DHexa8',
'ndof' : 9,
'P0' : [0, 0, 0],
'P1' : [1.0, 0, 0],
'P2' : [0, 1.0, 0],
'P3' : [0, 0, 10.0],
'elems': 'HEXA8',
'attributes': {'material': 2, 'n': 2.0, 'L': 10.0, 'R': 1E-5, 'x0': [0.5, 0.5, 10.0], 'npml': [0.0, 0.0, -1.0], 'rule': 'Gauss', 'np': 8}
}
mesh = SVL.makeDomainVolume(options=opts)
makeDomainArea(option):
Creates an are domain in 2D/3D. This function returns a dictionary with the fields 'Nodes' and 'Elements'. The option dictionary specifies the geometry, number of elements, type of elements for this mesh, some fields are:
Example
A 2D rectangular domain of 5 x 10 [m] with Lin2DQuad4 elements is created using the python interface as follows:
opts = {
'ne' : [5, 10],
'class': 'Lin2DQuad4',
'ndof' : 2,
'P0' : [0, 0, 0],
'P1' : [1.0, 0, 0],
'P2' : [0, 1.0, 0],
'elems': 'QUAD4',
'attributes': {'material': 2, 'rule': 'Gauss', 'np': 4}
}
mesh = SVL.makeDomainArea(options=opts)
makeDomainLine(option):
Creates an are domain in 1D/2D/3D. This function returns a dictionary with the fields 'Nodes' and 'Elements'. The option dictionary specifies the geometry, number of elements, type of elements for this mesh, some fields are:
Example
A 2D rectangular domain of 10 [m] with Lin2DFrame2 elements is created using the python interface as follows:
opts = {
'ne' : 10,
'class': 'Lin2DFrame2',
'ndof' : 3,
'P0' : [0, 0, 0],
'P1' : [1.0, 0, 0],
'elems': 'LINE2',
'attributes': {'section': 2, 'rule': 'Gauss', 'np': 5}
}
mesh = SVL.makeDomainArea(options=opts)
The python 01-Pre_Process/Method/Builder.py file also provides with function that allows to mergeDomain(), removeDomain() or setPMLDomain() function. These functions will transform the provided mesh information that can be later transformed into json format to be parse in the Run-Analysis.
mergeDomain(mesh1, mesh2, TOL):
This function essentially merge two domain. This function returns a merged dictionary with the fields 'Nodes' and 'Elements' in mesh1. The function does not merge nodes that are the same in both meshes, it just re-number them so that these are 2 independent meshes. Therefore, kinematic constraints should be applied to those nodes.
'attributes'
'xl': The side half-length in each direction
.
More complex domain can be parsed from other formats. The functions provided in 01-Pre_Process/Parser/Formats.py allows currently to parse from SAP2000, ETABS, and GMSH formats:
parseJSON(filepath):
This function parses a model in JSON (.json) format that is located at filepath. The structure of the JSON file must be consistent to the one defined in Entities
.
Example
A SAP2000 file can be loaded using the python interface as follows:
SVL.parseFile('/path/to/sap/file.s2k','SAP')
The Mesh object is not needed to be parsed since it is created internally as soon as the JSON input file is specified.
RESTRAIN
class since fixed degree of freedom are declared by negative numbers in the free-degree-of-freedom list at each Node.