Exemple #1
0
def defSeccAggregation3d(preprocessor, defSecc, defMat):
    ''' Definition of a elastic material section for 3D elements

  :param preprocessor: preprocessor name
  :param defSecc:  object with the mechanical properties of the section (A, Iy, Iz, ...)
  :param defMat:   object with the properties of the material (E, G)  
  '''
    nmbRigF = defSecc.sectionName + "_rigF"  # Bending stiffness.
    typical_materials.defElasticSection3d(preprocessor, nmbRigF, defSecc.A(),
                                          defMat.E, defMat.G(), defSecc.Iz(),
                                          defSecc.Iy(), defSecc.J())
    nmbRigVy = defSecc.sectionName + "_rigVy"  # Y shear stiffness.
    typical_materials.defElasticMaterial(
        preprocessor, nmbRigVy,
        defSecc.alphaY() * defMat.G() * defSecc.A())
    nmbRigVz = defSecc.sectionName + "_rigVz"  # Z shear stiffness.
    typical_materials.defElasticMaterial(
        preprocessor, nmbRigVz,
        defSecc.alphaY() * defMat.G() * defSecc.A())
    nmbRigT = defSecc.sectionName + "_rigT"  # Torsional stiffness.
    typical_materials.defElasticMaterial(preprocessor, nmbRigT,
                                         defMat.G() * defSecc.J())
    materiales = preprocessor.getMaterialLoader
    agg = materiales.newMaterial("section_aggregator", defSecc.sectionName)
    agg.setSection(nmbRigF)
    agg.setAdditions(["T", "Vy", "Vz"], [nmbRigT, nmbRigVy, nmbRigVz])
Exemple #2
0
    def defElasticSection3d(self, preprocessor, material):
        ''' Return an elastic section appropiate for 3D beam analysis

        :param preprocessor: preprocessor object.
        :param material:      material (for which E is the Young's modulus and G() the shear modulus)  
        '''
        if (not self.xc_material):
            materialHandler = preprocessor.getMaterialHandler
            if (materialHandler.materialExists(self.sectionName)):
                lmsg.warning("Section: " + self.sectionName +
                             " already defined.")
                self.xc_material = materialHandler.getMaterial(
                    self.sectionName)
            else:
                self.xc_material = typical_materials.defElasticSection3d(
                    preprocessor,
                    self.sectionName,
                    self.A(),
                    material.E,
                    material.G(),
                    self.Iz(),
                    self.Iy(),
                    self.J(),
                    linearRho=material.rho * self.A())
        else:
            lmsg.warning('Material: ' + self.sectionName +
                         ' already defined as:' + str(self.xc_material))
        return self.xc_material
Exemple #3
0
def putHuge3DBarBetweenNodes(preprocessor, tagNodA, tagNodB, nmbTransf):
    '''
  Creates a very stiff bar between the two nodes being passed as parameters.
  (it's a workaround to the problem with the reactions values in nodes when
  using multipoint constraints. This problem will be solved with the
  implementation of MFreedom_ConstraintBase::addResistingForceToNodalReaction).

  :param   tagNodA: tag of bar's from node.
  :param   tagNodB: tag of bar's to node.
  :param   nmbTransf: name of the coordinate transformation to use for the new bar.
  '''
    elementos = preprocessor.getElementLoader
    elementos.defaultTransformation = nmbTransf
    # Material definition
    matName = 'bar' + str(tagNodA) + str(tagNodB) + nmbTransf
    A = 10
    E = 1e14
    G = 1e12
    Iz = 10
    Iy = 10
    J = 10
    scc = typical_materials.defElasticSection3d(preprocessor, matName, A, E, G,
                                                Iz, Iy, J)
    defMat = elementos.defaultMaterial
    #print "defMat= ", defMat
    elementos.defaultMaterial = matName
    elem = elementos.newElement("elastic_beam_3d", xc.ID([tagNodA, tagNodB]))
    elementos.defaultMaterial = defMat
    scc = elem.sectionProperties
    #print "A= ", elem.sectionProperties.A
    return elem
