Predefined spaces

model.predefined_spaces.ConstraintsForLineExtremeNodes(lineSet, constraint)

Apply constraint on the extreme nodes of a model line.

model.predefined_spaces.ConstraintsForLineInteriorNodes(lineSet, constraint)

Apply constraint on the interior nodes of a model line.

class model.predefined_spaces.PredefinedSpace(nodes, dimSpace, numDOFs)

Bases: object

activateElements(elemSet)

Activate the (previoulsy deactivated) elements on the set argument.

Parameters:
  • elemSet – set of elements to be deactivated.
  • srf – stress reduction factor for element deactivation.
addLoadCaseToDomain(loadCaseName)

Add the load case argument (load pattern or combination) to the domain.

Parameters:loadCaseName – name of the load pattern or combination.
addNewLoadCaseToDomain(loadCaseName, loadCaseExpression)

Defines a new combination and add it to the domain.

Parameters:
  • loadCaseName – name of the load pattern or combination.
  • loadCaseExpression – expression that defines de load case as a combination of previously defined actions e.g. ‘1.0*GselfWeight+1.0*GearthPress’
analyze(numSteps=1, calculateNodalReactions=False, includeInertia=False)
Triggers the analysis of the model with a simple static linear
solution.
Parameters:
  • numSteps – number of analysis steps.
  • calculateNodalReactions – if true calculate reactions at nodes.
  • includeInertia – if true calculate reactions including inertia effects.
computeValuesAtNodes(setToCompute, propToDefine='stress')
Extrapolate the stresses to the nodes of the set argument and
stores them in the property “propToDefine”.
Parameters:
  • setToDefine – set of elements to be processed.
  • propToDefine – name of the property to define at the nodes.
createSelfWeightLoad(xcSet, gravityVector)

Creates the self-weight load on the elements.

Parameters:xcSet – set with the lines to load.
deactivateElements(elemSet, srf=1e-06)

Deactivate the elements on the set argument.

Parameters:
  • elemSet – set of elements to be deactivated.
  • srf – stress reduction factor for element deactivation.
getDisplacementFileHeader()

Return the string header for the file with the displacements.

<<<<<<< HEAD
getElements(tags)

Return the elements that correspond to the argument tags.

======= >>>>>>> f8d913498709cabc2c07b5cd148d8f30e04b8dd4
getIntForceComponentFromName(componentName)
getMaterialHandler()

Return the preprocessor material handler.

getMaterialNames()

Return the names of the materials.

getNearestPoint(pos3d)

Return the nearest point to the position argument.

getNodeHandler()

Return the preprocessor node handler.

<<<<<<< HEAD
getNodes(tags)

Return the nodes that correspond to the argument tags.

======= >>>>>>> f8d913498709cabc2c07b5cd148d8f30e04b8dd4
getProblem()

Return the XC finite element problem object.

getSpaceDimension()

Return the dimensions of the problem space.

getTotalSet()

Return the set that contains all the defined entities.

getValuesAtNodes(element, code)

Return the values corresponding to code at each of the element nodes.

Parameters:
  • element – element which the stresses at its nodes will be calculated.
  • code – magnitude to return (stress, strain,…).
illConditioningAnalysis(numModes=1)

Perform an ill-conditioning analysis on the finite element model.

Parameters:numModes – number of ill-conditioned modes to obtain.
newEqualDOF(nodeTagA, nodeTagB, dofs)

Create an equal DOF constraint between the nodes.

Parameters:
  • nodeTagA – tag of the master node.
  • nodeTagB – tag of the slave node.
  • dofs – degrees of freedom to be glued (e.g.: dofs=xc.ID([0,3,6]) means to equal ux,uz,rotz)
removeAllLoadPatternsFromDomain()

Remove all load patterns from domain.

removeLoadCaseFromDomain(loadCaseName)

Add the load case argument (load pattern or combination) to the domain.

Parameters:loadCaseName – name of the load pattern or combination.
revertToStart()

Revert the domain to its initial state..

setBearing(iNod, bearingMaterialNames, orientation=None)

Modelize a bearing on X, XY or XYZ directions.

Parameters:
  • iNod – (int) node identifier (tag).
  • (list) (bearingMaterialNames) – (list) material names for the zero length element [mat1,mat2,mat3,mat4,mat5,mat6], where: mat1,mat2,mat3 correspond to translations along local x,y,z axes, respectively, mat3,mat4,mat5 correspond to rotation about local x,y,z axes, respectively.
  • orientation
    (list) of two vectors [x,yp] used to orient
    the zero length element, where: - x: are the vector components in global coordinates defining
    local x-axis (optional)
    • yp: vector components in global coordinates defining a vector
      that lies in the local x-y plane of the element(optional).

    If the optional orientation vector are not specified, the local element axes coincide with the global axes. Otherwise, the local z-axis is defined by the cross product between the vectors x and yp specified in the command line.

