Exemple #1
0
    def defineWireframeModel(self, nodes):
        self.modelSpace = predefined_spaces.StructuralMechanics2D(nodes)
        preprocessor = self.modelSpace.preprocessor
        points = preprocessor.getMultiBlockTopology.getPoints
        self.wireframeModelPoints = dict()
        pos = self.getWFStemTopPosition()
        self.wireframeModelPoints['stemTop'] = points.newPntFromPos3d(
            geom.Pos3d(pos.x, pos.y, 0.0))
        pos = self.getWFStemBottomPosition()
        self.wireframeModelPoints['stemBottom'] = points.newPntFromPos3d(
            geom.Pos3d(pos.x, pos.y, 0.0))
        pos = self.getWFToeEndPosition()
        self.wireframeModelPoints['toeEnd'] = points.newPntFromPos3d(
            geom.Pos3d(pos.x, pos.y, 0.0))
        pos = self.getWFHeelEndPosition()
        self.wireframeModelPoints['heelEnd'] = points.newPntFromPos3d(
            geom.Pos3d(pos.x, pos.y, 0.0))

        lines = preprocessor.getMultiBlockTopology.getLines
        self.wireframeModelLines = dict()
        self.wireframeModelLines['stem'] = lines.newLine(
            self.wireframeModelPoints['stemBottom'].tag,
            self.wireframeModelPoints['stemTop'].tag)
        self.wireframeModelLines['toe'] = lines.newLine(
            self.wireframeModelPoints['stemBottom'].tag,
            self.wireframeModelPoints['toeEnd'].tag)
        self.wireframeModelLines['heel'] = lines.newLine(
            self.wireframeModelPoints['stemBottom'].tag,
            self.wireframeModelPoints['heelEnd'].tag)
Exemple #2
0
def modeloSecc2d(preprocessor, nmbS):
    nodes = preprocessor.getNodeLoader

    modelSpace = predefined_spaces.StructuralMechanics2D(nodes)
    nodes.defaultTag = 1  #El número del próximo nodo será 1.
    nodes.newNodeXY(1, 0)
    nodes.newNodeXY(1, 0)

    elementos = preprocessor.getElementLoader
    elementos.dimElem = 1
    elementos.defaultMaterial = nmbS
    elementos.defaultTag = 1  #Tag for the next element.
    zls = elementos.newElement("zero_length_section", xc.ID([1, 2]))
    return zls
Exemple #3
0
def sectionModel(preprocessor, sectionName):
    ''' Defines a model to test a 2D fiber section.'''
    nodes = preprocessor.getNodeLoader

    modelSpace = predefined_spaces.StructuralMechanics2D(nodes)
    nodes.defaultTag = 1  #El número del próximo nodo será 1.
    nodes.newNodeXY(1, 0)
    nodes.newNodeXY(1, 0)

    elementos = preprocessor.getElementLoader
    elementos.dimElem = 1
    elementos.defaultMaterial = sectionName
    elementos.defaultTag = 1  #Tag for the next element.
    zls = elementos.newElement("ZeroLengthSection", xc.ID([1, 2]))
    return zls
L = 1  # Longitud de la ménsula en meters
b = 0.05  # Cross section width en meters
h = 0.10  # Cross section depth en meters
A = b * h  # Cross section area en m2
I = 1 / 12.0 * b * h**3  # Momento de inercia en m4
theta = math.radians(30)
E = 2.0E11  # Elastic modulus en N/m2
dens = 7800  # Densidad of the steel en kg/m3
m = A * dens

NumDiv = 10
# Problem type
prueba = xc.ProblemaEF()
preprocessor = prueba.getPreprocessor
nodes = preprocessor.getNodeLoader
modelSpace = predefined_spaces.StructuralMechanics2D(nodes)

# Define materials
scc = typical_materials.defElasticSection2d(preprocessor, "scc", A, E, I)

nodes.newSeedNode()

# Geometric transformation(s)
trfs = preprocessor.getTransfCooLoader
lin = trfs.newLinearCrdTransf2d("lin")

