Field outputs

Relevant module: edelweissfe.utils.fieldoutput

FieldOutputs store all kind of analysis results, and are defined via the keyword *fieldOutput. All fieldOutputs are accessable to all outputmanagers at the end of each increment, step and job. Furthermore, they can be exported to *.csv files at the end of the analysis job.

Attention

If the results are exported to a .csv file with enabled “saveHistory”, the time History is automatically appended to the .csv file”

Options:

Option

Description

name

name of the fieldOutput

nSet|elSet|node|element

entity, for which the fieldOutput is defined

result

e.g., U, P, stress, strain …

quadraturePoint

for element based fieldOutputs only, integers or slices

f(x)

(optional), apply math (in each increment)

saveHistory

(optional), save complete History or only last (increment) result. Default: True (node, element) and False (nSet, elSet)

export

(optional), export the fieldOutput to a file at the end of the job

f_export(x)

(optional), apply math on the final result (table)

Example file: ../../../testfiles/FieldOutput/fieldOutput.inp
*material, name=modleon, id=modleon
30000.0, 0.15 ,13 , 47.4 ,  55   , 4.74 , 0.85 , 0.12 , 0.003, 2.0, 0.000001, 15.0, 0.10, 1

*section, name=section1, thickness=1.0, material=modleon, type=plane
all

*job, name=cps4job, domain=2d, solver=NIST

*modelGenerator, generator=planeRectQuad, name=gen
x0=0, l=50
y0=0, h=100
elType=CPS4
nX=20
nY=20

*fieldOutput,
create=perNode, name=displacement,              nSet=all,           field=displacement, result=U,
create=perNode, name=displacement_top,          nSet=gen_top,       field=displacement, result=U, saveHistory=True
create=perNode, name=displacement_top_mean_1,   nSet=gen_top,       field=displacement, result=U, saveHistory=True, f(x)='mean( x[:,1])'
create=perNode, name=RF_bottom,                 nSet=gen_bottom,    field=displacement, result=P, saveHistory=True
create=perNode, name=RF_bottom_sum_1,           nSet=gen_bottom,    field=displacement, result=P, saveHistory=True, f(x)='sum(x[:,1])'
create=perElement, name=stress,                    elSet=all,          result=stress,      quadraturePoint=1
create=perElement, name=stress_top,                elSet=gen_top,      result=stress,      quadraturePoint=1
create=perElement, name=alphaP,                    elSet=all,          result=alphaP,      quadraturePoint=1

** *output, type=meshPlot,
** figure=1, axSpec=221, create=perNode,       fieldOutput=displacement,       f(x)='x[:,1]', label=U2
** figure=1, axSpec=222, create=perElement,    fieldOutput=stress,             f(x)='x[:,1]', label=S2
** figure=1, axSpec=212, c=red, ls=dashed, create=xyData, x=time, y=RF_bottom, f(y)='sum ( y[:,:,1], axis=1)', label=Sum(RF)

*output, type=ensight, name=myEnsightExport
create=perNode,    fieldOutput=displacement,
create=perElement, fieldOutput=stress,
create=perElement, fieldOutput=alphaP,
configuration, overwrite=yes


*output, type=monitor, name=myNodeMonitor
fieldOutput=RF_bottom, f(x)='sum ( x[:,1] )'

*output, type=plotAlongPath, name=myNodeSetPlotter
figure=2, nSet=gen_top, fieldOutput=RF_bottom, f(x)='x[:,1]', label=P along bottom, normalize=True

*step, maxInc=1e-1, minInc=1e-8, maxNumInc=1000, maxIter=25, stepLength=100
options, category=Ensight, intermediateSaveInterval=2,
options, category=NISTSolver, extrapolation=linear
dirichlet, name=1,          nSet=gen_leftBottom,    field=displacement, 2=0.0, 1=0.0
dirichlet, name=bottom,     nSet=gen_bottom,        field=displacement, 2=0,
nodeforces, name=top,       nSet=gen_top,           field=displacement, 2=-80, f(t)=t**2

Module documentation:

class edelweissfe.utils.fieldoutput.FieldOutputController(model, journal)[source]

The central module for managing field outputs, which can be used by output managers.

Methods

addExpressionFieldOutput(associatedSet, ...)

Add a new FieldOutput entry to be computed during the simulation

addPerElementFieldOutput(name, elSet[, ...])

Add a new FieldOutput entry to be computed during the simulation

addPerNodeFieldOutput(name, nodeField[, ...])