Return rtype:

(int, int) new node tag, new element tag.

setBearingBetweenNodes(iNodA, iNodB, bearingMaterialNames, orientation=None)

Modelize a bearing between the nodes

Parameters:
  • iNodA – (int) first node identifier (tag).
  • iNodB – (int) second node identifier (tag).
  • bearingMaterialNames – (list) material names for the zero length element [mat1,mat2,mat3,mat4,mat5,mat6], where: mat1,mat2,mat3 correspond to translations along local x,y,z axes, respectively, mat3,mat4,mat5 correspond to rotation about local x,y,z axes, respectively.
  • orientation
    (list) of two vectors [x,yp] used to orient
    the zero length element, where: x: are the vector components in global coordinates defining
    local x-axis (optional)
    yp: vector components in global coordinates defining a vector
    that lies in the local x-y plane of the element(optional).

    If the optional orientation vector are not specified, the local element axes coincide with the global axes. Otherwise, the local z-axis is defined by the cross product between the vectors x and yp specified in the command line. :return: newly created zero length element that represents the bearing.

setBearingOnX(iNod, bearingMaterial)

Modelize a bearing on X direction.

Parameters:
  • (int) (iNod) – node identifier (tag).
  • (string) (bearingMaterial) – material name for the zero length element.
setBearingOnXYRigZ(iNod, bearingMaterialNames)

Modelize a non rigid on X and Y directions and rigid on Z bearing.

Parameters:
  • (int) (iNod) – node identifier (tag).
  • (string) (bearingMaterialNames) – material names for the zero length element.
setFulcrumBetweenNodes(nodeTagA, pivotNode)

Create a fulcrum between the nodes passed as parameters.

Creates a rigid link between the nodes. It’s called fulcrum because it’s pinned on pivotNode.

Parameters:
  • nodeTagA – tag of the master node.
  • nodeTagB – tag of the pivot (slave node).
  • dofs – degrees of freedom to be glued (e.g.: dofs=xc.ID([0,3,6]) means to equal ux,uz,rotz)
setIntersection(setName, setsToIntersect)
Return a set that contains the union of the
arguments.
Parameters:
  • setName – name of the set to create. If ‘auto’ then assign a random (unique) name.
  • setsToSum – sets to sum in a list.
setPreprocessor(preprocessor)

Sets suitable values for the members from the dimension of the space and the number of DOFs for each node obtained from the argument.

Parameters:preprocessor – preprocessor of the finite element problem.
setPrescribedDisplacements(nodeTag, prescDisplacements)

Prescribe displacement for node DOFs.

Parameters:
  • nodeTag – tag of the node.
  • prescDisplacements – (list) values of the displacements.
setRigidBeamBetweenNodes(nodeTagA, nodeTagB)

Create a rigid beam between the nodes passed as parameters.

Parameters:
  • nodeTagA – tag of the master node.
  • nodeTagB – tag of the slave node.
setRigidRodBetweenNodes(nodeTagA, nodeTagB)

Create a rigid rod between the nodes passed as parameters.

Parameters:
  • nodeTagA – tag of the master node.
  • nodeTagB – tag of the slave node.
setSum(setName, setsToSum)
Return a set that contains the union of the
arguments.
Parameters:
  • setName – name of the set to create. If ‘auto’ then assign a random (unique) name.
  • setsToSum – sets to sum in a list.
setUniaxialBearing2D(iNod, bearingMaterial, direction)

Modelize an uniaxial bearing on the defined direction.

Parameters:
  • (int) (iNod) – node identifier (tag).
  • (str) (bearingMaterial) –
    material name for the zero length
    element.
    return rtype:(int, int) new node tag, new element tag.
zeroEnergyModes(numModes=1)

Obtains the zero energy modes of the finite element model.

Parameters:numModes – number of zero energy modes to obtain.
class model.predefined_spaces.SolidMechanics2D(nodes)

Bases: model.predefined_spaces.PredefinedSpace

fixNode00(nodeTag)

Restrain all three node DOFs (i. e. make them zero).

Parameters:nodeTag – node identifier.
fixNode0F(nodeTag)

Restrain only displacement DOFs (i. e. Ux= 0 and Uy= 0).

Parameters:nodeTag – node identifier.
fixNodeF0(nodeTag)

Restrain only displacement DOFs (i. e. Ux= 0 and Uy= 0).

