import numpy import xc_base import geom import xc from model import predefined_spaces from model import fix_node_6dof from materials import typical_materials from materials import paramRectangularSection from postprocess import ControlVars as cv from solution import predefined_solutions from miscUtils import LogMessages as lmsg from materials import CrossSectionInternalForces as csif from collections import defaultdict # Fake section (elements must have a stiffness) sccFICT = paramRectangularSection.RectangularSection("rectang", b=.40, h=40) matSccFICT = typical_materials.MaterialData("mrectang", E=2.1e6, nu=0.3, rho=2500) class PhantomModel(object): def __init__(self, preprocessor, sectionDistribution): '''Extracts the element identifiers from a XC output file generated with the results for each conbination analyzed :ivar preprocessor: preprocessor object (access to FE model -nodes, elements, loads,...) :ivar sectionsDistribution: file containing the section definition for each element (this section will be
__author__= "Luis C. Pérez Tato (LCPT) and Ana Ortega (AOO)" __copyright__= "Copyright 2015, LCPT and AOO" __license__= "GPL" __version__= "3.0" __email__= "*****@*****.**" L= 2 # Bar length. P= 10e3 # Carga uniforme transversal. n= 1e6 # Carga uniforme axial. prueba= xc.ProblemaEF() preprocessor= prueba.getPreprocessor nodes= preprocessor.getNodeLoader seccPrueba= paramRectangularSection.RectangularSection("prueba",b=.20,h=.30) matSeccPrueba= typical_materials.MaterialData("matprueba",E=7E9,nu=0.3,rho=2500) # Problem type modelSpace= predefined_spaces.StructuralMechanics3D(nodes) # Definimos el material defSeccAggregation.defSeccAggregation3d(preprocessor, seccPrueba,matSeccPrueba) nodes.defaultTag= 1 #First node number. nod= nodes.newNodeXYZ(0,0,0) nod= nodes.newNodeXYZ(L/2,0,0) nod= nodes.newNodeXYZ(L,0,0) # Geometric transformations trfs= preprocessor.getTransfCooLoader
from solution import predefined_solutions from model import predefined_spaces from model import fix_node_6dof from materials import typical_materials from materials import paramRectangularSection from materials import defSeccAggregation h = 0.30 # Beam cross-section depth. b = 0.2 # Beam cross-section width. E = 2e6 # Elastic modulus prueba = xc.ProblemaEF() preprocessor = prueba.getPreprocessor nodes = preprocessor.getNodeLoader seccPrueba = paramRectangularSection.RectangularSection("prueba", b, h) matseccPrueba = typical_materials.MaterialData(name='mt', E=E, nu=0.3, rho=2500) # Define materials defSeccAggregation.defSeccAggregation2d(preprocessor, seccPrueba, matseccPrueba) matPrueba = preprocessor.getMaterialLoader.getMaterial("prueba") tang = matPrueba.getTangentStiffness() EI = tang.at(1, 1) EA = tang.at(0, 0) EITeor = (1 / 12.0 * b * h**3 * E) EITeor2 = matseccPrueba.E * seccPrueba.Iz()
from materials import paramRectangularSection from misc import banco_pruebas_scc2d __author__ = "Luis C. Pérez Tato (LCPT) and Ana Ortega (AOO)" __copyright__ = "Copyright 2015, LCPT and AOO" __license__ = "GPL" __version__ = "3.0" __email__ = "*****@*****.**" prueba = xc.ProblemaEF() prueba.logFileName = "/tmp/borrar.log" # Ignore warning messages preprocessor = prueba.getPreprocessor # Rectangular cross-section definition scc10x20 = paramRectangularSection.RectangularSection(name="rectang", b=.10, h=.20) matscc10x20 = typical_materials.MaterialData(name='mtrectang', E=2.1e6, nu=0.3, rho=2500) preprocessor = prueba.getPreprocessor # Materials definition matPoteau = scc10x20.defSeccElastica2d(preprocessor, matscc10x20) elemZLS = banco_pruebas_scc2d.modeloSecc2d(preprocessor, scc10x20.nmb) # Constraints coacciones = preprocessor.getConstraintLoader fix_node_3dof.fixNode000(coacciones, 1) spc = coacciones.newSPConstraint(2, 1, 0.0)
__author__= "Luis C. Pérez Tato (LCPT) and Ana Ortega (AOO)" __copyright__= "Copyright 2015, LCPT and AOO" __license__= "GPL" __version__= "3.0" __email__= "*****@*****.**" prueba= xc.ProblemaEF() prueba.logFileName= "/tmp/borrar.log" # Ignore warning messages preprocessor= prueba.getPreprocessor # Rectangular cross-section definition #XXX No es una seccion rectangular así que NO PARECE QUE EL # TEST TENGA DEMASIADO SENTIDO. Cuando menos habría que # crear una clase para este tipo de perfiles que sea coherente con # las ya definidas. SHS50x50x2_5= paramRectangularSection.RectangularSection("SHS50x50x2_5",b=0.05,h=0.05) matSHS50x50x2_5= typical_materials.MaterialData(name='matSec',E=210000e6,nu=0.3e6,rho=2500) SHS50x50x2_5.nmb= "SHS50x50x2_5" SHS50x50x2_5.b= 0.05 SHS50x50x2_5.h= 0.05 SHS50x50x2_5.e= 2.5e-3 SHS50x50x2_5.P= 3.54 #SHS50x50x2_5.A= 4.51e-4 #SHS50x50x2_5.Iz= 17.9e-8 #SHS50x50x2_5.Iy= 17.9e-8 SHS50x50x2_5.Wzel= 7.16e-6 SHS50x50x2_5.Wzpl= 8.47e-6 SHS50x50x2_5.iz= 1.99e-2 SHS50x50x2_5.iy= 1.99e-2 #SHS50x50x2_5.J= 26.8e-8