Add a new FieldOutput entry to be computed during the simulation

finalizeIncrement()

Finalize all field outputs at the end of an increment.

finalizeJob()

Finalize all field outputs at the end of a job.

finalizeStep()

Finalize all field outputs at the end of a step.

initializeStep(step)

Initalize an step.

initializeJob

Parameters
addExpressionFieldOutput(associatedSet, theExpression, name, saveHistory=False, f_x=None, export=None, fExport_x=None)[source]

Add a new FieldOutput entry to be computed during the simulation

Parameters
  • associatedSet (set) – The associated set of nodes or elements.

  • theExpression (Callable) – The expression to be evaluated.

  • name (str) – The name of this FieldOutput.

  • saveHistory – Save the complete history or only the last result.

  • f_x (Callable) – Apply a math function on the results.

  • export (str) – Export the results to a file.

  • fExport_x (Callable) – Apply a math function on the results before exporting.

addPerElementFieldOutput(name, elSet, result=None, saveHistory=False, f_x=None, export=None, fExport_x=None, quadraturePoints=typing.Union[int, slice, list[int]])[source]

Add a new FieldOutput entry to be computed during the simulation

Parameters
  • name (str) – The name of this FieldOutput.

  • elSet (ElementSet) – The :class:`ElementSet on which this FieldOutput should operate.

  • result (str) – The name of the result, which is provided by the Elements in the :class:`ElementSet.

  • journal – The :class:`Journal instance for logging purposes.

  • saveHistory – Save the complete history or only the last result.

  • f_x (Callable) – Apply a math function on the results.

  • export (str) – Export the results to a file.

  • fExport_x (Callable) – Apply a math function on the results before exporting.

  • quadraturePoints – The indices of quadrature points for which the results should be extracted.

addPerNodeFieldOutput(name, nodeField, result=None, saveHistory=False, f_x=None, export=None, fExport_x=None)[source]

Add a new FieldOutput entry to be computed during the simulation

Parameters
  • name (str) – The name of this FieldOutput.

  • nodeField (NodeField) – The :class:`NodeField, on which this FieldOutput should operate.

  • result (str) – The name of the result entry in the :class:`NodeField

  • journal – The :class:`Journal instance for logging purposes.

  • saveHistory – Save the complete history or only the last result.

  • f_x (Callable) – Apply a math function on the results.

  • export (str) – Export the results to a file.

  • fExport_x (Callable) – Apply a math function on the results before exporting.

finalizeIncrement()[source]

Finalize all field outputs at the end of an increment.

finalizeJob()[source]

Finalize all field outputs at the end of a job.

finalizeStep()[source]

Finalize all field outputs at the end of a step.

initializeStep(step)[source]

Initalize an step.

Parameters

step – The step information.

class edelweissfe.utils.fieldoutput._FieldOutputBase(name, model, journal, saveHistory=False, f_x=None, export=None, fExport_x=None)[source]

Entity of a fieldOutput request. Carries the history or the latest result.

Parameters
  • name (str) – The name of this FieldOutput.

  • model (FEModel) – A dictionary containing the model tree.

  • journal (Journal) – The journal object for logging.

  • saveHistory (bool) – Save the complete history or only the last result.

  • f_x (Callable) – Apply a math function on the results.

  • export (str) – Export the results to a file.

  • fExport_x (Callable) – Apply a math function on the results before exporting.

Methods

finalizeIncrement()

Finalize an increment, i.e. store the current results.

getLastResult()

Get the last result, no matter if the history is stored or not.

getResultHistory()

Get the history.

getTimeHistory()

Get the time history.

initializeJob()

Initalize everything.

setResults(values)

Modifies a result at it's origin, if possible.

writeLastResult()

Update file output.

finalizeJob

finalizeStep

initializeStep

finalizeIncrement()[source]

Finalize an increment, i.e. store the current results.

getLastResult()[source]

Get the last result, no matter if the history is stored or not.

Returns

The result array.

Return type

np.ndarray

getResultHistory()[source]

Get the history. Throws an exception if the history is not stored.

Returns

The result history.

Return type

np.ndarray

getTimeHistory()[source]

Get the time history.

Returns

The time history.

Return type

np.ndarray

initializeJob()[source]

Initalize everything. Will also update the results based on the proved start time and solution.

setResults(values)[source]

Modifies a result at it’s origin, if possible. Throws an exception if not possible.

Parameters

values (ndarray) – The values.

writeLastResult()[source]

Update file output.

Parameters

model – The model tree.