Parameters:nodeTag – node identifier.
getDispComponentFromName(compName)

Return the component index from the displacement name.

getDisplacementComponentsLabels()

Return a list with the labels of the displacement components.

getDisplacementDOFs()

Return the indices of the displacement DOFs.

getDisplacementVector(nodeTag)

Return a vector with the displacement components of the node motion.

getRotationalDOFs()

Return the indices of the rotational DOFs.

getStrainComponentFromName(compName)

Return the component index from the strain name.

getStressComponentFromName(compName)

Return the component index from the stress name.

class model.predefined_spaces.SolidMechanics3D(nodes)

Bases: model.predefined_spaces.PredefinedSpace

fixNode(DOFpattern, nodeTag)

Restrain DOF of a node according to the DOFpattern, which is a given string of type ‘0FF’ that matches the DOFs (uX,uY,uZ) where ‘F’ means FREE and ‘0’ means constrained with value=0 Note: DOFpaterns ‘0FF’,‘0_FF’, … are equivalent

Parameters:nodeTag – node identifier.
fixNode000(nodeTag)

Restrain all three node DOFs (i. e. make them zero).

Parameters:nodeTag – node identifier.
getDispComponentFromName(compName)

Return the component index from the displacement name.

getDisplacementComponentsLabels()

Return a list with the labels of the displacement components.

getDisplacementDOFs()

Return the indices of the displacement DOFs.

getDisplacementVector(nodeTag)

Return a vector with the displacement components of the node motion.

Parameters:nodeTag – node identifier.
getRotationalDOFs()

Return the indices of the rotational DOFs.

getStrainComponentFromName(compName)

Return the component index from the strain name.

getStressComponentFromName(compName)

Return the component index from the stress name.

class model.predefined_spaces.StructuralMechanics(nodes, dimSpace, numDOFs)

Bases: model.predefined_spaces.PredefinedSpace

Structural mechanics finite element problem.

createElasticBeams(xcSet, crossSection, trf, xzVector=None, nDiv=4)
Meshes the lines of the set argument with ElasticBeam3d
elements.
Parameters:
  • xcSet – set with the lines to mesh.
  • trf – coordinate transformation to assign to the elements.
  • xzVector – vector defining transformation XZ plane.
  • crossSection – object that defines the geometry of the element section.
  • nDiv – number of divisions on each line.
createTrusses(xcSet, material, area, crossSection=None, corotational=False)
Meshes the lines of the set argument with Truss
elements.
Parameters:
  • xcSet – set with the lines to mesh.
  • material – material to assign to the elements.
  • area – area to assign to the elements.
  • crossSection – object that defines the geometry of the element section.
  • corotational – if true, use corotational formulation.
getSuitableXZVector(iNode, jNode)
Return a vector that can be used to define
a coordinate transformation for an element between the node arguments.
Parameters:
  • iNode – first node.
  • jNode – second node.
class model.predefined_spaces.StructuralMechanics2D(nodes)

Bases: model.predefined_spaces.StructuralMechanics

fixNode000(nodeTag)

Restrain all three node DOFs (i. e. make them zero).

Parameters:nodeTag – node identifier.
fixNode00F(nodeTag)

Restrain only displacement DOFs (i. e. Ux= 0 and Uy= 0).

Parameters:nodeTag – node identifier.
fixNode0F0(nodeTag)

Restrain all three node DOFs (i. e. make them zero).

Parameters:nodeTag – node identifier.
fixNode0FF(nodeTag)

Restrain only X displacement DOF (i. e. Ux= 0).

Parameters:nodeTag – node identifier.
fixNodeF0F(nodeTag)

Restrain only Y displacement DOF (i. e. Uy= 0).

Parameters:nodeTag – node identifier.
fixNodeFF0(nodeTag)

Restrain only rotation DOF (i. e. Theta= 0).

Parameters:nodeTag – node identifier.
fixNodesLine(line)

Restrain all DOFs of the line nodes.

getDispComponentFromName(compName)

Return the component index from the displacement name.

getDisplacementComponentsLabels()

Return a list with the labels of the displacement components.

getDisplacementDOFs()

Return the indices of the displacement DOFs.

getDisplacementVector(nodeTag)

Return a vector with the displacement components of the node motion.

getRotationalDOFs()

Return the indices of the rotational DOFs.

getStrainComponentFromName(compName)

Return the component index from the generalized strain name.

getStressComponentFromName(compName)

Return the component index from the stress name.

newCorotCrdTransf(trfName)

Creates a new 2D corotational transformation.

Parameters:trfName – name for the new transformation.
newLinearCrdTransf(trfName)

Creates a new 2D linear transformation.

