Exemple #1
0
    def defElasticPlateSection(self, preprocessor,name,thickness):
      '''Constructs an elastic isotropic section material appropiate 
         for elastic analysis of plate elements.

      :param  preprocessor: preprocessor name
      :param  name:         name identifying the section
      :param  thickness:    section thickness.
      '''
      return typical_materials.defElasticPlateSection(preprocessor,name,E= self.getEcm(), nu=self.nuc ,rho= self.density(),h= thickness)
Exemple #2
0
    def defElasticPlateSection(self, preprocessor, name, thickness):
        '''Constructs an elastic isotropic section material appropiate 
         for elastic analysis of plate elements.

      :param  preprocessor: preprocessor name
      :param  name:         name identifying the section
      :param  thickness:    section thickness.
      '''
        return typical_materials.defElasticPlateSection(preprocessor,
                                                        name,
                                                        E=self.getEcm(),
                                                        nu=self.nuc,
                                                        rho=self.density(),
                                                        h=thickness)
Exemple #3
0
    def defElasticPlateSection(self, preprocessor, name, thickness):
        '''Constructs an elastic isotropic section material appropiate 
           for elastic analysis of plate elements.

        :param  preprocessor: preprocessor name
        :param  name: name identifying the section
        :param  thickness: section thickness.
        '''
        retval= None
        materialHandler= preprocessor.getMaterialHandler
        if(materialHandler.materialExists(name)):
            lmsg.warning("Section: "+name+" already defined.")
            retval= materialHandler.getMaterial(name)
        else:
            retval= typical_materials.defElasticPlateSection(preprocessor,name,E= self.getEcm(), nu=self.nuc ,rho= self.density(),h= thickness)
        return retval
__email__ = "*****@*****.**"

E = 2.1e6  # Young modulus of the steel.
nu = 0.3  # Poisson's ratio.
h = 0.1  # Thickness.

import xc_base
import geom
import xc
from model import predefined_spaces
from materials import typical_materials

# Model definition
feProblem = xc.FEProblem()
preprocessor = feProblem.getPreprocessor
# Define materials
elasticPlateSectionTest = typical_materials.defElasticPlateSection(
    preprocessor, "elasticPlateSectionTest", E, nu, 0.0, h)

ratio1 = (elasticPlateSectionTest.E - E) / E
ratio2 = (elasticPlateSectionTest.nu - nu) / nu
ratio3 = (elasticPlateSectionTest.h - h) / h

import os
from misc_utils import log_messages as lmsg
fname = os.path.basename(__file__)
if (abs(ratio1) < 1e-12) & (abs(ratio2) < 1e-12) & (abs(ratio3) < 1e-12):
    print("test ", fname, ": ok.")
else:
    lmsg.error(fname + ' ERROR.')
Exemple #5
0
from materials import typical_materials
import math

prueba = xc.ProblemaEF()
preprocessor = prueba.getPreprocessor
nodes = preprocessor.getNodeLoader

# Problem type
modelSpace = predefined_spaces.StructuralMechanics3D(nodes)
nodes.newNodeIDXYZ(1, 0, 0, 0)
nodes.newNodeIDXYZ(2, 2, 0, 0)
nodes.newNodeIDXYZ(3, 2, 1, 1)
nodes.newNodeIDXYZ(4, 0, 1, 1)

# Materials definition
memb1 = typical_materials.defElasticPlateSection(preprocessor, "memb1", E, nu,
                                                 0, h)

elementos = preprocessor.getElementLoader
elementos.defaultMaterial = "memb1"
elem = elementos.newElement("shell_mitc4", xc.ID([1, 2, 3, 4]))

v1 = xc.Vector([0, math.sqrt(2) / 2, math.sqrt(2) / 2])
v2 = xc.Vector([0, -math.sqrt(2) / 2, math.sqrt(2) / 2])
ratio1 = (elem.getCoordTransf.getG2Vector - v1).Norm()
ratio2 = (elem.getCoordTransf.getG3Vector - v2).Norm()
''' 
print "ratio1= ",ratio1
print "ratio2= ",ratio2
 '''

import os
__version__= "3.0"
__email__= "*****@*****.**"

E= 2.1e6 # Young modulus of the steel.
nu= 0.3 # Poisson's ratio.
h= 0.1 # Thickness.

import xc_base
import geom
import xc
from model import predefined_spaces
from materials import typical_materials

# Model definition
feProblem= xc.FEProblem()
preprocessor=  feProblem.getPreprocessor
# Define materials
elasticPlateSectionTest= typical_materials.defElasticPlateSection(preprocessor, "elasticPlateSectionTest",E,nu,0.0,h)

ratio1= (elasticPlateSectionTest.E-E)/E
ratio2= (elasticPlateSectionTest.nu-nu)/nu
ratio3= (elasticPlateSectionTest.h-h)/h

import os
from miscUtils import LogMessages as lmsg
fname= os.path.basename(__file__)
if (abs(ratio1)<1e-12) & (abs(ratio2)<1e-12) & (abs(ratio3)<1e-12):
  print "test ",fname,": ok."
else:
  lmsg.error(fname+' ERROR.')
Exemple #7
0
import math

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

# Problem type
modelSpace= predefined_spaces.StructuralMechanics3D(nodes)
nod1= nodes.newNodeXYZ(0,0,0)
nod2= nodes.newNodeXYZ(2,0,0)
nod3= nodes.newNodeXYZ(2,1,1)
nod4= nodes.newNodeXYZ(0,1,1)


# Materials definition
memb1= typical_materials.defElasticPlateSection(preprocessor, "memb1",E,nu,0,h)

elements= preprocessor.getElementHandler
elements.defaultMaterial= "memb1"
elem= elements.newElement("ShellMITC4",xc.ID([nod1.tag,nod2.tag,nod3.tag,nod4.tag]))

v1= xc.Vector([0,math.sqrt(2)/2,math.sqrt(2)/2])
v2= xc.Vector([0,-math.sqrt(2)/2,math.sqrt(2)/2])
ratio1= (elem.getCoordTransf.getG2Vector-v1).Norm()
ratio2= (elem.getCoordTransf.getG3Vector-v2).Norm()

''' 
print "ratio1= ",ratio1
print "ratio2= ",ratio2
 '''
__version__ = "3.0"
__email__ = "*****@*****.**"

E = 2.1e6  # Young modulus of the steel.
nu = 0.3  # Poisson's ratio.
h = 0.1  # Espesor.

import xc_base
import geom
import xc
from model import predefined_spaces
from materials import typical_materials

# Model definition
prueba = xc.ProblemaEF()
preprocessor = prueba.getPreprocessor
# Define materials
prueba = typical_materials.defElasticPlateSection(preprocessor, "prueba", E,
                                                  nu, 0.0, h)

ratio1 = (prueba.E - E) / E
ratio2 = (prueba.nu - nu) / nu
ratio3 = (prueba.h - h) / h

import os
fname = os.path.basename(__file__)
if (abs(ratio1) < 1e-12) & (abs(ratio2) < 1e-12) & (abs(ratio3) < 1e-12):
    print "test ", fname, ": ok."
else:
    print "test ", fname, ": ERROR."