Exemplo n.º 1
0
def def_secc_aggregation2d(preprocessor,defSecc,defMat):
  ''' Definition of a elastic material-section for 2D 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.defElasticSection2d(preprocessor,nmbRigF,defSecc.A(),defMat.E,defSecc.Iz())
  nmbRigVy= defSecc.sectionName+"_rigVy" # Y shear stiffness.
  typical_materials.defElasticMaterial(preprocessor,nmbRigVy,defSecc.alphaY()*defMat.G()*defSecc.A())
  materialHandler= preprocessor.getMaterialHandler
  agg= materialHandler.newMaterial("section_aggregator",defSecc.sectionName)
  agg.setSection(nmbRigF)
  agg.setAdditions(["Vy"],[nmbRigVy])
Exemplo n.º 2
0
    def defElasticSection2d(self, preprocessor, material):
        ''' Return an elastic section appropiate for 2D beam analysis, 
           including shear deformations

        :param preprocessor: preprocessor object.
        :param material:     material constitutive model (for which 
                             E is the Young's 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.defElasticSection2d(
                    preprocessor,
                    self.sectionName,
                    self.A(),
                    material.E,
                    self.Iz(),
                    rho=material.rho)
        else:
            lmsg.warning('Material: ' + self.sectionName +
                         ' already defined as:' + str(self.xc_material))
        return self.xc_material
Exemplo n.º 3
0
    def defElasticSection2d(self, preprocessor, material, majorAxis=True):
        ''' Return an elastic section appropiate for 2D beam analysis

        :param preprocessor: preprocessor object.
        :param material:     material constitutive model 
                             (for which E is the Young's modulus)
        :param majorAxis: true if bending occurs in the section major axis.
        '''
        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:
                I = self.Iz()
                if (not majorAxis):
                    I = self.Iy()
                self.xc_material = typical_materials.defElasticSection2d(
                    preprocessor,
                    self.sectionName,
                    self.A(),
                    material.E,
                    I,
                    linearRho=material.rho * self.A())
        else:
            lmsg.warning('Material: ' + self.sectionName +
                         ' already defined as:' + str(self.xc_material))
        return self.xc_material