Exemple #4
0
  def defElasticSection3d(self,preprocessor,material):
    '''elastic section appropiate for 3D beam analysis

    :param  preprocessor: preprocessor object.
    :param material:      material (for which E is the Young's modulus and G() the shear modulus)  
    '''
    materiales= preprocessor.getMaterialLoader
    if(materiales.materialExists(self.sectionName)):
      sys.stderr.write("Section: "+self.sectionName+" is already defined.")
    else:
      retval= typical_materials.defElasticSection3d(preprocessor,self.sectionName,self.A(),material.E,material.G(),self.Iz(),self.Iy(),self.J())
      return retval
Exemple #5
0
  def defElasticSection3d(self,preprocessor,material):
    '''elastic section appropiate for 3D beam analysis

    :param  preprocessor: preprocessor object.
    :param material:      material (for which E is the Young's modulus and G() the shear modulus)  
    '''
    materiales= preprocessor.getMaterialHandler
    if(materiales.materialExists(self.sectionName)):
      sys.stderr.write("Section: "+self.sectionName+" is already defined.")
    else:
      retval= typical_materials.defElasticSection3d(preprocessor,self.sectionName,self.A(),material.E,material.G(),self.Iz(),self.Iy(),self.J())
      return retval
Exemple #6
0
    def setHugeBeamBetweenNodes(self,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).

        :param   nodeTagA: tag of bar's from node.
        :param   nodeTagB: tag of bar's to node.
        :param   nmbTransf: name of the coordinate transformation to use for the new bar.
        '''
        elements= self.preprocessor.getElementHandler
        elements.defaultTransformation= nmbTransf
        # Material definition
        matName= 'bar' + str(nodeTagA) + str(nodeTagB) + nmbTransf
        (A,E,G,Iz,Iy,J)= (10, 1e14 , 1e12 , 10, 10, 10)
        scc= tm.defElasticSection3d(self.preprocessor,matName,A,E,G,Iz,Iy,J)
        elements.defaultMaterial= matName
        elem= elements.newElement("ElasticBeam3d",xc.ID([nodeTagA,nodeTagB]))
        scc= elem.sectionProperties
        return elem
Exemple #7
0
from misc_utils import log_messages as lmsg

feProblem= xc.FEProblem()
preprocessor=  feProblem.getPreprocessor   
nodes= preprocessor.getNodeHandler
modelSpace= predefined_spaces.StructuralMechanics3D(nodes)
nod0= nodes.newNodeXYZ(0.0,0.0,0.0)
nod1= nodes.newNodeXYZ(0.5,0.5,0.5)
nod2= nodes.newNodeXYZ(2.0,2.0,2.0)
nod3= nodes.newNodeXYZ(3.0,3.0,3.0)

# Geometric transformations
lin= modelSpace.newLinearCrdTransf("lin",xc.Vector([0,1,1]))

# Materials
section= typical_materials.defElasticSection3d(preprocessor, "section",1,1,1,1,1,1)

elements= preprocessor.getElementHandler
elements.defaultTransformation= "lin" # Coord. transformation.
elements.defaultMaterial= "section"
ele0= elements.newElement("ElasticBeam3d",xc.ID([nod0.tag,nod1.tag]))
ele1= elements.newElement("ElasticBeam3d",xc.ID([nod2.tag,nod3.tag]))

points= preprocessor.getMultiBlockTopology.getPoints
pt0= points.newPntFromPos3d(geom.Pos3d(0.0,0.0,0.0))
pt1= points.newPntFromPos3d(geom.Pos3d(0.5,0.5,0.5))
pt2= points.newPntFromPos3d(geom.Pos3d(3.0,3.0,3.0))
pt3= points.newPntFromPos3d(geom.Pos3d(4.0,4.0,4.0))

l1=  preprocessor.getMultiBlockTopology.getLines.newLine(pt0.tag,pt1.tag)
l2=  preprocessor.getMultiBlockTopology.getLines.newLine(pt2.tag,pt3.tag)
IyElem = beamRCsect.lstRCSects[0].getIy_RClocalYax()
JElem = beamRCsect.lstRCSects[0].getJTorsion()

# Materials definition
# A:            cross-sectional area of the section
# E:            Young’s modulus of material
# G:            Shear modulus of the material
# Iz:           second moment of area about the local z-axis
# Iy:           second moment of area about the local y-axis
# J:            torsional moment of inertia of the section

scc = typical_materials.defElasticSection3d(
    preprocessor=preprocessor,
    name="scc",
    A=beamRCsect.lstRCSects[0].getAc(),
    E=beamRCsect.lstRCSects[0].concrType.Ecm(),
    G=beamRCsect.lstRCSects[0].concrType.Gcm(),
    Iz=IzElem,
    Iy=IyElem,
    J=JElem)

# Elements definition
elements = preprocessor.getElementHandler
elements.defaultMaterial = "scc"
elements.defaultTag = 1  #Tag for next element.

elements.defaultTransformation = "ltXbeam"
beam3dX = elements.newElement("ElasticBeam3d", xc.ID([0, 1]))
elements.defaultTransformation = "ltYbeam"
beam3dY = elements.newElement("ElasticBeam3d", xc.ID([0, 2]))
elements.defaultTransformation = "ltZbeam"
__email__= "*****@*****.**"

# Problem type
feProblem= xc.FEProblem()
preprocessor=  feProblem.getPreprocessor   
nodes= preprocessor.getNodeHandler
modelSpace= predefined_spaces.StructuralMechanics3D(nodes)
nodes.defaultTag= 1 #First node number.
nod= nodes.newNodeXYZ(0,0,0)
nod= nodes.newNodeXYZ(5,5,5)

# Geometric transformations
lin= modelSpace.newLinearCrdTransf("lin",xc.Vector([0,1,0]))

# Materials
section= typical_materials.defElasticSection3d(preprocessor, "section",1,1,1,1,1,1)

# Elements definition
elements= preprocessor.getElementHandler
elements.defaultTransformation= "lin" # Coordinate transformation for the new elements
elements.defaultMaterial= "section"
elements.defaultTag= 1 #Tag for the next element.
beam3d= elements.newElement("ElasticBeam3d",xc.ID([1,2]))

crdTransf= beam3d.getCoordTransf
# print "vector I:",getIVector
# print "vector J:",getJVector
# print "vector K:",getKVector
vILocal= crdTransf.getVectorLocalCoordFromGlobal(crdTransf.getIVector)
vJLocal= crdTransf.getVectorLocalCoordFromGlobal(crdTransf.getJVector)
vKLocal= crdTransf.getVectorLocalCoordFromGlobal(crdTransf.getKVector)
    l=lines.newLine(linsJoints.loc[i].i_jt,linsJoints.loc[i].j_jt)
    l.nDiv=1   
    diagSet.getLines.append(l)

# #Sections definition
from materials.sections import section_properties
strutSect=section_properties.CircularSection(name='strutSect',Rext=strutRext,Rint=strutRint)

#Materials definition
from materials import typical_materials
from materials import typical_materials
#struts material
# strutMat=typical_materials.defElasticMaterial(preprocessor=prep, name="strutMat",E=Estruts)
# diagCableMat=typical_materials.defElasticMaterial(preprocessor=prep, name="diagCableMat",E=EdiagCable)
# saddCableMat=typical_materials.defElasticMaterial(preprocessor=prep, name="saddCableMat",E=EdiagCable)
strutMat=typical_materials.defElasticSection3d(preprocessor=prep,name='strutMat',A=strutSect.A(),E=Estruts,G=Gstruts,Iz=strutSect.Iz(),Iy=strutSect.Iy(),J=strutSect.J())
#cables materials
# diagCableMat=typical_materials.defCableMaterial(preprocessor=prep,name='diagCableMat',E=EdiagCable,prestress=sigmaPrestrDiagCableInit,rho=rhoDiagCable)
# saddCableMat=typical_materials.defCableMaterial(preprocessor=prep,name='saddCableMat',E=EdiagCable,prestress=sigmaPrestrSaddCableInit,rho=rhoSaddCable)

# # Plotting of CAD entities
# from postprocess.xcVtk.CAD_model import vtk_CAD_graphic
# defDisplay= vtk_CAD_graphic.RecordDefDisplayCAD()
# totalSet= prep.getSets.getSet('total')
# defDisplay.displayBlocks(xcSet=totalSet,fName= None,caption= 'Model grid')


# Geometric transformations
trfs= prep.getTransfCooHandler
# Coord. trasformation for beam in global X direction
ltStruts= trfs.newLinearCrdTransf3d("ltStruts")
# of the reinforced concrete sections (parallel to the width),
# that is why we define:
IzElem=beamRCsect.lstRCSects[0].getIz_RClocalZax()
IyElem=beamRCsect.lstRCSects[0].getIy_RClocalYax()
JElem= beamRCsect.lstRCSects[0].getJTorsion()   


# Materials definition
# A:            cross-sectional area of the section
# E:            Young’s modulus of material
# G:            Shear modulus of the material          
# Iz:           second moment of area about the local z-axis
# Iy:           second moment of area about the local y-axis 
# J:            torsional moment of inertia of the section

scc= typical_materials.defElasticSection3d(preprocessor=preprocessor, name="scc",A=beamRCsect.lstRCSects[0].getAc(),E=beamRCsect.lstRCSects[0].concrType.Ecm(),G=beamRCsect.lstRCSects[0].concrType.Gcm(),Iz=IzElem,Iy=IyElem,J=JElem)


# Elements definition
elements= preprocessor.getElementHandler
elements.defaultMaterial= "scc"
elements.defaultTag= 1 #Tag for next element.

elements.defaultTransformation= "ltXbeam"
beam3dX= elements.newElement("ElasticBeam3d",xc.ID([0,1]))
elements.defaultTransformation= "ltYbeam"
beam3dY= elements.newElement("ElasticBeam3d",xc.ID([0,2]))
elements.defaultTransformation= "ltZbeam"
beam3dZ= elements.newElement("ElasticBeam3d",xc.ID([0,3]))

    
Exemple #12
0
flange= regions.newQuadRegion('concrete')# Flange
flange.pMin= geom.Pos2d(d-hf,0.0)
flange.pMax= geom.Pos2d(d,b)
web= regions.newQuadRegion('concrete')# Web
web.pMin= geom.Pos2d(0.0,b/2-bw/2)
web.pMax= geom.Pos2d(d-hf,b/2+bw/2)

reinforcement= sectionGeometryTest.getReinfLayers
reinforcementA= reinforcement.newStraightReinfLayer("steel")
reinforcementA.numReinfBars= 5
reinforcementA.barArea= areaBar
reinforcementA.p1= geom.Pos2d(0.0,b/2-bw/2+0.05)
reinforcementA.p2= geom.Pos2d(0.0,b/2+bw/2-0.05)

elasticSection= typical_materials.defElasticSection3d(preprocessor, "elasticSection",0.0,Ec,Gc,0.0,0.0,1.0)
elasticSection.sectionGeometry("sectionGeometryTest")
sectionProperties= elasticSection.sectionProperties
area= sectionProperties.A
Iy= sectionProperties.Iy
Iz= sectionProperties.Iz

areaTeor= b*hf+(d-hf)*bw+n*5*areaBar
izTeor= 0.0081
iyTeor= 0.0073

ratio1= ((area-areaTeor)/areaTeor)
ratio2= ((Iz-izTeor)/izTeor)
ratio3= ((Iy-iyTeor)/iyTeor)

''' 
feProblem= xc.FEProblem()
preprocessor=  feProblem.getPreprocessor   
nodes= preprocessor.getNodeHandler

