Field base¶
Graphic representation of fields. Base class
-
class
postprocess.xcVtk.fields.field_base.
FieldBase
(name, fUnitConv)¶ Bases:
postprocess.xcVtk.fields.vtk_lut_field.LUTField
Base classs for fields.
Vector field data¶
-
class
postprocess.xcVtk.fields.vector_field_data.
VectorFieldData
(name, numberOfComponents=3, scaleFactor=1.0)¶ Bases:
object
Vectors defined at points.
-
calculateLengths
(fUnitConv=1.0)¶ Lengths of the vectors.
Parameters: fUnitConv – unit conversion scale factor i.e. kN -> 1e-3.
-
getLengthsName
()¶ Return a suitable name for the vtkDoubleArray object that contains the vector lengths.
-
getNumberOfTuples
()¶ Return the number of tuples in the VTK double array.
-
getPolydata
(fUnitConv=1.0)¶
-
insertNextPair
(px, py, pz, vx, vy, vz, fUnitConv=1.0, pushing=False)¶ Inserts a point in the collection. Parameters:
px,py,pz: coordinates of the point. vx,vy,vz: coordinates of the vector. pushing: true: arrow ends in the point.
false: arrow starts in the point.
-
insertNextVector
(vx, vy, vz)¶
-
setupGlyph
(fUnitConv=1.0, symType=(vtkmodules.vtkFiltersSources.vtkArrowSource)0x7f50f2e6f520)¶
-
Vector field¶
-
class
postprocess.xcVtk.fields.vector_field.
VectorField
(name, fUnitConv, scaleFactor, showPushing=True, symType=(vtkmodules.vtkFiltersSources.vtkArrowSource)0x7f50f2c5c3a0)¶ Bases:
postprocess.xcVtk.fields.field_base.FieldBase
Vector field defined at points.
-
addToDisplay
(recordDisplay, orientation=1, title=None)¶ Adds the vector field to the display.
Parameters: - orientation – orientation of the scalar bar (1: horizontal, 2: left-vertical, 3 right-vertical) (defaults to horizontal scalar bar)
- title – title to the scalar bar
-
populateFromPairList
(pairList)¶ Adds vector data from the pair list argument.
-
setupActor
()¶
-
setupMapper
()¶
-
Load vector field¶
Loads represented as vectors.
-
class
postprocess.xcVtk.fields.load_vector_field.
LoadOnPoints
(loadPatternName, fUnitConv=0.001, scaleFactor=1.0, showPushing=True, components=[0, 1, 2])¶ Bases:
postprocess.xcVtk.fields.vector_field.VectorField
Draws punctual loads.
-
getMaxLoad
()¶ Calculate the maximum absolute value of the loads on the vector container.
-
-
class
postprocess.xcVtk.fields.load_vector_field.
LoadVectorField
(loadPatternName, setToDisp, fUnitConv=0.001, scaleFactor=1.0, showPushing=True, components=[0, 1, 2], multiplyByElementArea=True)¶ Bases:
postprocess.xcVtk.fields.load_vector_field.LoadOnPoints
Draws a load over a point on nodes and on elements.
-
dumpElementalLoads
(preprocessor, defFScale)¶ Iterate over nodal loads dumping them into the graphic.
Parameters: - preprocessor – preprocessor of the FE problem.
- defFScale – factor to apply to current displacement of nodes so that the display position of each node equals to the initial position plus its displacement multiplied by this factor.
-
dumpElementalPositions
(preprocessor)¶ Iterate over cumulated loads dumping them into the graphic.
-
dumpNodalLoads
(preprocessor, defFScale)¶ Iterate over nodal loads dumping them into the graphic.
Parameters: - preprocessor – preprocessor of the FE problem.
- defFScale – factor to apply to current displacement of nodes so that the display position of each node equals to the initial position plus its displacement multiplied by this factor.
-
dumpNodalPositions
(preprocessor, defFScale)¶ Iterate over loaded nodes dumping its loads into the graphic.
Parameters: defFScale – factor to apply to current displacement of nodes so that the display position of each node equals to the initial position plus its displacement multiplied by this factor.
-
dumpVectors
(preprocessor, defFScale, showElementalLoads=True, showNodalLoads=True)¶ Iterate over loads dumping them into the graphic.
Parameters: - preprocessor – preprocessor of the FE problem.
- defFScale – factor to apply to current displacement of nodes so that the display position of each node equals to the initial position plus its displacement multiplied by this factor.
- showElementalLoads – if true show loads over elements.
- showNodalLoads – if true show loads over nodes.
-
populateLoads
(actLP, showElementalLoads=True, showNodalLoads=True)¶ Populate the vector container with loads from the active load patterns.
Parameters: - actLP – list of active load patterns.
- showElementalLoads – True (default) to add element loads to vector container.
- showNodalLoads – True (default) to add nodal loads to vector container.
-
populateWithElementalLoads
(actLP)¶ - Populate the vector container with elemental loads
- from the load pattern argument.
Parameters: actLP – list of active load patterns.
-
populateWithNodalLoads
(actLP)¶ - Populate the vector container with nodal loads
- from the load pattern argument.
Parameters: actLP – list of active load patterns.
-
sumElementalLoads
(actLP)¶ Iterate over active load patterns and cumulate on elements their elemental loads.
Parameters: actLP – list of active load patterns.
-
sumNodalLoads
(actLP)¶ Iterate over loaded nodes to cumulate their loads.
Parameters: actLP – list of active load patterns
-
Local axes vector field¶
Represent local axes as vectors.
-
class
postprocess.xcVtk.fields.local_axes_vector_field.
LinesLocalAxesVectorField
(name, scaleFactor=1.0)¶ Bases:
postprocess.xcVtk.fields.local_axes_vector_field.LocalAxesVectorField
Draws the local axes on the lines of the multi-block model .
-
dumpVectors
(xcSet)¶ Iterate over the lines and collect it axes.
Parameters: xcSet – set which elements will draw its axes.
-
-
class
postprocess.xcVtk.fields.local_axes_vector_field.
LocalAxesVectorField
(name, scaleFactor=1.0)¶ Bases:
object
Draws the local axes on elements.
-
addToDisplay
(recordDisplay)¶ Appends the axes into the container of things to display.
Parameters: recordDisplay – set of things to display.
-
dumpPair
(centroid, axes)¶ Dump the pair into the xAxes, yAxes and zAxes objets.
Parameters: - centroid – insertion point the axes.
- axes – axes to insert.
-
dumpVectors
(xcSet)¶ Iterate over the elements and collect it axes.
Parameters: xcSet – set which elements will draw its axes.
-
xColor
= [1.0, 0.0, 0.0]¶
-
yColor
= [0.0, 1.0, 0.0]¶
-
zColor
= [0.0, 0.0, 1.0]¶
-
-
class
postprocess.xcVtk.fields.local_axes_vector_field.
StrongWeakAxisVectorField
(name, scaleFactor=1.0)¶ Bases:
object
Draws a the strong axis on elements.
-
addToDisplay
(recordDisplay)¶ Appends the axes into the sets of things to display.
Parameters: recordDisplay – set of things to display.
-
dumpPair
(element)¶ collect the weak and strong axis into the graphic.
Parameters: element – element to compute weak and strong axis from.
-
dumpVectors
(xcSet)¶ Iterate over the elements and collect its strong and weak axes.
Parameters: xcSet – set which elements will draw its axes.
-
strongColor
= [1.0, 0.0, 0.0]¶
-
weakColor
= [0.0, 0.0, 1.0]¶
-
-
class
postprocess.xcVtk.fields.local_axes_vector_field.
SurfacesLocalAxesVectorField
(name, scaleFactor=1.0)¶ Bases:
postprocess.xcVtk.fields.local_axes_vector_field.LocalAxesVectorField
Draws the local axes of the surfaces of the multi-block model.
-
dumpVectors
(xcSet)¶ Iterate over the surfaces and collect it axes.
Parameters: xcSet – set which elements will draw its axes.
-
Linear element field¶
Drawing of diagrams showing a law of internal forces (or any other input) on linear elements
-
class
postprocess.xcVtk.fields.vtk_lut_field.
LUTField
(fUnitConv)¶ Bases:
object
Provides de variables involved in the drawing of a diagram showing a law of internal forces (or any other input) on linear elements
Variables: fUnitConv – units conversion factor - :ivar lookUpTable:object that is used by mapper objects to map scalar values
- into rga (red-green-blue-alpha transparency) color specification or rga into scalar values.
Variables: - scalarBar – legend that indicates to the viewer the correspondence between color value and data value.
- mapper – object that specifies the interface between data and graphic primitives.
- actor – used to represent an entity in a rendering scene. The actor has position, orientation, scaling, a reference to the defining geometry, rendering properties and possibly a texture map.
- valMin – minimum value of the diagram.
- valMax – maximum value of the diagram.
-
creaColorScaleBar
(orientation=1, title=None)¶ Creates the scalar bar that indicates to the viewer the correspondence between color values and data values
Parameters: orientation – 1 for horizontal bar, 2 for left-vertical bar 3 for right-vertical bar(defaults to horizontal)
-
creaLookUpTable
()¶ Creates a lookUpTable, that is an object used by mapper objects to map scalar values into rga (red-green-blue-alpha transparency) color specification or rga into scalar values.
-
creaVertColorScaleBar
()¶ Creates the scalar bar that indicates to the viewer the correspondence between color values and data values
-
initializeMinMax
(value=1e+99)¶ Initialize minimum and maximum values that hopefully will be replaced by the real ones.
-
isValid
()¶
-
updateActorDiagrama
()¶ Updates de actor
-
updateLookUpTable
()¶ Sets the minimum and maximum scalar values for scalar mapping. Scalar values less than minimum and greater than maximum range values are respectively clamped to those minimum and maximum range values
-
updateMinMax
(value)¶
-
updateMinMaxWithinRange
(value, rg)¶ updates the minimum and maximum values of the scalar field forcing these extreme values within the range rg=(vmin,vmax)
All the values less than vmin are represented in blue and those greater than vmax are displayed in red
Direction field data¶
-
class
postprocess.xcVtk.fields.direction_field_data.
DirectionFieldData
(name, color, numberOfComponents=3, scaleFactor=1.0)¶ Bases:
postprocess.xcVtk.fields.vector_field_data.VectorFieldData
Directions (modulus doesn’t matters) Vectors defined at points.
-
addToDisplay
(recordDisplay)¶ Adds the direction field to the display.
-
setupActor
()¶
-
setupMapper
()¶
-
Fields¶
-
class
postprocess.xcVtk.fields.fields.
ExtrapolatedProperty
(name, functionName, xcSet, component=None, fUnitConv=1.0, rgMinMax=None)¶ Bases:
postprocess.xcVtk.fields.fields.ExtrapolatedScalarField
Scalar field defined as property value at nodes.
-
display
(displaySettings, caption='', fileName=None, defFScale=0.0)¶ Display the field.
Parameters: - fileName – name of the graphic file to create (if None -> screen window).
- caption – text to display in the graphic.
-
extrapolate
()¶
-
-
class
postprocess.xcVtk.fields.fields.
ExtrapolatedScalarField
(name, functionName, xcSet, component=None, fUnitConv=1.0, rgMinMax=None)¶ Bases:
postprocess.xcVtk.fields.fields.ScalarField
Scalar field defined at nodes.
Variables: rgMinMax – range (vmin,vmax) with the maximum and minimum values of the scalar field (if any) to be represented. All the values less than vmin are displayed in blue and those greater than vmax in red (defaults to None) -
display
(displaySettings, caption='', fileName=None, defFScale=0.0)¶ Display the scalar field graphic.
Parameters: - fileName – name of the graphic file to create (if None -> screen window).
- caption – text to display in the graphic.
- defFScale – factor to apply to current displacement of nodes so that the display position of each node equals to the initial position plus its displacement multiplied by this factor. (Defaults to 0.0, i.e. display of initial/undeformed shape)
-
-
class
postprocess.xcVtk.fields.fields.
ScalarField
(name, functionName, component=None, fUnitConv=1.0, rgMinMax=None)¶ Bases:
postprocess.xcVtk.fields.field_base.FieldBase
Scalar field defined at nodes.
Variables: rgMinMax – range (vmin,vmax) with the maximum and minimum values of the field to be represented. All the values less than vmin are displayed in blue and those greater than vmax iqn red (defaults to None) -
fillArray
(nodeSet)¶ Creates an vtkDoubleArray filled with the proper values.
-
setupOnGrid
(uGrid)¶
-
setupOnMapper
(gridMapper)¶
-
-
postprocess.xcVtk.fields.fields.
getScalarFieldFromControlVar
(attributeName, argument, xcSet, component, fUnitConv, rgMinMax)¶ - return an scalar field that represents the control var over the
- elements in the set.
Parameters: - attributeName – name of the element’s property that has the control var in it for example as in elem.getProp(attributeName).eval(argument).
- argument – name of the control var to represent.
- xcSet – represent the field over those elements.
- component – component of the control var to represent.
- fUnitConv – unit conversion factor (i.e N->kN => fUnitConv= 1e-3).