Parameters:trfName – name for the new transformation.
newPDeltaCrdTransf(trfName)

Creates a new 2D PDelta transformation.

Parameters:trfName – name for the new transformation.
class model.predefined_spaces.StructuralMechanics3D(nodes)

Bases: model.predefined_spaces.StructuralMechanics

LstNodes6DOFConstr(lstNodes, constrCond)

Constraint the nodes in the list passed as parameter according to given 6-values set of constraints conditions

Parameters:
  • lstNodes – list of nodes to which apply the constraints
  • constrCond
    list of constraint conditions, expressed as
    [uX, uY, uZ,rotX, rotY, rotZ], where:
    • uX, uY, uZ: translations in the X, Y and Z directions;
    • rotX, rotY, rotZ: rotations about the X, Y and Z axis
    • ’free’: means no constraint values
fixNode(DOFpattern, nodeTag)

Restrain DOF of a node according to the DOFpattern, which is a given string of type ‘0FF_00F’ that matches the DOFs (uX,uY,uZ,rotX,rotY,rotZ) where ‘F’ means FREE and ‘0’ means constrained with value=0 Note: DOFpaterns ‘0FF_00F’,‘0FF00F’,‘0_FF_0_0F’, … are equivalent

Parameters:nodeTag – node identifier.
fixNode000_000(nodeTag)

Restrain all six node DOFs (i. e. make them zero).

Parameters:nodeTag – node identifier.
fixNode000_00F(nodeTag)

Restrain all DOFs except for the rotation about Z axis.

Parameters:nodeTag – node identifier.
fixNode000_0F0(nodeTag)

Restrain all DOFs except for the rotation about Y axis.

Parameters:nodeTag – node identifier.
fixNode000_0FF(nodeTag)

Restrain the displacements (Ux,Uy and Uz) and the rotation about X axis.

Parameters:nodeTag – node identifier.
fixNode000_F00(nodeTag)

Restrain all DOFs except for the rotation about X axis.

Parameters:nodeTag – node identifier.
fixNode000_F0F(nodeTag)

Restrain the displacements (Ux,Uy and Uz) and the rotation about Y axis.

Parameters:nodeTag – node identifier.
fixNode000_FF0(nodeTag)

Restrain the displacements (Ux,Uy and Uz) and the rotation about Z axis.

Parameters:nodeTag – node identifier.
fixNode000_FFF(nodeTag)

Restrain only displacement DOFs (i. e. Ux= 0, Uy= 0 and Uz= 0).

Parameters:nodeTag – node identifier.
fixNode0F0_00F(nodeTag)

Restrain all DOFs except for Y displacement and the rotation about Z axis.

Parameters:nodeTag – node identifier.
fixNode0F0_0F0(nodeTag)

Restrain all DOFs except for Y displacement and the rotation about Y axis.

Parameters:nodeTag – node identifier.
fixNode0F0_0FF(nodeTag)

Restrain all DOFs except for Y displacement and the rotations about Y and Z axis.

Parameters:nodeTag – node identifier.
fixNode0F0_F00(nodeTag)

Restrain all DOFs except for Y displacement and the rotation about X axis.

Parameters:nodeTag – node identifier.
fixNode0F0_FFF(nodeTag)

Restrain all DOFs except for Y displacement and the rotations about Y and Z axis.

Parameters:nodeTag – node identifier.
fixNode0FF_FFF(nodeTag)

Restrain only X displacement DOF (i. e. Ux= 0).

Parameters:nodeTag – node identifier.
fixNodeF00_00F(nodeTag)

Restrain all DOFs except for X displacement and the rotation about Z axis.

Parameters:nodeTag – node identifier.
fixNodeF00_0F0(nodeTag)

Restrain all DOFs except for X displacement and the rotation about Y axis.

Parameters:nodeTag – node identifier.
fixNodeF00_0FF(nodeTag)

Restrain all DOFs except for X displacement and the rotations about Y and Z axis.

Parameters:nodeTag – node identifier.
fixNodeF00_F00(nodeTag)

Restrain all DOFs except for X displacement and the rotation about X axis.

Parameters:nodeTag – node identifier.
fixNodeF00_FFF(nodeTag)

Restrain all DOFs except for X displacement and the rotations about Y and Z axis.

Parameters:nodeTag – node identifier.
fixNodeFFF_000(nodeTag)

Restrain only rotations (i. e. ThetaX= 0, ThetaY= 0 and ThetaZ= 0).

Parameters:nodeTag – node identifier.
fixNodeFFF_0F0(nodeTag)

Restrain only X and Z rotations (i. e. ThetaX= 0, and ThetaZ= 0).