# Problem type
modelSpace= predefined_spaces.StructuralMechanics3D(nodes)
nodes.defaultTag= 1 #First node number.
nod= nodes.newNodeXYZ(0,0,0)
nod= nodes.newNodeXYZ(L,0,0)

    
# Geometric transformation(s)
lin= modelSpace.newLinearCrdTransf("lin",xc.Vector([0,0,1]))    
# Materials definition
scc= typical_materials.defElasticSection3d(preprocessor, "scc",A,E,G,Iz,Iy,J)


# Elements definition
elements= preprocessor.getElementHandler
elements.defaultTransformation= "lin"
elements.defaultMaterial= "scc"
elements.defaultTag= 1 #Tag for next element.
beam3d= elements.newElement("ElasticBeam3d",xc.ID([1,2]))

    
# Constraints
modelSpace.fixNode000_000(1)


# Loads definition
Exemple #14
0
# Problem type
feProblem= xc.FEProblem()
preprocessor=  feProblem.getPreprocessor
nodes= preprocessor.getNodeHandler
modelSpace= predefined_spaces.StructuralMechanics3D(nodes)
nod0= nodes.newNodeIDXYZ(0,0,0,0)
nod1= nodes.newNodeXYZ(0,-Ly,0)
nod2= nodes.newNodeXYZ(0,-Ly,-Lz)
nod3= nodes.newNodeXYZ(Lx,-Ly,-Lz)
nod3.mass= nodeMassMatrix

