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

Scalar field defined at nodes.

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()
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)
<<<<<<< HEAD setupGlyph(fUnitConv=1.0, symType=(vtkArrowSource)0x7f48597ac6b0)
======= setupGlyph(fUnitConv=1.0, symType=(vtkArrowSource)0x7fa815a3b2f0) >>>>>>> f8d913498709cabc2c07b5cd148d8f30e04b8dd4

Vector field

<<<<<<< HEAD class postprocess.xcVtk.fields.vector_field.VectorField(name, fUnitConv, scaleFactor, showPushing=True, symType=(vtkArrowSource)0x7f484a86d9b0)
======= class postprocess.xcVtk.fields.vector_field.VectorField(name, fUnitConv, scaleFactor, showPushing=True, symType=(vtkArrowSource)0x7fa7eece8350) >>>>>>> f8d913498709cabc2c07b5cd148d8f30e04b8dd4

Bases: postprocess.xcVtk.fields.field_base.FieldBase

Vector field defined at points.

addToDisplay(recordDisplay, orientation='H')
populateFromPairList(pairList)

Adds vector data from the pair list argument.

setupActor()
setupMapper()

Load vector field

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.

dumpElementalPositions(preprocessor, lp)

Iterate over cumulated loads dumping them into the graphic.

dumpNodalLoads(preprocessor, defFScale)

Iterate over nodal loads dumping them into the graphic.

Parameters:
  • lp – load pattern
  • 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, lp, defFScale)

Iterate over loaded nodes dumping its loads into the graphic.

Parameters:
  • lp – load pattern
  • 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:
  • lp – load pattern
  • 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(preprocessor, lp, showElementalLoads=True, showNodalLoads=True)

Populate the vector container with loads from the load pattern argument.

populateWithElementalLoads(preprocessor, lp)

Populate the vector container with elemental loads from the load pattern argument.

populateWithNodalLoads(preprocessor, lp)

Populate the vector container with nodal loads from the load pattern argument.

sumElementalLoads(preprocessor, lp)

Iterate over loaded elements and cumulate their loads.

sumNodalLoads(preprocessor, lp)

Iterate over loaded nodes to cumulate their loads.

Parameters:lp – load pattern

Local axes vector field

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.QuadSurfacesLocalAxesVectorField(name, scaleFactor=1.0)

Bases: postprocess.xcVtk.fields.local_axes_vector_field.LocalAxesVectorField

Draws the local axes on quadrilateral 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.
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]

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='H')

Creates the scalar bar that indicates to the viewer the correspondence between color values and data values

Parameters:orientation – ‘H’ for horizontal bar, ‘V’ for vertical bar (defaults to ‘H’)
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).