Field base¶
Graphic representation of fields. Base class
- class postprocess.xcVtk.fields.field_base.FieldBase(name, fUnitConv)¶
 Bases:
postprocess.xcVtk.fields.vtk_lut_field.LUTFieldBase classs for fields.
- Variables
 name – field name.
Vector field data¶
- class postprocess.xcVtk.fields.vector_field_data.VectorFieldData(name, numberOfComponents=3, scaleFactor=1.0)¶
 Bases:
objectVectors defined at points.
- Variables
 name – name to identify VTK arrays related to this object.
scaleFactor – scale factor for the length of the vectors.
points – VTK data structure for points.
vectors – VTK data structure for vectors.
vectorsName – name to identify VTK arrays related to this object vectors.
- 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=(vtkFiltersSourcesPython.vtkArrowSource)0x7976ae26ff40)¶
 
Vector field¶
Field vector over points
- class postprocess.xcVtk.fields.vector_field.VectorField(name, fUnitConv, scaleFactor, showPushing=True, symType=(vtkFiltersSourcesPython.vtkArrowSource)0x7976ae2a23e0)¶
 Bases:
postprocess.xcVtk.fields.field_base.FieldBaseVector field defined at points.
- Variables
 data – vector field data.
showPushing – if true the loads ares showed pushing the loaded point (as oppssed to pull). Default: True.
symType – shape of the symbol (defaults to an arrow).
- 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 of the scalar bar
- populateFromPairList(pairList)¶
 - Adds vector data from the pair list
 argument.
- Parameters
 pairList – list pairs (position, vector).
- setupActor()¶
 
- setupMapper()¶
 
- postprocess.xcVtk.fields.vector_field.get_disp_and_rotation_vector_fields(dispFieldName, dispPairs, rotationFieldName, rotationPairs, fUnitConv, scaleFactor, showPushing=False)¶
 - Creates two vector fields representing the displacements and the
 rotations corresponding to the given data.
- Parameters
 dispFieldName – name of the disp field.
dispPairs – list of pairs (position, disp vector).
rotationFieldName – name of the rotation field.
rotationPairs – list of pairs (position, rotation vector).
fUnitConv – unit conversion factor.
scaleFactor – scale factor for the size of the vectors.
showPushing – if true the loads ares showed pushing the loaded point (as oppssed to pull). Default: True.
- postprocess.xcVtk.fields.vector_field.get_double_headed_arrow()¶
 Create a double headed arrow that can be set as source connection for a glyph.
- postprocess.xcVtk.fields.vector_field.get_force_and_torque_vector_fields(forceFieldName, forcePairs, torqueFieldName, torquePairs, fUnitConv, scaleFactor, showPushing=True)¶
 - Creates two vector fields representing the forces and the moment
 corresponding to the given data.
- Parameters
 forceFieldName – name of the force field.
forcePairs – list of pairs (position, force vector).
torqueFieldName – name of the torque field.
torquePairs – list of pairs (position, torque vector).
fUnitConv – unit conversion factor.
scaleFactor – scale factor for the size of the vectors.
showPushing – if true the loads ares showed pushing the loaded point (as oppssed to pull). Default: True.
Load vector field¶
Loads represented as vectors.
- class postprocess.xcVtk.fields.load_vector_field.LoadOnPoints(name, fUnitConv=0.001, scaleFactor=1.0, showPushing=True, components=[0, 1, 2], symType=(vtkFiltersSourcesPython.vtkArrowSource)0x7976ae2a2c20)¶
 Bases:
postprocess.xcVtk.fields.vector_field.VectorFieldDraws punctual loads.
- Variables
 components – index of the components of the load. Default: [0,1,2]
- getMaxLoad()¶
 Calculate the maximum absolute value of the loads on the vector container.