constraints= preprocessor.getBoundaryCondHandler
nod0.fix(xc.ID([0,1,2,3,4,5]),xc.Vector([0,0,0,0,0,0]))

# Materials definition
scc= typical_materials.defElasticSection3d(preprocessor, "scc",area,EMat,GMat,Izz,Iyy,Ir)

# Geometric transformation(s)
linX= modelSpace.newLinearCrdTransf("linX",xc.Vector([1,0,0]))
linY= modelSpace.newLinearCrdTransf("linY",xc.Vector([0,1,0]))

# Elements definition
elements= preprocessor.getElementHandler
elements.defaultTransformation= "linX"
elements.defaultMaterial= "scc"
beam3d= elements.newElement("ElasticBeam3d",xc.ID([0,1]))
beam3d= elements.newElement("ElasticBeam3d",xc.ID([1,2]))
elements.defaultTransformation= "linY"
beam3d= elements.newElement("ElasticBeam3d",xc.ID([2,3]))

Exemple #15
0
feProblem= xc.FEProblem()
preprocessor=  feProblem.getPreprocessor  
nodes= preprocessor.getNodeHandler

# Problem type
modelSpace= predefined_spaces.StructuralMechanics3D(nodes)
nodes.defaultTag= 1 #First node number.
nod= nodes.newNodeXYZ(0,0.0,0.0)
nod= nodes.newNodeXYZ(L,0.0,0.0)