class edelweissfe.utils.fieldoutput.ElementFieldOutput(name, elSet, resultName, model, journal, saveHistory=False, f_x=None, export=None, fExport_x=None, quadraturePoints=0)[source]

This is a Element based FieldOutput. It operates on ElementSets.

Parameters
  • name (str) – The name of this FieldOutput.

  • elSet (ElementSet) – The ElementSet on which this FieldOutput operates.

  • resultName (str) – The name of the result entry in the :class:`ElementBase.

  • model (FEModel) – The model tree instance.

  • journal (Journal) – The journal object for logging.

  • saveHistory (bool) – Save the complete history or only the last result.

  • f_x (Callable) – Apply a math function on the results.

  • export (str) – Export the results to a file.

  • fExport_x (Callable) – Apply a math function on the results before exporting.

  • quadraturePoints (Union[int, slice, list[int]]) – The list of quadrature points for which the results should be extracted.

Methods

finalizeIncrement()

Finalize an increment, i.e. store the current results.

getLastResult()

Get the last result, no matter if the history is stored or not.

getResultHistory()

Get the history.

getTimeHistory()

Get the time history.

initializeJob()

Initalize everything.

setResults(values)

Modifies a result at it's origin, if possible.

updateResults(model)

Update the field output.

writeLastResult()

Update file output.

finalizeJob

finalizeStep

initializeStep

setResults(values)[source]

Modifies a result at it’s origin, if possible. Throws an exception if not possible.

Parameters

values (ndarray) – The values.

updateResults(model)[source]

Update the field output. Will use the current solution and reaction vector if result is a nodal result.

Parameters

model (FEModel) – The model tree.

class edelweissfe.utils.fieldoutput.NodeFieldOutput(name, nodeField, result, model, journal, saveHistory=False, f_x=None, export=None, fExport_x=None)[source]

This is a Node based FieldOutput. It operates on NodeFields.

Parameters
  • name (str) – The name of this FieldOutput.

  • nodeField – The NodeField, on which this FieldOutput operates.

  • result (str) – The name of the result entry in the NodeField.

  • model (FEModel) – The model tree instance.

  • journal (Journal) – The journal object for logging.

  • saveHistory (bool) – Save the complete history or only the last result.

  • f_x (Callable) – Apply a math function on the results.

  • export (str) – Export the results to a file.

  • fExport_x (Callable) – Apply a math function on the results before exporting.

Methods

finalizeIncrement()

Finalize an increment, i.e. store the current results.

getLastResult()

Get the last result, no matter if the history is stored or not.

getResultHistory()

Get the history.

getTimeHistory()

Get the time history.

initializeJob()

Initalize everything.

setResults(values)

Modifies a result at it's origin, if possible.

updateResults(model)

Update the field output.

writeLastResult()

Update file output.

finalizeJob

finalizeStep

initializeStep

updateResults(model)[source]

Update the field output. Will use the current solution and reaction vector if result is a nodal result.

Parameters

model (FEModel) – The model tree.

class edelweissfe.utils.fieldoutput.ExpressionFieldOutput(associatedSet, theExpression, name, model, journal, saveHistory=False, f_x=None, export=None, fExport_x=None)[source]

This is a Node based FieldOutput. It operates on NodeFields.

Parameters
  • associatedSet (edelweissfe.sets.orderedset.OrderedSet | None) – The associated set of nodes or elements.

  • theExpression – The expression to be evaluated.

  • name (str) – The name of this FieldOutput.

  • nodeField – The NodeField, on which this FieldOutput operates.

  • result – The name of the result entry in the NodeField.

  • model (FEModel) – The model tree instance.

  • journal (Journal) – The journal object for logging.

  • saveHistory (bool) – Save the complete history or only the last result.

  • f_x (Callable) – Apply a math function on the results.

  • export (str) – Export the results to a file.

  • fExport_x (Callable) – Apply a math function on the results before exporting.

Methods

finalizeIncrement()

Finalize an increment, i.e. store the current results.

getLastResult()

Get the last result, no matter if the history is stored or not.

getResultHistory()

Get the history.

getTimeHistory()

Get the time history.

initializeJob()

Initalize everything.

setResults(values)

Modifies a result at it's origin, if possible.

updateResults(model)

Update the field output.

writeLastResult()

Update file output.

finalizeJob

finalizeStep

initializeStep

updateResults(model)[source]

Update the field output. Will use the current solution and reaction vector if result is a nodal result.

Parameters

model (FEModel) – The model tree.