- class postprocess.xcVtk.fields.load_vector_field.LoadVectorField(name, setToDisp, fUnitConv=0.001, scaleFactor=1.0, showPushing=True, components=[0, 1, 2], multiplyByElementSize=True, symType=(vtkFiltersSourcesPython.vtkArrowSource)0x7976ae2a2bc0)¶
 Bases:
postprocess.xcVtk.fields.load_vector_field.LoadOnPointsDraws an arrow representing a punctual load on nodes and on elements.
- Variables
 multiplyByElementSize – if true multiply the load value by the element size (length or area or volume).
setToDisp – set to display the loads on.
- dumpElementalLoads(preprocessor, defFScale)¶
 Iterate over elemental 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.
- Parameters
 preprocessor – preprocessor of the FE problem.
- 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.
- sumElementalUniformLoads(actLP)¶
 - Iterate over active load patterns and cumulate on elements
 their elemental uniform 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
- class postprocess.xcVtk.fields.load_vector_field.TorqueVectorField(name, setToDisp, fUnitConv=0.001, scaleFactor=1.0, showPushing=True, components=[3, 4, 5], multiplyByElementSize=False, symType=(vtkFiltersCorePython.vtkCleanPolyData)0x7976ae2a2f20)¶
 Bases:
postprocess.xcVtk.fields.load_vector_field.LoadVectorFieldDraws an torque-arrow representing a torque moment on nodes.
- postprocess.xcVtk.fields.load_vector_field.get_active_load_patterns(preprocessor)¶
 Return the load patterns currently active in the domain.
- Parameters
 preprocessor – preprocessor of the FE problem.
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.LocalAxesVectorFieldDraws 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:
objectDraws 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:
objectDraws 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.LocalAxesVectorFieldDraws 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:
objectProvides 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
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.
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)
title – title of the new scale bar.
- creaVertColorScaleBar()¶
 Creates the scalar bar that indicates to the viewer the correspondence between color values and data values
- createLookUpTable()¶
 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.
- getScalarBarTitle()¶
 Return the title of the field scale bar.
- initializeMinMax(value=1e+99)¶
 Initialize minimum and maximum values that hopefully will be replaced by the real ones.
- rangeIsValid()¶
 
- setScalarBarTitle(scalarBarTitle)¶
 Set the title of the scale bar.
- Parameters
 scalarBarTitle – title for the field scale bar.
- updateDiagramActor()¶
 Updates the diagram actor scalar range.
- 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)¶
 Update the minimum and maximum values of the field.
- Parameters
 value – value to update the range with.
- 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
- Parameters
 value – value to update the range with.
rg – range to force.
Direction field data¶
Data to represent directions (modulus doesn’t matters) field in VTK.
- class postprocess.xcVtk.fields.direction_field_data.DirectionFieldData(name, color, numberOfComponents=3, scaleFactor=1.0)¶
 Bases:
postprocess.xcVtk.fields.vector_field_data.VectorFieldDataDirections (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.ExtrapolatedScalarFieldScalar field defined as property value at nodes.
- display(displaySettings, caption='', unitDescription='', 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.
unitDescription – description of the units.
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)
- extrapolate()¶
 
- class postprocess.xcVtk.fields.fields.ExtrapolatedScalarField(name, functionName, xcSet, component=None, fUnitConv=1.0, rgMinMax=None)¶
 Bases:
postprocess.xcVtk.fields.fields.ScalarFieldScalar field defined at nodes.
- display(displaySettings, caption='', unitDescription='', 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.
unitDescription – description of the units.
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.FieldBaseScalar 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)
- getPropertyName()¶
 Return the name of the property that will store the field values.
- setupOnGrid(uGrid)¶
 
- setupOnMapper(gridMapper)¶
 
- postprocess.xcVtk.fields.fields.get_scalar_field_from_control_var(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).
rgMinMax – range (vmin,vmax) with the maximum and minimum values of the scalar field (if any) to be represented (in units of calculation, not units of display). All the values less than vmin are displayed in blue and those greater than vmax in red (defaults to None)