# Geometric transformation(s)
lin= modelSpace.newLinearCrdTransf("lin",xc.Vector([0,-1,0]))    
# Materials definition
scc= typical_materials.defElasticSection3d(preprocessor, "scc",A,E,G,Iz,Iy,J)


# Elements definition
elements= preprocessor.getElementHandler
elements.defaultTransformation= lin.name
elements.defaultMaterial= scc.name
#  sintaxis: ElasticBeam3d[<tag>] 
elements.defaultTag= 1 #Tag for next element.
beam3d= elements.newElement("ElasticBeam3d",xc.ID([1,2]))

# Constraints
modelSpace.fixNode000_000(1)

# Loads definition
loadHandler= preprocessor.getLoadHandler
flange = regions.newQuadRegion('concrete')  # Flange
flange.pMin = geom.Pos2d(d - hf, 0.0)
flange.pMax = geom.Pos2d(d, b)
web = regions.newQuadRegion('concrete')  # Web
web.pMin = geom.Pos2d(0.0, b / 2 - bw / 2)
web.pMax = geom.Pos2d(d - hf, b / 2 + bw / 2)

reinforcement = sectionGeometryTest.getReinfLayers
reinforcementA = reinforcement.newStraightReinfLayer("steel")
reinforcementA.numReinfBars = 5
reinforcementA.barArea = areaBar
reinforcementA.p1 = geom.Pos2d(0.0, b / 2 - bw / 2 + 0.05)
reinforcementA.p2 = geom.Pos2d(0.0, b / 2 + bw / 2 - 0.05)