Exemplo n.º 4
0
def defSeccAggregation2d(preprocessor, defSecc, defMat):
    ''' Definition of a elastic material-section for 2D 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.nmb + "_rigF"  # Rigidez a flexión.
    typical_materials.defElasticSection2d(preprocessor, nmbRigF, defSecc.A(),
                                          defMat.E, defSecc.Iz())
    nmbRigVy = defSecc.nmb + "_rigVy"  # Rigidez a cortante y.
    typical_materials.defElasticMaterial(
        preprocessor, nmbRigVy,
        defSecc.alphaY() * defMat.G() * defSecc.A())
    materiales = preprocessor.getMaterialLoader
    agg = materiales.newMaterial("section_aggregator", defSecc.nmb)
    agg.setSection(nmbRigF)
    agg.setAdditions(["Vy"], [nmbRigVy])
Exemplo n.º 5
0
  def defElasticSection2d(self,preprocessor,material):
    '''elastic section appropiate for 2D beam analysis, including shear deformations

    :param preprocessor: preprocessor object.
    :param material:     material constitutive model (for which 
                         E is the Young's modulus)
    '''

    materiales= preprocessor.getMaterialLoader
    if(materiales.materialExists(self.sectionName)):
      sys.stderr.write("Section: "+self.sectionName+" is already defined.")
    else:
      retval= typical_materials.defElasticSection2d(preprocessor,self.sectionName,self.A(),material.E,self.Iz())
      return retval
Exemplo n.º 6
0
  def defElasticSection2d(self,preprocessor,material):
    '''elastic section appropiate for 2D beam analysis, including shear deformations

    :param preprocessor: preprocessor object.
    :param material:     material constitutive model (for which 
                         E is the Young's modulus)
    '''

    materiales= preprocessor.getMaterialHandler
    if(materiales.materialExists(self.sectionName)):
      sys.stderr.write("Section: "+self.sectionName+" is already defined.")
    else:
      retval= typical_materials.defElasticSection2d(preprocessor,self.sectionName,self.A(),material.E,self.Iz())
      return retval
Exemplo n.º 7
0
nod4.mass = nodeMassMatrix
nod4.setProp("gdlsCoartados", xc.ID([1, 2]))
nod5 = nodes.newNodeXY(0, 4 + 3 + 3 + 3 + 3)
nod5.mass = nodeMassMatrix
nod5.setProp("gdlsCoartados", xc.ID([1, 2]))
setTotal = preprocessor.getSets.getSet("total")
nodes = setTotal.getNodes
for n in nodes:
    n.fix(n.getProp("gdlsCoartados"), xc.Vector([0, 0, 0]))

# Materials definition
materialHandler = preprocessor.getMaterialHandler
#scc= typical_materials.defElasticSection2d(preprocessor, "scc",A,E,I)

sccPlBaja = typical_materials.defElasticSection2d(preprocessor, "sccPlBaja",
                                                  20 * Bbaja * Bbaja, Ehorm,
                                                  20 * Ibaja)
sccPl1a = typical_materials.defElasticSection2d(preprocessor, "sccPl1a",
                                                20 * B1a * B1a, Ehorm,
                                                20 * I1a)
sccPl2a = typical_materials.defElasticSection2d(preprocessor, "sccPl2a",
                                                20 * B1a * B1a, Ehorm,
                                                20 * I1a)
sccPl3a = typical_materials.defElasticSection2d(preprocessor, "sccPl3a",
                                                20 * B3a * B3a, Ehorm,
                                                20 * I3a)
sccPl4a = typical_materials.defElasticSection2d(preprocessor, "sccPl4a",
                                                20 * B3a * B3a, Ehorm,
                                                20 * I3a)

# Geometric transformation(s)
Exemplo n.º 8
0
# Problem type
modelSpace = predefined_spaces.StructuralMechanics2D(nodes)
# Definimos el material
def_secc_aggregation.def_secc_aggregation2d(preprocessor, sectionTest,
                                            sectionTestMaterial)
nodes.defaultTag = 1  # First node number.
nod = nodes.newNodeXY(0, 0)
nod = nodes.newNodeXY(L, 0.0)

# Geometric transformations
lin = modelSpace.newLinearCrdTransf("lin")

# Materials definition
scc = typical_materials.defElasticSection2d(preprocessor, "scc",
                                            sectionTest.A(),
                                            sectionTestMaterial.E,
                                            sectionTest.Iz())

# Elements definition
elements = preprocessor.getElementHandler
elements.defaultTransformation = lin.name
elements.defaultMaterial = scc.name
elements.defaultMaterial = sectionTest.sectionName
elements.numSections = 3  # Number of sections along the element.
elements.defaultTag = 1
beam2d = elements.newElement("ForceBeamColumn2d", xc.ID([1, 2]))

# Constraints
constraints = preprocessor.getBoundaryCondHandler
modelSpace.fixNode000(1)
Exemplo n.º 9
0
h= 0.2 # Cross section depth in meters
A= b*h # Cross section area en m2
I= 1/12.0*b*h**3 # Moment of inertia in m4
E=1e4/I # Elastic modulus en N/m2
P= -100 # Carga vertical sobre la columna.

NumDiv= 4

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

# Materials definition
scc= typical_materials.defElasticSection2d(preprocessor, "scc",A,E,I)


nodes.newSeedNode()
# Geometric transformation(s)
lin= modelSpace.newPDeltaCrdTransf("lin")


# Seed element definition
seedElemHandler= preprocessor.getElementHandler.seedElemHandler
seedElemHandler.defaultMaterial= "scc"
seedElemHandler.defaultTransformation= "lin"
seedElemHandler.defaultTag= 1 #Tag for next element.
beam2d= seedElemHandler.newElement("ElasticBeam2d",xc.ID([0,0]))
beam2d.h= h
beam2d.rho= 0.0
Exemplo n.º 10
0
import geom
import xc
from solution import predefined_solutions
from model import predefined_spaces
from materials import typical_materials

feProblem= xc.FEProblem()
preprocessor=  feProblem.getPreprocessor
nodes= preprocessor.getNodeHandler
modelSpace= predefined_spaces.StructuralMechanics2D(nodes)


pd= modelSpace.newPDeltaCrdTransf("pd")

# Materials definition
scc= typical_materials.defElasticSection2d(preprocessor, "scc",area,Es,Iz)

seedElemHandler= preprocessor.getElementHandler.seedElemHandler
seedElemHandler.defaultMaterial= scc.name
seedElemHandler.defaultTransformation= pd.name
seedElemHandler.defaultTag= 1 #Tag for next element.
beam2d= seedElemHandler.newElement("ElasticBeam2d",xc.ID([1,2]))

points= preprocessor.getMultiBlockTopology.getPoints
pt1= points.newPntIDPos3d(1, geom.Pos3d(0.0,0.0,0))
pt2= points.newPntIDPos3d(2, geom.Pos3d(0.0,H,0))
pt3= points.newPntIDPos3d(3, geom.Pos3d(B,0.0,0))
pt4= points.newPntIDPos3d(4, geom.Pos3d(B,H,0))
pt5= points.newPntIDPos3d(5, geom.Pos3d(offset,0.0,0))
pt6= points.newPntIDPos3d(6, geom.Pos3d(offset,H,0))
pt7= points.newPntIDPos3d(7, geom.Pos3d(offset+B,0.0,0))
Exemplo n.º 11
0
nod4= nodes.newNodeXY(0,4+3+3)
nod4.mass= nodeMassMatrix
nod4.setProp("gdlsCoartados",xc.ID([1,2]))
nod5= nodes.newNodeXY(0,4+3+3+3)
nod5.mass= nodeMassMatrix
nod5.setProp("gdlsCoartados",xc.ID([1,2]))
nod6= nodes.newNodeXY(0,4+3+3+3+3)
nod6.mass= nodeMassMatrix
nod6.setProp("gdlsCoartados",xc.ID([1,2]))
setTotal= preprocessor.getSets["total"]
nodes= setTotal.getNodes
for n in nodes:
  n.fix(n.getProp("gdlsCoartados"),xc.Vector([0,0,0]))

# Materials definition
sccPlBaja= typical_materials.defElasticSection2d(preprocessor, "sccPlBaja",20*Bbaja*Bbaja,Ehorm,20*Ibaja)
sccPl1a= typical_materials.defElasticSection2d(preprocessor, "sccPl1a",20*B1a*B1a,Ehorm,20*I1a) 
sccPl2a= typical_materials.defElasticSection2d(preprocessor, "sccPl2a",20*B1a*B1a,Ehorm,20*I1a) 
sccPl3a= typical_materials.defElasticSection2d(preprocessor, "sccPl3a",20*B3a*B3a,Ehorm,20*I3a) 
sccPl4a= typical_materials.defElasticSection2d(preprocessor, "sccPl4a",20*B3a*B3a,Ehorm,20*I3a)


# Geometric transformation(s)
lin= modelSpace.newLinearCrdTransf("lin")

# Elements definition
elements= preprocessor.getElementHandler
elements.defaultTransformation= "lin"
elements.defaultMaterial= "sccPlBaja"
elements.defaultTag= 1 #Tag for next element.
beam2d= elements.newElement("ElasticBeam2d",xc.ID([0,1]))
Exemplo n.º 12
0
L = 20  # Bar length.

# Problem type

feProblem = xc.FEProblem()
preprocessor = feProblem.getPreprocessor
nodes = preprocessor.getNodeHandler
modelSpace = predefined_spaces.StructuralMechanics2D(nodes)
nodes.defaultTag = 1  #First node number.
nod = nodes.newNodeXY(0, 0)
nod = nodes.newNodeXY(L * math.sqrt(2) / 2, L * math.sqrt(2) / 2)

# Geometric transformations
lin = modelSpace.newLinearCrdTransf("lin")
# Materials
section = typical_materials.defElasticSection2d(preprocessor, "section", 1, 1,
                                                1)

# Elements definition
elements = preprocessor.getElementHandler
elements.defaultTransformation = lin.name
elements.defaultMaterial = section.name
#  sintaxis: beam2d_02[<tag>]
elements.defaultTag = 1  #Tag for next element.
beam2d = elements.newElement("ElasticBeam2d", xc.ID([1, 2]))
coordTransf = beam2d.getCoordTransf
centroideG = coordTransf.getPointGlobalCoordFromBasic(0.5)
posCentroideG = geom.Pos2d(centroideG[0], centroideG[1])
centroideL = coordTransf.getPointLocalCoordFromGlobal(centroideG)
posCentroideL = geom.Pos2d(centroideL[0], centroideL[1])
centroideB = coordTransf.getPointBasicCoordFromGlobal(centroideG)
Exemplo n.º 13
0
nodes = preprocessor.getNodeHandler
# Problem type
modelSpace = predefined_spaces.StructuralMechanics2D(nodes)

nodes.defaultTag = 0  #First node number.
nod = nodes.newNodeXY(0, 0)
nod = nodes.newNodeXY(1.0, 0.0)
nod = nodes.newNodeXY(2.0, 0.0)

# Geometric transformations
trfs = preprocessor.getTransfCooHandler
lin = trfs.newLinearCrdTransf2d("lin")

# Materials definition
scc = typical_materials.defElasticSection2d(
    preprocessor, "scc", beamRCsect.lstRCSects[0].getAc(),
    beamRCsect.lstRCSects[0].fiberSectionParameters.concrType.Ecm(),
    beamRCsect.lstRCSects[0].getI())

#print scc.sectionProperties.I

# Elements definition
elementos = preprocessor.getElementHandler
elementos.defaultTransformation = "lin"
elementos.defaultMaterial = "scc"
#  sintaxis: beam2d_02[<tag>]
elementos.defaultTag = 1  #Tag for next element.
beam2dA = elementos.newElement("ElasticBeam2d", xc.ID([0, 1]))
beam2dA.h = hbeam
beam2dB = elementos.newElement("ElasticBeam2d", xc.ID([1, 2]))
beam2dB.h = hbeam
Exemplo n.º 14
0
# Problem type
modelSpace = predefined_spaces.StructuralMechanics2D(nodes)
# Definimos el material
defSeccAggregation.defSeccAggregation2d(preprocessor, seccPrueba,
                                        matSeccPrueba)
nodes.defaultTag = 1  #First node number.
nod = nodes.newNodeXY(0, 0)
nod = nodes.newNodeXY(L, 0.0)

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

# Materials definition
scc = typical_materials.defElasticSection2d(preprocessor, "scc",
                                            seccPrueba.A(), matSeccPrueba.E,
                                            seccPrueba.Iz())

# Elements definition
elementos = preprocessor.getElementLoader
elementos.defaultTransformation = "lin"
elementos.defaultMaterial = "scc"
elementos.defaultMaterial = seccPrueba.nmb
elementos.numSections = 3  # Número de secciones a lo largo del elemento.
elementos.defaultTag = 1
beam2d = elementos.newElement("force_beam_column_2d", xc.ID([1, 2]))

# Constraints
coacciones = preprocessor.getConstraintLoader
fix_node_3dof.fixNode000(coacciones, 1)
Exemplo n.º 15
0
#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.

### Define materials.
beamSection = typical_materials.defElasticSection2d(prep, "beamSection", 3600,
                                                    1080000, 3225)

### Define ELEMENTS
# define geometric transformation: performs a linear geometric transformation
# of beam stiffness and resisting force from the basic system to the
# global-coordinate system
lin = modelSpace.newLinearCrdTransf("lin")
elements = prep.getElementHandler
elements.defaultTransformation = lin.name
elements.defaultMaterial = beamSection.name
beam2d = elements.newElement("ElasticBeam2d", xc.ID([n1.tag, n2.tag]))

## *** Loads ***
### define GRAVITY -------------------------------------------------------------
loadPatterns = prep.getLoadHandler.getLoadPatterns
gravityTS = loadPatterns.newTimeSeries("constant_ts", "ts")
Exemplo n.º 16
0
import xc_base
import geom
import xc
from solution import predefined_solutions
from model import predefined_spaces
from materials import typical_materials

feProblem= xc.FEProblem()
preprocessor=  feProblem.getPreprocessor
nodes= preprocessor.getNodeHandler
modelSpace= predefined_spaces.StructuralMechanics2D(nodes)
nodes.newSeedNode()

# Materials definition
scc= typical_materials.defElasticSection2d(preprocessor, "scc",area,Es,Iz)

pd= modelSpace.newPDeltaCrdTransf("pd")

seedElemHandler= preprocessor.getElementHandler.seedElemHandler
seedElemHandler.defaultTransformation= "pd"
seedElemHandler.defaultMaterial= "scc"
seedElemHandler.defaultTag= 1 #Tag for next element.
beam2d= seedElemHandler.newElement("ElasticBeam2d",xc.ID([0,0]))

points= preprocessor.getMultiBlockTopology.getPoints
pt1= points.newPntIDPos3d(1, geom.Pos3d(0.0,0.0,0) )
pt2= points.newPntIDPos3d(2, geom.Pos3d(0.0,H,0) )
pt3= points.newPntIDPos3d(3, geom.Pos3d(B,0.0,0) )
pt4= points.newPntIDPos3d(4, geom.Pos3d(B,H,0) )
pt5= points.newPntIDPos3d(5, geom.Pos3d(offset,0.0,0) )
nod = nodes.newNodeXY(0, 0)
nod = nodes.newNodeXY(1.0, 0.0)
nod = nodes.newNodeXY(2.0, 0.0)

# Geometric transformations
trfs = preprocessor.getTransfCooHandler
lin = trfs.newLinearCrdTransf2d("lin")

# Materials definition
# A:            cross-sectional area of the section
# E:            Young’s modulus of material
# I:            second moment of area about the local z-axis

scc = typical_materials.defElasticSection2d(
    preprocessor=preprocessor,
    name="scc",
    A=beamRCsect.lstRCSects[0].getAc(),
    E=beamRCsect.lstRCSects[0].concrType.Ecm(),
    I=beamRCsect.lstRCSects[0].getI())

# Elements definition
elementos = preprocessor.getElementHandler
elementos.defaultTransformation = "lin"
elementos.defaultMaterial = "scc"
#  sintaxis: beam2d_02[<tag>]
elementos.defaultTag = 1  #Tag for next element.
beam2dA = elementos.newElement("ElasticBeam2d", xc.ID([0, 1]))
beam2dA.h = hbeam
beam2dB = elementos.newElement("ElasticBeam2d", xc.ID([1, 2]))
beam2dB.h = hbeam

# Constraints
Exemplo n.º 18
0
__version__= "3.0"
__email__= "*****@*****.**"

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

# Geometric transformations
lin= modelSpace.newLinearCrdTransf("lin")
# Materials
section= typical_materials.defElasticSection2d(preprocessor, "section",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 next element.
beam2d= elements.newElement("ElasticBeam2d",xc.ID([1,2]))

setTotal= preprocessor.getSets.getSet("total")
elems= setTotal.getElements
for e in elems:
  crdTransf= e.getCoordTransf
  #print "vector I:",crdTransf.getIVector
  vILocal= crdTransf.getVectorLocalCoordFromGlobal(crdTransf.getIVector)
Exemplo n.º 19
0
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.
beam2d = seedElemLoader.newElement("elastic_beam_2d", xc.ID([0, 0]))
beam2d.h = h
beam2d.rho = m
Exemplo n.º 20
0
sectionTestMaterial= typical_materials.MaterialData("sectionTestMaterial",E=7E9,nu=0.3,rho=2500) # Section material.


# Problem type
modelSpace= predefined_spaces.StructuralMechanics2D(nodes)
# Definimos el material
defSeccAggregation.defSeccAggregation2d(preprocessor, sectionTest,sectionTestMaterial)
nodes.defaultTag= 1 #First node number.
nod= nodes.newNodeXY(0,0)
nod= nodes.newNodeXY(L,0.0)

# Geometric transformations
lin= modelSpace.newLinearCrdTransf("lin")
    
# Materials definition
scc= typical_materials.defElasticSection2d(preprocessor, "scc",sectionTest.A(),sectionTestMaterial.E,sectionTest.Iz())

# Elements definition
elements= preprocessor.getElementHandler
elements.defaultTransformation= "lin"
elements.defaultMaterial= "scc" 
elements.defaultMaterial= sectionTest.sectionName
elements.numSections= 3 # Number of sections along the element.
elements.defaultTag= 1
beam2d= elements.newElement("ForceBeamColumn2d",xc.ID([1,2]))
    
# Constraints
constraints= preprocessor.getBoundaryCondHandler
modelSpace.fixNode000(1)