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' if self.noTensionZ: self.zSpring=typical_materials.defElastNoTensMaterial(preprocessor,self.zSpringName,1) else: self.zSpring=typical_materials.defElasticMaterial(preprocessor,self.zSpringName,1)
F = 10000 E = 5200 I = 342990 beta = 3 * math.pi / L k = pow(beta, 4) * 4 * E * I h = pow(12 * I, 1 / 3.0) 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.defElastNoTensMaterial(preprocessor, "kY", k * L / numDiv) nodes.newSeedNode() # Geometric transformations lin = modelSpace.newLinearCrdTransf("lin") 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 points = preprocessor.getMultiBlockTopology.getPoints pt1 = points.newPntIDPos3d(1, geom.Pos3d(0.0, 0.0, 0.0)) pt2 = points.newPntIDPos3d(2, geom.Pos3d(L / 2, 0.0, 0.0))
__author__= "Luis C. Pérez Tato (LCPT)" __copyright__= "Copyright 2014, LCPT" __license__= "GPL" __version__= "3.0" __email__= "*****@*****.**" # Model definition feProblem= xc.FEProblem() feProblem.logFileName= "/tmp/erase.log" # Ignore warning messages preprocessor= feProblem.getPreprocessor # Define materials sIni= -0.01 sFin= 0.01 incr= ((sFin-sIni)/Nsteps) ent= typical_materials.defElastNoTensMaterial(preprocessor, "ent",E) j=sIni while(j<=sFin): ent.setTrialStrain(j,0.0) ent.commitState() lStrain.append(ent.getStrain()) lStress.append(ent.getStress()) j= j+incr diff_strain= [] diff_stress= [] def subtract(x,y): return x-y diff_strain= map(subtract,lStrain,vStrainTeor) diff_stress= map(subtract,lStress,vStressTeor)
F= 10000 E= 5200 I= 342990 beta= 3*math.pi/L k= pow(beta,4)*4*E*I h= pow(12*I,1/3.0) 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.defElastNoTensMaterial(preprocessor, "kY",k*L/numDiv) nodes.newSeedNode() # Geometric transformations lin= modelSpace.newLinearCrdTransf("lin") 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 points= preprocessor.getMultiBlockTopology.getPoints
__author__= "Luis C. Pérez Tato (LCPT)" __copyright__= "Copyright 2014, LCPT" __license__= "GPL" __version__= "3.0" __email__= "*****@*****.**" # Model definition feProblem= xc.FEProblem() feProblem.logFileName= "/tmp/erase.log" # Ignore warning messages preprocessor= feProblem.getPreprocessor # Define materials sIni= -0.01 sFin= 0.01 incr= ((sFin-sIni)/Nsteps) ent= typical_materials.defElastNoTensMaterial(preprocessor, "ent",E) j=sIni while(j<=sFin): ent.setTrialStrain(j,0.0) ent.commitState() lStrain.append(ent.getStrain()) lStress.append(ent.getStress()) j= j+incr diff_strain= [] diff_stress= [] def substract(x,y): return x-y diff_strain= map(substract,lStrain,vStrainTeor) diff_stress= map(substract,lStress,vStressTeor)