Parameters:nodeTag – node identifier.
getDispComponentFromName(compName)

Return the component index from the displacement name.

getDisplacementComponentsLabels()

Return a list with the labels of the displacement components.

getDisplacementDOFs()

Return the indices of the displacement DOFs.

getDisplacementVector(nodeTag)

Return a vector with the displacement components of the node motion.

Parameters:nodeTag – node identifier.
getRotationalDOFs()

Return the indices of the rotational DOFs.

getStrainComponentFromName(compName)

Return the component index from the generalized strain name.

getStressComponentFromName(compName)

Return the component index from the stress name.

newCorotCrdTransf(trfName, xzVector)

Creates a new 3D corotational transformation.

Parameters:
  • trfName – name for the new transformation.
  • xzVector – vector defining transformation XZ plane.
newLinearCrdTransf(trfName, xzVector)

Creates a new 3D linear transformation.

Parameters:
  • trfName – name for the new transformation.
  • xzVector – vector defining transformation XZ plane.
newPDeltaCrdTransf(trfName, xzVector)

Creates a new 3D PDelta transformation.

Parameters:
  • trfName – name for the new transformation.
  • xzVector – vector defining transformation XZ plane.
setHugeBeamBetweenNodes(nodeTagA, nodeTagB, nmbTransf)

Creates a very stiff bar between the two nodes being passed as parameters. (it was a workaround to the problem with the reactions values in nodes when using multipoint constraints. This problem has been be solved with the implementation of MFreedom_ConstraintBase::addResistingForceToNodalReaction).

Parameters:
  • nodeTagA – tag of bar’s from node.
  • nodeTagB – tag of bar’s to node.
  • nmbTransf – name of the coordinate transformation to use for the new bar.
setHugeTrussBetweenNodes(nodeTagA, nodeTagB)

Creates a very stiff bar between the two nodes being passed as parameters.

Parameters:
  • nodeTagA – tag of bar’s from node.
  • nodeTagB – tag of bar’s to node.
model.predefined_spaces.gdls_elasticidad2D(nodes)

Defines the dimension of the space: nodes by two coordinates (x,y) and two DOF for each node (Ux,Uy)

Parameters:nodes – nodes handler
model.predefined_spaces.gdls_elasticidad3D(nodes)
Defines the dimension of the space: nodes by three coordinates (x,y,z)
and three DOF for each node (Ux,Uy,Uz)
Parameters:nodes – preprocessor nodes handler
model.predefined_spaces.gdls_resist_materials2D(nodes)

Defines the dimension of the space: nodes by two coordinates (x,y) and three DOF for each node (Ux,Uy,theta)

Parameters:nodes – preprocessor nodes handler
model.predefined_spaces.gdls_resist_materials3D(nodes)

Define the dimension of the space: nodes by three coordinates (x,y,z) and six DOF for each node (Ux,Uy,Uz,thetaX,thetaY,thetaZ)

Parameters:nodes – preprocessor nodes handler
model.predefined_spaces.getModelSpace(preprocessor)

Return a PredefinedSpace from the dimension of the space and the number of DOFs for each node obtained from the preprocessor.

Parameters:preprocessor – preprocessor of the finite element problem.
model.predefined_spaces.getModelSpaceFromPreprocessor(preprocessor)

Return a PredefinedSpace from the dimension of the space and the number of DOFs for each node obtained from the preprocessor.

Parameters:preprocessor – preprocessor of the finite element problem.
model.predefined_spaces.getStructuralMechanics2DSpace(preprocessor)

Return a PredefinedSpace from the dimension of the space and the number of DOFs for each node obtained from the preprocessor.

Parameters:preprocessor – preprocessor of the finite element problem.
model.predefined_spaces.getStructuralMechanics3DSpace(preprocessor)

Return a tStructuralMechanics3DSpace from an already defined preprocessor.

Parameters:preprocessor – preprocessor of the finite element problem.
model.predefined_spaces.glueSets(preprocessor, DOF2Glue, masterSet, slaveSet, onCoord=None)

Creates rigid links between nodes in masterSet and their corresponding ones (for reasons of proximity) in slaveSet. Each node in masterSet coupled with one and only one node in slaveSet.

Parameters:
  • preprocessor – preprocessor
  • DOF2Glue – degrees of freedom to match. (e.g. [1,4] equals DOF 1 and 4 between coupled nodes.
  • masterSet – set with the master nodes
  • slaveSet – set with the slave nodes
  • onCoord – coordinate on which the search of the nearest node is based (‘X’,’Y’,’Z’). If None or other value, the search is based on the minimum distance. (Defaults to None)