# Definimos elemento semilla
seedElemLoader = preprocessor.getElementLoader.seedElemLoader
seedElemLoader.defaultMaterial = "scc"
seedElemLoader.defaultTransformation = "lin"
seedElemLoader.defaultTag = 1  #Number for the next element will be 1.
Exemple #5
0
#Calculated data
As_calc=ro_exp*width*depth   #reinforcement area in the cross-section

#Other data
nDivIJ= 20  #number of cells (fibers) in the IJ direction of the cross section
nDivJK= 20  #number of cells (fibers) in the JK direction of the cross section
l= 1e-7     # Distance between nodes
Flist=np.arange(0e3,650e3,25e3)     # axial force [N]


# Model definition
feProblem= xc.FEProblem()
preprocessor=  feProblem.getPreprocessor
nodes= preprocessor.getNodeHandler     #nodes container
modelSpace= predefined_spaces.StructuralMechanics2D(nodes)  #Defines the dimension of nodes  three coordinates (x,y,z) and six DOF for each node (Ux,Uy,theta)


nodes.defaultTag= 1 #First node number.
nod= nodes.newNodeXY(1.0,0)
nod= nodes.newNodeXY(1.0+l,0)

# Materials definition
concrAux= EHE_materials.HA25           #parameters only for the compression branche 

#Reinforcing steel.
rfSteel=concrete_base.ReinforcingSteel(steelName='rfSteel', fyk=fy_exp, emax=0.08, gammaS=1.15,k=1.05)
rfSteel.Es=Es_exp
steelDiagram= rfSteel.defDiagK(preprocessor) #Definition of steel stress-strain diagram in XC. 

Exemple #6
0
from scipy.interpolate import interp1d
from scipy.integrate import trapz

pth = os.path.dirname(__file__)
if (not pth):
    pth = "."
#print("pth= ", pth)
accelFilePath = pth + '/../../aux/A10000.py'
openSeesResultsPath = pth + '/../../aux/test_time_history_01_opensees_results.py'

# *** PROBLEM
FEcase = xc.FEProblem()
prep = FEcase.getPreprocessor
nodes = prep.getNodeHandler
elements = prep.getElementHandler
modelSpace = predefined_spaces.StructuralMechanics2D(
    nodes)  #defines dimension of
#the space: nodes by three coordinates (x,y) and
#three DOF for each node (Ux,Uy,Theta)

## *** MESH ***
### *** GEOMETRY ***
n1 = nodes.newNodeXY(0.0, 0.0)
n2 = nodes.newNodeXY(0.0, 432.0)

### Single point constraints -- Boundary Conditions
constraints = prep.getBoundaryCondHandler
modelSpace.fixNode000(n1.tag)

### nodal masses:
n2.mass = xc.Matrix([[5.18, 0, 0], [0, 0, 0], [0, 0, 0]])  # node mass matrix.
__email__ = "*****@*****.**"

import xc_base
import geom
import xc
from model import predefined_spaces
from materials import typical_materials
from materials.sections import section_properties
from postprocess.xcVtk import vtk_graphic_base
from postprocess import output_handler

#########################################################
# Problem definition.
feProblem = xc.FEProblem()
preprocessor = feProblem.getPreprocessor
modelSpace = predefined_spaces.StructuralMechanics2D(
    preprocessor.getNodeHandler)

# Problem geometry (only geometry, no mesh yet).
points = preprocessor.getMultiBlockTopology.getPoints  # Point container.
# Position of the left end of the beam:
pt0 = points.newPntFromPos3d(geom.Pos3d(0.0, 0.0, 0.0))
# Position of the right end of the beam:
pt1 = points.newPntFromPos3d(geom.Pos3d(0.0, 8.0, 0.0))  # Right end

lines = preprocessor.getMultiBlockTopology.getLines  # Line container.
ln = lines.newLine(pt0.tag, pt1.tag)  # From pt0 to pt1.

# Ascii art:
#
#    ^ y
#    |            ln