colored_diagram

Colored diagram of a function over a linear domain (set of 1D elments for example).

class postprocess.xcVtk.colored_diagram.ColoredDiagram(scale, fUnitConv)

Bases: postprocess.xcVtk.vtk_lut_field.LUTField

Colored diagram of a function over a linear domain (set of 1D elements for example).

addDiagramToScene(recordDisplay)

Adds the diagram to de scene

appendDataFromElementEnds(vDir, elem, indxDiagram, value1, value2)

Append to the diagram the data from the element ends as follows:

___—-* value2
value1 *— |

1 +———-+ 2

Parameters:
  • elem – element over which diagram is represented.
  • indxDiagrama – index-counter for the values to insert.
  • value1 – value at the start node.
  • value2 – value at the end node.
appendDataToDiagram(elem, indxDiagrama, v0, v1, defFScale=0.0)

Appends to the diagram the values being passed as parameter.

___—-* value2
value1 *— |

1 +———-+ 2

Parameters:
  • elem – element over which diagram is represented.
  • indxDiagrama – index-counter for the values to insert.
  • v0 – value at the start node.
  • v1 – value at the end node.
  • 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)
creaActorDiagrama()
creaEstrucDatosDiagrama()
creaTramoDiagrama(offset, org, valOrg, dest, valDest)

Crea un tramo de diagrama.

Parameters:
  • offset – index-counter for the values to insert.
  • org – Extremo dorsal del elemento lineal.
  • dest – Extremo frontal del elemento lineal.
  • valOrg – Valor del campo escalar en el extremo dorsal.
  • valDest – Valor del campo escalar en el extremo frontal.
creaTramoDiagramaCambioSigno(offset, org, valOrg, dest, valDest)

Crea un tramo de diagrama en el que la función a representar cambia de signo.

param offset:Offset for the index of the values to insert.
param org:Back end of the 1D element.
param dest:Front end of the 1D element.
param valOrg:Value of the field at the back end.
param valDest:Value of the field at the front end.
creaTramoDiagramaSignoCte(offset, org, valOrg, dest, valDest)

Crea un tramo de diagrama en el que la función a representar no cambia de signo.

Parameters:
  • offset – Offset for the index of the values to insert.
  • org – Back end of the 1D element.
  • dest – Front end of the 1D element.
  • valOrg – Value of the field at the back end.
  • valDest – Value of the field at the front end.
getRaizTramoDiagrama(org, valOrg, dest, valDest)
Calcula la posición de la raíz del diagrama que se define
mediante los siguientes parámetros:

org: Extremo dorsal del elemento lineal.

dest: Extremo frontal del elemento lineal. valOrg: Valor del campo escalar en el extremo dorsal. valDest: Valor del campo escalar en el extremo frontal.

resetEstrucDatosDiagrama()

control_var_diagram

Display of diagrams (forces, moments, …) on linear elements

class postprocess.xcVtk.control_var_diagram.ControlVarDiagram(scaleFactor, fUnitConv, sets, attributeName, component)

Bases: postprocess.xcVtk.colored_diagram.ColoredDiagram

Diagram of control var values (capacity factor values, internal forces values (N,My,Mz,T,Vy,Vz), crack width values,…

Variables:
  • scaleFactor – scale factor for the diagram (can be negative too).
  • fUnitConv – unit conversion factor (i.e N->kN => fUnitConv= 1e-3).
  • sets – list of element sets for which the diagram will be displayed.
  • component – property to be displayed (possible arguments: ‘CF’, ‘N’, ‘My’, ‘Mz’, ‘wk’,…)
Parameters:

attributeName – name of the element’s property that has the control var in it for example as in elem.getProp(attributeName).component.

addDiagram()

Add diagram to the scene

getElementComponentData(elem)

Return the data to use to represent the diagram over the element

Parameters:
  • elem – element to deal with.
  • component – component to show. Valid components are: ‘N’, ‘Qy’, ‘Vy’, ‘Qz’, ‘Vz’, ‘My’, ‘Mz’, ‘T’
getMaxAbsComp()

Return the maximum absolute value of the component. It is used only for calculating auto-scale parameter, so we compare only values of the component in first node of the elements

create_array_set_data

postprocess.xcVtk.create_array_set_data.VtkCreaStrArraySetData(setToDraw, entTypeName, attr)

Creates an array of strings with information associated to the points and cells. Parameters:

setToDraw: set of entities to be displayed entTypeName: type of entities to be displayed

(“pnts”, “lines”, “nodes”, “elementos”)

attr: attribute to be stored in the array

direction_field_data

Data to represent directions (modulus doesn’t matters) field in VTK.

class postprocess.xcVtk.direction_field_data.DirectionFieldData(name, color, numberOfComponents=3, scaleFactor=1.0)

Bases: postprocess.xcVtk.vector_field_data.VectorFieldData

Directions (modulus doesn’t matters) Vectors defined at points.

addToDisplay(recordDisplay)

Adds the direction field to the display.

setupActor()
setupMapper()

element_property_diagram

Diagram display a property defined over linear elements.

class postprocess.xcVtk.element_property_diagram.ElementPropertyDiagram(scaleFactor, fUnitConv, sets, propertyName)

Bases: postprocess.xcVtk.colored_diagram.ColoredDiagram

Diagram of element properties

addDiagram()
appendDataSetToDiagram(eSet, indxDiagrama, defFScale=0.0)

Append property values to diagram . :param eSet: Element set. :param 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)
envelopes = set(['Vz+', 'N+', 'N-', 'Vz-', 'My+', 'T-', 'My-', 'T+', 'Vy+', 'Mz-', 'Vy-', 'Mz+'])