elasticSection = typical_materials.defElasticSection3d(preprocessor,
                                                       "elasticSection", 0.0,
                                                       Ec, Gc, 0.0, 0.0, 1.0)
elasticSection.sectionGeometry("sectionGeometryTest")
sectionProperties = elasticSection.sectionProperties
area = sectionProperties.A
Iy = sectionProperties.Iy
Iz = sectionProperties.Iz

areaTeor = b * hf + (d - hf) * bw + n * 5 * areaBar
izTeor = 0.0081
iyTeor = 0.0073

ratio1 = ((area - areaTeor) / areaTeor)
ratio2 = ((Iz - izTeor) / izTeor)
ratio3 = ((Iy - iyTeor) / iyTeor)
''' 
Exemple #17
0
# Problem type
feProblem = xc.FEProblem()
preprocessor = feProblem.getPreprocessor
nodes = preprocessor.getNodeHandler
modelSpace = predefined_spaces.StructuralMechanics3D(nodes)
nod0 = nodes.newNodeIDXYZ(0, 0, 0, 0)
nod1 = nodes.newNodeXYZ(0, -Ly, 0)
nod2 = nodes.newNodeXYZ(0, -Ly, -Lz)
nod3 = nodes.newNodeXYZ(Lx, -Ly, -Lz)
nod3.mass = nodeMassMatrix

constraints = preprocessor.getBoundaryCondHandler
nod0.fix(xc.ID([0, 1, 2, 3, 4, 5]), xc.Vector([0, 0, 0, 0, 0, 0]))

# Materials definition
scc = typical_materials.defElasticSection3d(preprocessor, "scc", area, EMat,
                                            GMat, Izz, Iyy, Ir)

# Geometric transformation(s)
linX = modelSpace.newLinearCrdTransf("linX", xc.Vector([1, 0, 0]))
linY = modelSpace.newLinearCrdTransf("linY", xc.Vector([0, 1, 0]))

# Elements definition
elements = preprocessor.getElementHandler
elements.defaultTransformation = linX.name
elements.defaultMaterial = scc.name
beam3d = elements.newElement("ElasticBeam3d", xc.ID([0, 1]))
beam3d = elements.newElement("ElasticBeam3d", xc.ID([1, 2]))
elements.defaultTransformation = linY.name
beam3d = elements.newElement("ElasticBeam3d", xc.ID([2, 3]))

# Solution procedure
diagSect = section_properties.CircularSection(name='diagSect',
                                              Rext=diagRext,
                                              Rint=diagRint)
saddSect = section_properties.CircularSection(name='saddSect',
                                              Rext=saddRext,
                                              Rint=saddRint)

#Materials definition
from materials import typical_materials
from materials import typical_materials
#struts material
#strutMat=typical_materials.defElasticMaterial(preprocessor=prep, name="strutMat",E=Estruts)
strutMat = typical_materials.defElasticSection3d(preprocessor=prep,
                                                 name='strutMat',
                                                 A=strutSect.A(),
                                                 E=Estruts,
                                                 G=Gstruts,
                                                 Iz=strutSect.Iz(),
                                                 Iy=strutSect.Iy(),
                                                 J=strutSect.J())
#cables materials
diagCableMat = typical_materials.defElasticSection3d(preprocessor=prep,
                                                     name='diagCableMat',
                                                     A=diagSect.A(),
                                                     E=EdiagCable,
                                                     G=Gstruts,
                                                     Iz=diagSect.Iz(),
                                                     Iy=diagSect.Iy(),
                                                     J=diagSect.J())
saddCableMat = typical_materials.defElasticSection3d(preprocessor=prep,
                                                     name='saddCableMat',
                                                     A=saddSect.A(),