References
In Python, all variables except the most basic ones are references. This means that if a
is an object, b=a
does not copy a
into b
, but means that both a
and b
are references pointing towards the same object.
When defining a test case in Metafor, references can be used to shorten the corresponding module. For example:
geometry = metafor.getDomain().getGeometry()
defines a reference, geometry
, pointing towards the geometry of the domain.
In Metafor documentation, all following references, defined from the basic object metafor
, will be used:
domain = metafor.getDomain() geometry = domain.getGeometry() pointset = geometry.getPointSet() curveset = geometry.getCurveSet() wireset = geometry.getWireSet() surfaceset = geometry.getSurfaceSet() sideset = geometry.getSideSet() skinset = geometry.getSkinSet() volumeset = geometry.getVolumeSet() interactionset = domain.getInteractionSet() mesh = geometry.getMesh() meshpointset = mesh.getPointSet() materialset = domain.getMaterialSet() lawset = domain.getMaterialLawSet() groupset = geometry.getGroupSet() loadingset = domain.getLoadingSet() valuesmanager = metafor.getValuesManager() tsm = metafor.getTimeStepManager() mim = metafor.getMechanicalIterationManager() tim = metafor.getThermalIterationManager() solvermanager = matafor.getSolverManager ...
In the writing of an input file, these references must obviously be defined somewhere, either in the beginning of the module or, better, just before using them.
For instance, the line:
domain.getGeometry().getPointSet().define(1, L, h, 0)
is replaced in this documentation and in the battery by:
pointset.define(1, L, h, 0)