field_base

Graphic representation of fields. Base class

class postprocess.xcVtk.field_base.FieldBase(name, fUnitConv)

Bases: postprocess.xcVtk.vtk_lut_field.LUTField

Scalar field defined at nodes.

linear_load_diagram

Display of loads over linear elements.

class postprocess.xcVtk.linear_load_diagram.LinearLoadDiagram(scale, fUnitConv, loadPatternName, component)

Bases: postprocess.xcVtk.colored_diagram.ColoredDiagram

Draws a load over a linear element (qx,qy,qz,…)

addDiagram(preprocessor)
dumpElementalLoads(preprocessor, lp, indxDiagram)

Iterate over loaded elements dumping its loads into the graphic.

dumpLoads(preprocessor, indxDiagram)
getMaxAbsComp(preprocessor)

Return the maximum absolute value of the component. It is used for calculating auto-scale parameter

load_vector_field

class postprocess.xcVtk.load_vector_field.LoadVectorField(loadPatternName, fUnitConv=0.001, scaleFactor=1.0, showPushing=True, components=[0, 1, 2], multiplyByElementArea=True)

Bases: postprocess.xcVtk.vector_field.VectorField

Draws a load over a points on nodes and on elements.

dumpElementalPositions(preprocessor, lp)

Iterate over cumulated loads dumping them into the graphic.

dumpLoads(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.
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.
getMaxLoad()

Calculate the maximum absolute value of the loads on the vector container.

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

Local axes represented as vectors.

class postprocess.xcVtk.local_axes_vector_field.LocalAxesVectorField(name, scaleFactor=1.0)

Bases: object

Draws the local axes on elements.

addToDisplay(recordDisplay)
dumpPair(centroid, axes)

Dump the pair into the xAxes, yAxes and zAxes objet.

dumpVectors(xcSet)

Iterate over the elements dumping its axes into the graphic.

xColor = [1.0, 0.0, 0.0]
yColor = [0.0, 1.0, 0.0]
zColor = [0.0, 0.0, 1.0]
class postprocess.xcVtk.local_axes_vector_field.QuadSurfacesLocalAxesVectorField(name, scaleFactor=1.0)

Bases: postprocess.xcVtk.local_axes_vector_field.LocalAxesVectorField

Draws the local axes on quadrilateral surfaces.

dumpVectors(xcSet)

Iterate over the surfaces dumping its axes into the graphic.

class postprocess.xcVtk.local_axes_vector_field.StrongWeakAxisVectorField(name, scaleFactor=1.0)

Bases: object

Draws a the strong axis on elements.

addToDisplay(recordDisplay)
dumpVectors(xcSet)

Iterate over loaded elements dumping its axes into the graphic.

strongColor = [1.0, 0.0, 0.0]
weakColor = [0.0, 0.0, 1.0]

node_property_diagram

Diagram to display a property defined at nodes over linear elements.

class postprocess.xcVtk.node_property_diagram.NodePropertyDiagram(scaleFactor, fUnitConv, sets, attributeName)

Bases: postprocess.xcVtk.colored_diagram.ColoredDiagram

Diagram to display a property defined at nodes over linear elements.

addDiagram()
appendDataSetToDiagram(eSet, indxDiagrama, defFScale=0.0)

Append property values to diagram . :param eSet: Element set. :param 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)
getValueForNode(node)

screen_annotation

class postprocess.xcVtk.screen_annotation.ScreenAnnotation

Bases: object

captionWidth = 80
getVtkCornerAnnotation(caption='')
lowerLeft = 0
upperLeft = 2
upperRight = 3

vector_field_data

class postprocess.xcVtk.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.
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)
setupGlyph(fUnitConv=1.0)

vector_field

class postprocess.xcVtk.vector_field.VectorField(name, fUnitConv, scaleFactor, showPushing=True)

Bases: postprocess.xcVtk.field_base.FieldBase

Vector field defined at points.

addToDisplay(recordDisplay, orientation='H')
setupActor()
setupMapper()

vtk_crea_array_set_data

postprocess.xcVtk.vtk_crea_array_set_data.VtkCreaStrArraySetData(preprocessor, setName, entTypeName, nmbArray, data)

Creates an array of character strings with the data of the points defined in the set.

vtk_define_id_filter module

postprocess.xcVtk.vtk_define_id_filter.VtkDefineIdFilter(nmbIdFilter)

vtk_dibuja_prop_cells

postprocess.xcVtk.vtk_dibuja_prop_cells.VtkDibujaPropCells(nmbFilter)

vtk_dibuja_prop_points

