def createMaterials(self,preprocessor,name): #elastic materials (los incializamos aquí para luego aplicar el módulo elástico que corresponda a cada nudo) self.xSpringName= name + '_xSpring' self.xSpring=typical_materials.defElasticMaterial(preprocessor,self.xSpringName,0.1) self.ySpringName= name + '_ySpring' self.ySpring=typical_materials.defElasticMaterial(preprocessor,self.ySpringName,0.1) self.zSpringName= name + '_zSpring' self.zSpring=typical_materials.defElasticMaterial(preprocessor,self.zSpringName,1)
def defineMaterials(self,preprocessor): '''Define the materials to modelize the pot (Teflon). Args: :preprocessor: (:obj:'Preprocessor') preprocessor to use. :matKX: (str) name for the uniaxial material in direction X. :matKY: (str) name for the uniaxial material in direction Y. ''' self.materialHandler= preprocessor.getMaterialHandler # Material names. nameRoot= 'pot'+str(self.id) self.matXName= nameRoot+'X' self.matYName= nameRoot+'Y' self.materials.extend([self.matXName, self.matYName]) # Material objects. self.matKX= typical_materials.defElasticMaterial(preprocessor, self.matXName, self.getHorizontalStiffness()) self.matKY= typical_materials.defElasticMaterial(preprocessor, self.matYName, self.getHorizontalStiffness())
def createSpringMaterials(self): '''create the spring materials in X, Y, Z directions. If there is no spring in any of these directions, its corresponding material is equal to None ''' if self.Kx != 0: typical_materials.defElasticMaterial(self.modelSpace.preprocessor,self.name + '_xSpring',self.Kx) self.springMat[0]=self.name + '_xSpring' if self.Ky != 0: typical_materials.defElasticMaterial(self.modelSpace.preprocessor,self.name + '_ySpring',self.Ky) self.springMat[1]=self.name + '_ySpring' if self.Kz != 0: typical_materials.defElasticMaterial(self.modelSpace.preprocessor,self.name + '_zSpring',self.Kz) self.springMat[2]=self.name + '_zSpring'
def defineMaterials(self,preprocessor): '''Define the materials to modelize the elastomeric bearing. Args: :preprocessor: (:obj:'Preprocessor') preprocessor to use. ''' self.materialHandler= preprocessor.getMaterialHandler # Material names. nameRoot= 'neop'+str(self.id) self.matXName= nameRoot+'X' self.matYName= nameRoot+'Y' self.matZName= nameRoot+'Z' self.matTHXName= nameRoot+'THX' self.matTHYName= nameRoot+'THY' self.matTHZName= nameRoot+'THZ' self.materials.extend([self.matXName, self.matYName, self.matZName]) self.materials.extend([self.matTHXName, self.matTHYName, self.matTHZName]) # Material objects. self.matKX= typical_materials.defElasticMaterial(preprocessor, self.matXName, self.getKhoriz()) self.matKY= typical_materials.defElasticMaterial(preprocessor, self.matYName, self.getKhoriz()) self.matKZ= typical_materials.defElasticMaterial(preprocessor, self.matZName, self.getKvert()) self.matKTHX= typical_materials.defElasticMaterial(preprocessor, self.matTHXName, self.getKrotationLintelAxis()) self.matKTHY= typical_materials.defElasticMaterial(preprocessor, self.matTHYName, self.getKrotationBridgeAxis()) self.matKTHZ= typical_materials.defElasticMaterial(preprocessor, self.matTHZName, self.getKrotationVerticalAxis())
__author__= "Luis C. Pérez Tato (LCPT) and Ana Ortega (AO_O)" __copyright__= "Copyright 2015, LCPT and AO_O" __license__= "GPL" __version__= "3.0" __email__= "*****@*****.**" Ec= 20e9 sideLength= 1.0 feProblem= xc.FEProblem() preprocessor= feProblem.getPreprocessor concrete= typical_materials.defElasticMaterial(preprocessor, 'concrete',Ec) sectionGeometryTest= preprocessor.getMaterialHandler.newSectionGeometry("sectionGeometryTest") regions= sectionGeometryTest.getRegions concrete= regions.newQuadRegion('concrete') concrete.pMin= geom.Pos2d(0.0,0.0) concrete.pMax= geom.Pos2d(1.0,1.0) pt= EHE_limit_state_checking.computeEffectiveHollowSectionParameters(sectionGeometryTest,0.5,0.03) ratio1= (pt.A()-1) ratio2= (pt.u()-4)/4 ratio3= (pt.he()-0.25)/0.25 ratio4= (pt.Ae()-(0.75**2))/(0.75**2) ratio5= (pt.ue()-3)/3
from solution import predefined_solutions from model import predefined_spaces from materials import typical_materials # Problem type # Model definition feProblem= xc.FEProblem() preprocessor= feProblem.getPreprocessor nodes= preprocessor.getNodeHandler modelSpace= predefined_spaces.StructuralMechanics3D(nodes) nodes.defaultTag= 1 #First node number. nod= nodes.newNodeXYZ(1,1,1) # Define materials kx= typical_materials.defElasticMaterial(preprocessor, "kx",KX) ky= typical_materials.defElasticMaterial(preprocessor, "ky",KY) fixedNode, newElement= modelSpace.setBearingOnXYRigZ(nod.tag,["kx","ky"]) # Constraints constraints= preprocessor.getBoundaryCondHandler # spc= constraints.newSPConstraint(nod.tag,3,0.0) # nod1 Rx= 0,Ry= 0 and Rz= 0 spc= constraints.newSPConstraint(nod.tag,4,0.0) spc= constraints.newSPConstraint(nod.tag,5,0.0) # Loads definition
def getRespT(self,preprocessor,JTorsion): '''Material for modeling torsional response of section''' return typical_materials.defElasticMaterial(preprocessor,self.respTName(),self.concrType.Gcm()*JTorsion) # Torsional response of the section.
nodes= preprocessor.getNodeHandler # Problem type modelSpace= predefined_spaces.StructuralMechanics2D(nodes) nodes.defaultTag= 1 #First node number. nod= nodes.newNodeXY(0,0.0) nod= nodes.newNodeXY(L*math.sqrt(2)/2,L*math.sqrt(2)/2) # Geometric transformation(s) lin= modelSpace.newLinearCrdTransf("lin") # Materials definition fy= 275e6 # Yield stress of the steel. steel= typical_materials.defSteel01(preprocessor, "steel",E,fy,0.001) respT= typical_materials.defElasticMaterial(preprocessor, "respT",G*J) # Torsion response. respVy= typical_materials.defElasticMaterial(preprocessor, "respVy",1e9) # Shear response in y direction. respVz= typical_materials.defElasticMaterial(preprocessor, "respVz",1e9) # Shear response in z direction. # Secciones import os pth= os.path.dirname(__file__) #print "pth= ", pth if(not pth): pth= "." execfile(pth+"/../aux/testQuadRegion.py") materiales= preprocessor.getMaterialHandler quadFibers= materiales.newMaterial("fiber_section_3d","quadFibers") fiberSectionRepr= quadFibers.getFiberSectionRepr() fiberSectionRepr.setGeomNamed("testQuadRegion") quadFibers.setupFibers()
F = 10000 E = 5200 I = 342990 beta = 3 * math.pi / L k = pow(beta, 4) * 4 * E * I h = pow(12 * I, 1 / 3) A = h # Suponemos width unidad # Problem type feProblem = xc.FEProblem() preprocessor = feProblem.getPreprocessor nodes = preprocessor.getNodeHandler modelSpace = predefined_spaces.StructuralMechanics2D(nodes) # Define materials kY = typical_materials.defElasticMaterial(preprocessor, "kY", k * L / numDiv) # Geometric transformations lin = modelSpace.newLinearCrdTransf("lin") # Define materials scc = typical_materials.defElasticSection2d(preprocessor, "scc", A, E, I) seedElemHandler = preprocessor.getElementHandler.seedElemHandler seedElemHandler.defaultTransformation = lin.name seedElemHandler.defaultMaterial = scc.name seedElemHandler.defaultTag = 1 # Tag for next element. beam2d = seedElemHandler.newElement("ElasticBeam2d", xc.ID([0, 0])) beam2d.h = h points = preprocessor.getMultiBlockTopology.getPoints
#Materials # Concrete. concrete= SIA262_materials.c25_30 Ec= concrete.getEcm() deckThickness= 0.35 deckUnitWeight= deckThickness*25e3 parapetUnitWeight= deckUnitWeight sccDeck= section_properties.RectangularSection("sccDeck",1.0,deckThickness)#,Ec,0.2) matData= typical_materials.MaterialData(name='deckConcrete',E=Ec,nu=0.2,rho=2500) matDeck= sccDeck.defElasticShearSection2d(preprocessor,matData) # Masonry bearing. kSpandrel= 5e8 #kYSpandrel= typical_materials.defElastNoTensMaterial(preprocessor, "kYSpandrel",kSpandrel) kYSpandrel= typical_materials.defElasticMaterial(preprocessor, "kYSpandrel",kSpandrel) kXSpandrel= typical_materials.defElasticMaterial(preprocessor, "kXSpandrel",kSpandrel/10.0) kFill= 5e7 #kYFill= typical_materials.defElastNoTensMaterial(preprocessor, "kYFill",kFill) kYFill= typical_materials.defElasticMaterial(preprocessor, "kYFill",kFill) kXFill= typical_materials.defElasticMaterial(preprocessor, "kXFill",kFill/10.0) #Mesh modelSpace= predefined_spaces.StructuralMechanics2D(nodes) nodes.newSeedNode() trfs= preprocessor.getTransfCooHandler lin= trfs.newLinearCrdTransf2d("lin") seedElemHandler= preprocessor.getElementHandler.seedElemHandler seedElemHandler.defaultMaterial= "sccDeck" seedElemHandler.defaultTransformation= "lin" elem= seedElemHandler.newElement("ElasticBeam2d",xc.ID([0,0]))
import os pth= os.path.dirname(__file__) if(not pth): pth= "." #print "pth= ", pth execfile(pth+"/macros_test_fiber_section.py") fy= 2600 # yield strength [kp/cm2]. E= 1e6 # elastic moculus [kp/cm2]. prueba= xc.ProblemaEF() prueba.logFileName= "/tmp/borrar.log" # Ignore warning messages preprocessor= prueba.getPreprocessor # Materials definition elast= typical_materials.defElasticMaterial(preprocessor, "elast",E) respT= typical_materials.defElasticMaterial(preprocessor, "respT",1e6) # Respuesta de la sección a torsión. respVy= typical_materials.defElasticMaterial(preprocessor, "respVy",1e6) # Respuesta de la sección a cortante según y. respVz= typical_materials.defElasticMaterial(preprocessor, "respVz",1e6) # Respuesta de la sección a cortante según y. # Section geometry #creation geomRectang= preprocessor.getMaterialLoader.newSectionGeometry("geomRectang") reg= scc1x1.discretization(geomRectang,"elast") sa= preprocessor.getMaterialLoader.newMaterial("fiberSectionShear3d","sa") fiberSectionRepr= sa.getFiberSectionRepr() fiberSectionRepr.setGeomNamed("geomRectang") sa.setupFibers() extraeParamSccFibras(sa,scc1x1) sa.setRespVyByName("respVy") sa.setRespVzByName("respVz")
__author__ = "Luis C. Pérez Tato (LCPT) and Ana Ortega (AOO)" __copyright__ = "Copyright 2015, LCPT and AOO" __license__ = "GPL" __version__ = "3.0" __email__ = "*****@*****.**" Es = 2.1e11 nu = 0.3 Gs = 0.01 * Es / (2 * (1 + nu)) radius = 1.2 / 2.0 thickness = 10.3e-3 RExt = radius + thickness feProblem = xc.FEProblem() preprocessor = feProblem.getPreprocessor steel = typical_materials.defElasticMaterial(preprocessor, "steel", Es) geomTuberia = preprocessor.getMaterialHandler.newSectionGeometry("geomTuberia") regions = geomTuberia.getRegions steelRegion = regions.newCircularRegion("steel") steelRegion.nDivCirc = 1000 steelRegion.centro = geom.Pos2d(0.0, 0.0) steelRegion.extRad = radius + thickness steelRegion.intRad = radius steelRegion.initAngle = 0.0 steelRegion.finalAngle = 2 * math.pi area = steelRegion.getArea() Iy = steelRegion.getIy() Iz = steelRegion.getIz() Pyz = steelRegion.getPyz()
def getRespVz(self,preprocessor): '''Material for modeling z shear response of section''' return typical_materials.defElasticMaterial(preprocessor,self.respVzName(),5/6.0*self.b*self.h*self.concrType.Gcm())
def getRespT(self,preprocessor,JTorsion): '''Material for modeling torsional response of section''' return typical_materials.defElasticMaterial(preprocessor,self.respTName(),self.concrType.Gcm()*JTorsion) # Torsional response of the section.
import xc_base import geom import xc from model import predefined_spaces from materials import typical_materials import math Es= 2.1e11 n= 15.0 Ec= Es/n areaFi16= 2.01e-4 feProblem= xc.FEProblem() preprocessor= feProblem.getPreprocessor steel= typical_materials.defElasticMaterial(preprocessor, "steel",Es) sectionGeometryTest= preprocessor.getMaterialHandler.newSectionGeometry("sectionGeometryTest") reinforcement= sectionGeometryTest.getReinfLayers reinforcementA= reinforcement.newStraightReinfLayer("steel") reinforcementA.numReinfBars= 2 reinforcementA.barDiam= 16e-3 reinforcementA.barArea= areaFi16 reinforcementA.p1= geom.Pos2d(0.05,0.95) # bottom layer. reinforcementA.p2= geom.Pos2d(0.05,0.05) reinforcementB= reinforcement.newStraightReinfLayer("steel") reinforcementB.numReinfBars= 2 reinforcementB.barDiam= 16e-3 reinforcementB.barArea= areaFi16 reinforcementB.p1= geom.Pos2d(0.95,0.95) # bottom layer. reinforcementB.p2= geom.Pos2d(0.95,0.05)
nod2 = nodes.newNodeXYZ(l, 0, 0) #node 2 nod3 = nodes.newNodeXYZ(0, l, 0) nod4 = nodes.newNodeXYZ(l, l, 0) # Materials definition cable = typical_materials.defCableMaterial(preprocessor, name="cable", E=E, prestress=sigmaPret, rho=0.0) #uniaxial bilinear prestressed material. The stress strain ranges #from slack (large strain at zero stress) to taught #(linear with modulus E). #rho= effective self weight (gravity component of weight per # volume transverse to the cable) strutMat = typical_materials.defElasticMaterial( preprocessor, name="strutMat", E=E) #elastic uniaxial material # Elements definition elements.defaultMaterial = "cable" elements.defaultTag = 1 #First element number. elements.dimElem = 3 ctruss1 = elements.newElement("CorotTruss", xc.ID([1, 2])) ctruss1.area = area ctruss2 = elements.newElement("CorotTruss", xc.ID([1, 3])) ctruss2.area = area ctruss3 = elements.newElement("CorotTruss", xc.ID([2, 4])) ctruss3.area = area ctruss4 = elements.newElement("CorotTruss", xc.ID([3, 4])) ctruss4.area = area elements.defaultMaterial = "strutMat" ctruss5 = elements.newElement("CorotTruss", xc.ID([1, 4]))
indDiag = [ljInd[i] for i in range(len(ljInd)) if 'diag' in ljInd[i]] for i in indDiag: 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()
from materials import typical_materials from materials.ehe import EHE_limit_state_checking __author__ = "Luis C. Pérez Tato (LCPT) and Ana Ortega (AO_O)" __copyright__ = "Copyright 2015, LCPT and AO_O" __license__ = "GPL" __version__ = "3.0" __email__ = "*****@*****.**" Ec = 20e9 sideLength = 1.0 feProblem = xc.FEProblem() preprocessor = feProblem.getPreprocessor concrete = typical_materials.defElasticMaterial(preprocessor, 'concrete', Ec) sectionGeometryTest = preprocessor.getMaterialHandler.newSectionGeometry( "sectionGeometryTest") regions = sectionGeometryTest.getRegions concrete = regions.newQuadRegion('concrete') concrete.pMin = geom.Pos2d(0.0, 0.0) concrete.pMax = geom.Pos2d(1.0, 1.0) pt = EHE_limit_state_checking.computeEffectiveHollowSectionParameters( sectionGeometryTest, 0.5, 0.03) ratio1 = (pt.A() - 1) ratio2 = (pt.u() - 4) / 4 ratio3 = (pt.he() - 0.25) / 0.25 ratio4 = (pt.Ae() - (0.75**2)) / (0.75**2) ratio5 = (pt.ue() - 3) / 3
from materials import typical_materials import math # Problem type feProblem= xc.FEProblem() preprocessor= feProblem.getPreprocessor nodes= preprocessor.getNodeHandler modelSpace= predefined_spaces.StructuralMechanics2D(nodes) # Model definition nodes.defaultTag= 1 #First node number. nod= nodes.newNodeXY(1,1) nod= nodes.newNodeXY(1,1) # Materials definition k= typical_materials.defElasticMaterial(preprocessor, "k",K) ''' We define nodes at the points where loads will be applied. We will not compute stresses so we can use an arbitrary cross section of unit area.''' # Elements definition elements= preprocessor.getElementHandler elements.defaultMaterial= "k" elements.dimElem= 3 # Dimension of element space elements.deraultTag= 1 zl1= elements.newElement("ZeroLength",xc.ID([1,2])) zl1.setupVectors(xc.Vector([1,1,0]),xc.Vector([-1,1,0])) zl1.clearMaterials() zl1.setMaterial(0,"k")
from model import predefined_spaces from materials import typical_materials # Problem type feProblem = xc.FEProblem() preprocessor = feProblem.getPreprocessor nodes = preprocessor.getNodeHandler modelSpace = predefined_spaces.StructuralMechanics3D(nodes) # Model definition nodes.defaultTag = 1 #First node number. nod = nodes.newNodeXYZ(1, 1, 1) nod = nodes.newNodeXYZ(1, 1, 1) # Materials definition kx = typical_materials.defElasticMaterial(preprocessor, "kx", KX) ky = typical_materials.defElasticMaterial(preprocessor, "ky", KY) kz = typical_materials.defElasticMaterial(preprocessor, "kz", KZ) ''' We define nodes at the points where loads will be applied. We will not compute stresses so we can use an arbitrary cross section of unit area.''' # Elements definition elements = preprocessor.getElementHandler elements.defaultMaterial = "kx" elements.dimElem = 3 # Dimension of element space zl = elements.newElement("ZeroLength", xc.ID([1, 2])) zl.clearMaterials() zl.setMaterial(0, "kx") zl.setMaterial(1, "ky") zl.setMaterial(2, "kz")
feProblem = xc.FEProblem() preprocessor = feProblem.getPreprocessor modelSpace = predefined_spaces.StructuralMechanics3D( preprocessor.getNodeHandler) ######################################################### # Material definition. lumber4x2 = section_properties.RectangularSection("lumber4x2", b=3.5 * inchToMeter, h=1.5 * inchToMeter) wood = typical_materials.MaterialData(name='wood', E=12.4e9, nu=0.33, rho=500) chordSectionsGeometry = lumber4x2 chordsSection = chordSectionsGeometry.defElasticShearSection3d( preprocessor, wood) diagonalSectionsGeometry = lumber4x2 diagonalsMaterial = typical_materials.defElasticMaterial( preprocessor, "diagonalsMaterial", wood.E) postsSection = chordsSection depth = 22 * inchToMeter - chordSectionsGeometry.h panelSize = 60 * inchToMeter span = feetToMeter * 31.0 + 5 * inchToMeter ######################################################### # Mesh generation. lowerChordAxis = geom.Segment3d(geom.Pos3d(0.0, 0.0, 0.0), geom.Pos3d(span, 0.0, 0.0)) upperChordAxis = geom.Segment3d(geom.Pos3d(0.0, 0.0, depth), geom.Pos3d(span, 0.0, depth)) truss = truss_generators.FanTruss(lowerChordAxis, upperChordAxis, trussModule=panelSize)
def generateSpringsPile(self,alphaKh_x,alphaKh_y,alphaKv_z): '''Generate the springs that simulate the soils along the pile :param alphaKh_x: coefficient to be applied to the horizontal stiffness of a single pile in X direction :param alphaKh_y: coefficient to be applied to the horizontal stiffness of a single pile in Y direction :param alphaKh_Z: coefficient to be applied to the vertical stiffness of a single pile in Z direction ''' prep=self.setPile.getPreprocessor #init spring elastic materials springX=typical_materials.defElasticMaterial(prep,'springX',1e-5) springY=typical_materials.defElasticMaterial(prep,'springY',1e-5) springZ=typical_materials.defElasticMaterial(prep,'springZ',1e-5) self.setPile.resetTributaries() self.setPile.computeTributaryLengths(False) lstNodPile=[(n,n.get3dCoo[2]) for n in self.setPile.nodes] lstNodPile.sort(key=takeSecond,reverse=True) #z in descending order if self.soilsProp[-1][0] >= lstNodPile[-1][1]: self.soilsProp[-1][0]=lstNodPile[-1][1]-1 zval=lstNodPile[0][1] while zval > self.groundLevel: #aerial zone of pile lstNodPile.pop(0) zval=lstNodPile[0][1] modelSpace= predefined_spaces.getModelSpace(prep) #Springs horizontal stiffness z=lstNodPile[0][1] self.springs= list() #spring elements. if self.pileDiam <= 1: coefKh=1 else: coefKh=self.pileDiam for s in range(len(self.soilsProp)): zBottom=self.soilsProp[s][0] soilType=self.soilsProp[s][1][:2].lower() soilPrp=self.soilsProp[s][2] if soilType not in ('sa','cl'): lmsg.warning('wrong type of soil') while z>zBottom: n=lstNodPile[0][0] lnTribNod=n.getTributaryLength() if soilType == 'sa': #sandy soil Kh_x=alphaKh_x*soilPrp*(self.groundLevel-z)*lnTribNod*coefKh Kh_y=alphaKh_y*soilPrp*(self.groundLevel-z)*lnTribNod*coefKh else: Kh_x=75*alphaKh_x*soilPrp*lnTribNod*coefKh Kh_y=75*alphaKh_y*soilPrp*lnTribNod*coefKh springX.E=Kh_x springY.E=Kh_y if len(lstNodPile)==1: #Spring vertical stiffness (end of pile) Kv_end=alphaKv_z*self.getVerticalStiffnessSinglePile() springZ.E=Kv_end nn= modelSpace.setBearing(n.tag,['springX','springY','springZ']) self.springs.append(nn[1]) break else: nn= modelSpace.setBearing(n.tag,['springX','springY','springZ']) self.springs.append(nn[1]) z=lstNodPile[1][1] lstNodPile.pop(0) return
piersRCSects.dir1ShReinfY=rcs.ShearReinforcement(familyName= "sh",nShReinfBranches=pierStirrups[1],areaShReinfBranch= math.pi*(pierStirrups[0]*1e-3)**2/4.,shReinfSpacing=pierStirrups[2]*1e-3,angAlphaShReinf= math.pi/2.0,angThetaConcrStruts= math.pi/4.0) piersRCSects.dir2ShReinfY=rcs.ShearReinforcement(familyName= "sh",nShReinfBranches=pierStirrups[1],areaShReinfBranch= math.pi*(pierStirrups[0]*1e-3)**2/4.,shReinfSpacing=pierStirrups[2]*1e-3,angAlphaShReinf= math.pi/2.0,angThetaConcrStruts= math.pi/4.0) # All this is made only to allow the # creation of the RCMaterialDistribution feProblem= xc.FEProblem() preprocessor= feProblem.getPreprocessor nodeHandler= preprocessor.getNodeHandler nodeHandler.dimSpace= 1 # One coordinate for each node. nodeHandler.numDOFs= 1 # One degree of freedom for each node. n1= nodeHandler.newNodeX(1) n2= nodeHandler.newNodeX(2) elementHandler= preprocessor.getElementHandler elementHandler.dimElem= 1 #Bars defined in a two dimensional space. fakeMaterial= typical_materials.defElasticMaterial(preprocessor, "fakeMaterial",10) elementHandler.defaultMaterial= fakeMaterial.name fakeElement= elementHandler.newElement("ZeroLength",xc.ID([0,0])) fakeElement.setVerbosityLevel(0) # Avoid warning about set element tag fakeElement.tag= 3063 fakeElement.setVerbosityLevel(1) xcTotalSet= preprocessor.getSets.getSet('total') fakeElementSet= xcTotalSet.getElements # end of the fake stuff. # Store the section in the structure that the "phantom model" uses reinfConcreteSectionDistribution= RC_material_distribution.RCMaterialDistribution() sections= reinfConcreteSectionDistribution.sectionDefinition #sections container sections.append(piersRCSects) reinfConcreteSectionDistribution.assign(fakeElementSet,setRCSects=piersRCSects)
indDiag = [ljInd[i] for i in range(len(ljInd)) if 'diag' in ljInd[i]] for i in indDiag: 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) #cables materials diagCableMat = typical_materials.defCableMaterial( preprocessor=prep, name='diagCableMat', E=EdiagCable, prestress=sigmaPrestrDiagCable, rho=rhoDiagCable) saddCableMat = typical_materials.defCableMaterial( preprocessor=prep, name='saddCableMat', E=EdiagCable, prestress=sigmaPrestrSaddCable, rho=rhoSaddCable)
__version__ = "3.0" __email__ = "*****@*****.**" Es = 2.1e11 n = 7.365 Ec = Es / n b = 1.0 # Ancho eficaz de ala. bw = 0.25 # Ancho del nervio. hf = 0.08 # Canto del ala. d = 0.57 # Canto útil. diamBar = 22e-3 # Diámetro de los redondos. areaBar = math.pi * (diamBar / 2)**2 # Área de los redondos. prueba = xc.ProblemaEF() preprocessor = prueba.getPreprocessor hormigon = typical_materials.defElasticMaterial(preprocessor, "hormigon", Ec) acero = typical_materials.defElasticMaterial(preprocessor, "acero", Es) geomPrueba = preprocessor.getMaterialLoader.newSectionGeometry("geomPrueba") regiones = geomPrueba.getRegions ala = regiones.newQuadRegion("hormigon") # Ala ala.pMin = geom.Pos2d(d - hf, 0.0) ala.pMax = geom.Pos2d(d, b) nervio = regiones.newQuadRegion("hormigon") # Nervio nervio.pMin = geom.Pos2d(0.0, b / 2 - bw / 2) nervio.pMax = geom.Pos2d(d - hf, b / 2 + bw / 2) reinforcement = geomPrueba.getReinfLayers reinforcementA = reinforcement.newStraightReinfLayer("acero") reinforcementA.numReinfBars = 5 reinforcementA.barArea = areaBar
E= 2.1e6*9.81/1e-4 # Elastic modulus alpha= 1.2e-5 # Thermal expansion coefficient of the steel A= 4e-4 # bar area expressed in square meters AT= 10 # Temperature increment (Celsius degrees) # Problem type feProblem= xc.FEProblem() preprocessor= feProblem.getPreprocessor nodes= preprocessor.getNodeHandler modelSpace= predefined_spaces.SolidMechanics2D(nodes) nod1= nodes.newNodeXY(0.0,0.0) nod2= nodes.newNodeXY(L,0.0) # Materials definition elast= typical_materials.defElasticMaterial(preprocessor, "elast",E) # Elements definition elements= preprocessor.getElementHandler elements.defaultMaterial= elast.name elements.dimElem= 2 # Dimension of element space truss= elements.newElement("Truss",xc.ID([nod1.tag,nod2.tag])) truss.sectionArea= A # Constraints constraints= preprocessor.getBoundaryCondHandler spc1= constraints.newSPConstraint(nod1.tag,0,0.0) spc2= constraints.newSPConstraint(nod1.tag,1,0.0) spc3= constraints.newSPConstraint(nod2.tag,0,0.0) spc4= constraints.newSPConstraint(nod2.tag,1,0.0)
F= 10000 E= 5200 I= 342990 beta= 3*math.pi/L k= pow(beta,4)*4*E*I h= pow(12*I,1/3) A= h # Suponemos width unidad # Problem type feProblem= xc.FEProblem() preprocessor= feProblem.getPreprocessor nodes= preprocessor.getNodeHandler modelSpace= predefined_spaces.StructuralMechanics2D(nodes) # Define materials kY= typical_materials.defElasticMaterial(preprocessor, "kY",k*L/numDiv) nodes.newSeedNode() # Geometric transformations lin= modelSpace.newLinearCrdTransf("lin") # Define materials scc= typical_materials.defElasticSection2d(preprocessor, "scc",A,E,I) seedElemHandler= preprocessor.getElementHandler.seedElemHandler seedElemHandler.defaultTransformation= "lin" seedElemHandler.defaultMaterial= "scc" seedElemHandler.defaultTag= 1 #Tag for next element. beam2d= seedElemHandler.newElement("ElasticBeam2d",xc.ID([0,0])) beam2d.h= h
def getRespVz(self,preprocessor): '''Material for modeling z shear response of section''' return typical_materials.defElasticMaterial(preprocessor,self.respVzName(),5/6.0*self.b*self.h*self.concrType.Gcm())
def getRespT(self,preprocessor, G): '''return an elastic material for modeling torsional response of section''' return typical_materials.defElasticMaterial(preprocessor,self.respTName(),self.getTorsionalStiffness(G)) # Torsional response of the section.
def getRespVz(self, preprocessor, G): '''Material for modeling Z shear response of section''' return typical_materials.defElasticMaterial(preprocessor, self.respVzName(), self.getShearStiffnessZ(G))
from model import predefined_spaces from materials import typical_materials # Problem type feProblem = xc.FEProblem() preprocessor = feProblem.getPreprocessor nodes = preprocessor.getNodeHandler modelSpace = predefined_spaces.StructuralMechanics2D(nodes) # Model definition nodes.defaultTag = 1 #First node number. nod = nodes.newNodeXY(1, 1) nod = nodes.newNodeXY(1, 1) # Materials definition k = typical_materials.defElasticMaterial(preprocessor, "k", K) ''' We define nodes at the points where loads will be applied. We will not compute stresses so we can use an arbitrary cross section of unit area.''' # Elements definition elements = preprocessor.getElementHandler elements.defaultMaterial = "k" elements.dimElem = 3 # Dimension of element space zl = elements.newElement("ZeroLength", xc.ID([1, 2])) zl.clearMaterials() zl.setupVectors(xc.Vector([0, 1, 0]), xc.Vector([-1, 0, 0])) zl.setMaterial(0, "k") # Constraints constraints = preprocessor.getBoundaryCondHandler
import os pth= os.path.dirname(__file__) if(not pth): pth= "." #print "pth= ", pth execfile(pth+"/fiber_section_test_macros.py") fy= 2600 # yield strength [kp/cm2]. E= 1e6 # elastic moculus [kp/cm2]. feProblem= xc.FEProblem() feProblem.logFileName= "/tmp/erase.log" # Ignore warning messages preprocessor= feProblem.getPreprocessor # Materials definition elast= typical_materials.defElasticMaterial(preprocessor, "elast",E) respT= typical_materials.defElasticMaterial(preprocessor, "respT",1e6) # Torsion response. respVy= typical_materials.defElasticMaterial(preprocessor, "respVy",1e6) # Shear response in y direction. respVz= typical_materials.defElasticMaterial(preprocessor, "respVz",1e6) # Shear response in y direction. # Section geometry #creation geomRectang= preprocessor.getMaterialHandler.newSectionGeometry("geomRectang") reg= scc1x1.getRegion(geomRectang,"elast") sa= preprocessor.getMaterialHandler.newMaterial("fiberSectionShear3d","sa") fiberSectionRepr= sa.getFiberSectionRepr() fiberSectionRepr.setGeomNamed("geomRectang") sa.setupFibers() extractFiberSectionProperties(sa,scc1x1) sa.setRespVyByName("respVy") sa.setRespVzByName("respVz")
wall.stemReinforcement.setReinforcement(4,A10_15.getCopy('C')) wall.stemReinforcement.setReinforcement(6,A12_15.getCopy('C')) wall.stemReinforcement.setReinforcement(11,A14_15.getCopy('B')) wall.footingReinforcement.setReinforcement(3,D1618_15.getCopy('C')) wall.footingReinforcement.setReinforcement(7,A10_15.getCopy('C')) wall.footingReinforcement.setReinforcement(8,D1618_15.getCopy('B')) wallFEModel= wall.createFEProblem('Retaining wall A') preprocessor= wallFEModel.getPreprocessor nodes= preprocessor.getNodeHandler #Soil kS= 40e6 #Module de réaction du sol (estimé). #print 'kS= ', kS/1e6 kX= typical_materials.defElasticMaterial(preprocessor, "kX",kS/10.0) kY= typical_materials.defElasticMaterial(preprocessor, "kY",kS) #kY= typical_materials.defElastNoTensMaterial(preprocessor, "kY",kS) backFillSoilModel= ep.RankineSoil(phi= math.radians(32),rho= 2000) #Characteristic values. backFillDelta= 0.0#2.0/3.0*backFillSoilModel.phi hi= [0.65,100.0] rhoi= [2000,2100] phii= [math.radians(34),math.radians(28)] ci= [3e3,7e3] stratifiedSoil= fcs.StratifiedSoil(hi,rhoi,phii,ci) foundationSoilModel= stratifiedSoil.getEquivalentSoil(Beff= 2.5,gMPhi= 1.2,gMc= 1.5) #Design values. #Mesh. wall.genMesh(nodes,[kX,kY])
# Model definition feProblem= xc.FEProblem() preprocessor= feProblem.getPreprocessor nodes= preprocessor.getNodeHandler # Problem type modelSpace= predefined_spaces.SolidMechanics2D(nodes) nodes.defaultTag= 1 #First node number. nod= nodes.newNodeXY(0,0) nod= nodes.newNodeXY(0.0,l-a-b) nod= nodes.newNodeXY(0.0,l-a) nod= nodes.newNodeXY(0.0,l) # Materials definition elast= typical_materials.defElasticMaterial(preprocessor, "elast",E) ''' We define nodes at the points where loads will be applied. We will not compute stresses so we can use an arbitrary cross section of unit area.''' # Elements definition elements= preprocessor.getElementHandler elements.defaultMaterial= "elast" elements.dimElem= 2 # Dimension of element space # sintaxis: truss[<tag>] elements.defaultTag= 1 #Tag for the next element. truss= elements.newElement("Truss",xc.ID([1,2])) truss.area= 1 truss= elements.newElement("Truss",xc.ID([2,3])) truss.area= 1
print 'number of spring lines: ', len(springLines.getLines) length = 0.0 springNodes = preprocessor.getSets.defSet("springLines") for l in springLines.getLines: length += l.getLength() for n in l.nodes: springNodes.nodes.append(n) tributaryLength = length / len(springNodes.nodes) print 'length= ', length print 'number of spring nodes= ', len(springNodes.nodes) print 'tributaryLength= ', tributaryLength kV = typical_materials.defElasticMaterial(preprocessor, "kV", 40e6) kH = typical_materials.defElasticMaterial(preprocessor, "kH", 4e6) for n in springNodes.nodes: #print "before k= ", kY.E kV.E = 40e6 * tributaryLength kH.E = 4e6 * tributaryLength fixedNode, newElem = modelSpace.setBearing(n.tag, ['kH', 'kH', 'kV']) fixedNodes.append(fixedNode) #Shell elements. shellElements = preprocessor.getSets.defSet("shellElements") beamElements = preprocessor.getSets.defSet("beamElements") for e in xcTotalSet.elements: if (e.type() == 'XC::ShellMITC4'): shellElements.elements.append(e)