postprocess.xcVtk.vtk_dibuja_prop_points.VtkDibujaPropPoints(nmbFilter)

vtk_graphic_base

Display nice images of the model.

class postprocess.xcVtk.vtk_graphic_base.CameraParameters(viewNm='XYZPos', hCamF=1.0)

Bases: object

Provides the parameters to define the camera.

Variables:
  • viewName – name of the view that contains the renderer (defaults to “XYZPos”)
  • viewUpVc – vector defined as [x,y,z] to orient the view. This vector of the model is placed in vertical orientation in the display
  • posCVc – vector defined as [x,y,z] that points to the camera position
  • zoom – (defaults to 1.0)
  • hCamFct – factor that applies to the height of the camera position in order to change perspective of isometric views (defaults to 1, usual values 0.1 to 10)
defineViewParametersFromViewName()

Sets the values of the view parameters from the following predefined viewNames: “ZPos”,”ZNeg”,”YPos”,”YNeg”,”XPos”,”XNeg”,”XYZPos” Zpos: View from positive Z axis (Z+) Zneg: View from negative Z axis (Z-) Ypos: View from positive Y axis (Y+) Yneg: View from negative Y axis (Y-) Xpos: View from positive X axis (X+) Xneg: View from negative X axis (X-) XYZPos or +X+Y+Z: View from point (1,1,1) +X+Y-Z: View from point (1,1,-1) +X-Y+Z: View from point (1,-1,1) +X-Y-Z: View from point (1,-1,-1) -X+Y+Z: View from point (-1,1,1) -X+Y-Z: View from point (-1,1,-1) -X-Y+Z: View from point (-1,-1,1) XYZNeg or -X-Y-Z: View from point (-1,-1,-1)

setView(camera)

Sets the camera parameters.

class postprocess.xcVtk.vtk_graphic_base.RecordDefDisplay

Bases: object

Provides the variables to define the output device.

Variables:
  • renderer – specification of renderer. A renderer is an object that controls the rendering process for objects. Rendering is the process of converting geometry, a specification for lights, and a camera view into an image. (defaults to None)
  • renWin – rendering window (defaults to None). A rendering window is a window in a graphical user interface where renderers draw their images.
  • windowWidth – resolution expresed in pixels in the width direction of the window (defaults to 800)
  • windowHeight – resolution expresed in pixels in the height direction of the window (defaults to 600)
  • cameraParameters – parameters that define the camera position, zoom, etc.
  • bgRComp – red component (defaults to 0.65)
  • bgGComp – green component (defaults to 0.65)
  • bgBComp – blue component (defaults to 0.65)
displayGrid(caption='')

Displays the grid in the output device

Parameters:caption – caption to display with the scene.
displayScene(caption='', fName=None)

Displaying scene

Parameters:
  • caption – caption to display with the scene.
  • fName – name of the image file, in none -> screen window.
muestraEscena()
plot(fName)

Plots window contents

setView()

Sets the view

setupAxes()

Add an vtkAxesActor to the renderer.

setupGrid(xcSet)

Parameters: xcSet: set to be represented

setupWindow(caption='')

sets the rendering window. A rendering window is a window in a graphical user interface where renderers draw their images.

setupWindowInteractor()

sets the window interactor, which provides a platform-independent interaction mechanism for mouse/key/time events.

class postprocess.xcVtk.vtk_graphic_base.RecordDefGrid

Bases: object

Provide the variables involved in the VTK grid representation

Variables:
  • xcSet – set to be represented
  • entToLabel – entities to be labeled (defaults to “nodes”)
  • cellType – specifies the type of data cells (defaults to “nil”). Data cells are simple topological elements like points, lines, polygons and tetrahedra of which visualization data sets are composed.
  • uGrid – unstructure grid (defaults to None). An unstructure grid is a concrete implementation of a vtk data set; represents any combination of any cell types. This includes 0D (e.g. points), 1D (e.g., lines, polylines), 2D (e.g., triangles, polygons), and 3D (e.g., hexahedron, tetrahedron, polyhedron, etc.).
getBND()

Returns the grid boundary

vtk_internal_force_diagram

Display of diagrams (forces, moments, …) on linear elements

class postprocess.xcVtk.vtk_internal_force_diagram.InternalForceDiagram(scale, fUnitConv, sets, component)

Bases: postprocess.xcVtk.colored_diagram.ColoredDiagram

Diagram of internal forces (N,My,Mz,T,Vy,Vz)

addDiagram()
getElementComponentData(elem)

Returns the data to use to represent the diagram over the element

Parameters:
  • elem – element to deal with.
  • component – component to represent:

vtk_load_cells

vtk_load_dblprop_cells

postprocess.xcVtk.vtk_load_dblprop_cells.VtkLoadDblProp(setName, nmbProp, nmbContndr)

vtk_load_strprop_cells

postprocess.xcVtk.vtk_load_strprop_cells.VtkLoadStrPropCells(setName, nmbProp, nmbContndr)

vtk_lut_field

Drawing of diagrams showing a law of internal forces (or any other input) on linear elements

class postprocess.xcVtk.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