def createPhantomElement(self, idElem, sectionName, sectionDefinition, sectionIndex, interactionDiagram, fakeSection): '''Creates a phantom element (that represents a section to check) and assigns to it the following properties: :param idElem: identifier of the element in the "true" model from which this phantom element procedes -idElem-. :param idSection: name of the section assigned to the phantom element (the section to check) -sectionName-. :param dir: index of the section in the "true" model element -sectionIndex-. To be renamed as sectionIndex. :param interactionDiagram: interaction diagram that corresponds to the section to check. ''' nA = self.preprocessor.getNodeLoader.newNodeXYZ(0, 0, 0) nB = self.preprocessor.getNodeLoader.newNodeXYZ(0, 0, 0) fix_node_6dof.fixNode6DOF(self.preprocessor.getConstraintLoader, nA.tag) if (not fakeSection): elements.defaultMaterial = sectionName phantomElement = self.preprocessor.getElementLoader.newElement( "zero_length_section", xc.ID([nA.tag, nB.tag])) phantomElement.setProp("idElem", idElem) #Element to check phantomElement.setProp("idSection", sectionName) #Section to check phantomElement.setProp("dir", sectionIndex) #Section index in the element. scc = phantomElement.getSection() scc.setProp("datosSecc", sectionDefinition) #Section definition phantomElement.setProp("diagInt", interactionDiagram) return phantomElement
def nuevoZeroLengthSecc2d(preprocessor, nmbS, tagNodo, tagElem): idNod1 = tagNodo idNod2 = (tagNodo + 1) # Define nodes nodes.newNodeIDXYZ(idNod1, tagNodo, 0, 0) nodes.newNodeIDXYZ(idNod2, tagNodo, 0, 0) coacciones = preprocessor.getConstraintLoader fix_node_6dof.fixNode6DOF(coacciones, idNod1) fix_node_6dof.Nodo6DOFGirosLibres(coacciones, idNod2) # Definimos elementos elementos = preprocessor.getElementLoader elementos.defaultMaterial = nmbS elementos.defaultTag = tagElem #Tag for the next element. zls = elementos.newElement("zero_length_section", xc.ID([idNod1, idNod2]))
def getDiagMomentoCurvatura3d(preprocessor, nmbSecc, esfAxil, maxK, numIncr): ''' Función que devuelve los puntos del diagrama momento curvatura de una sección. :param nmbSecc: Nombre de la sección a analizar. :param esfAxil: Esfuerzo axil que actúa sobre la sección. :param maxK: Curvatura máxima alcanzada durante el análisis. :param numIncr: Número de incrementos en que se divide el intervalo 0->maxK. ''' nodes= preprocessor.getNodeLoader modelSpace= predefined_spaces.StructuralMechanics3D(nodes) nodes.newNodeIDXYZ(1001,1,0,0) nodes.newNodeIDXYZ(1002,1,0,0) elementos= preprocessor.getElementLoader elementos.defaultMaterial= nmbSecc elementos.defaultTag= 2001 #Tag for the next element. zls= elementos.newElement("zero_length_section",xc.ID([1001,1002])); coacciones= preprocessor.getConstraintLoader fix_node_6dof.fixNode6DOF(coacciones,1001) coacciones.newSPConstraint(1002,1,0.0) coacciones.newSPConstraint(1002,2,0.0) cargas= preprocessor.getLoadLoader casos= cargas.getLoadPatterns #Load modulation. ts= casos.newTimeSeries("constant_ts","ts") casos.currentTimeSeries= "ts" lp0= casos.newLoadPattern("default","0") lp0.newNodalLoad(1002,xc.Vector([esfAxil,0,0,0,0,0])) #We add the load case to domain. casos.addToDomain("0") analisis= predefined_solutions.simple_newton_raphson(prueba) analOk= analisis.analyze(1) lp1= casos.newLoadPattern("default","1") lp1.newNodalLoad(1002,xc.Vector([0,0,0,0,0,0,1])) # Calculamos el incremento de curvatura dK= maxK/numIncr soluMethods= prb.getSolProc.getSoluMethodContainer smt= getSoluMethod("smt") integ= smt.newIntegrator("displacement_control_integrator")
caracMecSeccion.Iz = Iz caracMecSeccion.Iy = Iy caracMecSeccion.J = J seccion = typical_materials.defElasticSectionFromMechProp3d( preprocessor, "seccion", caracMecSeccion) # Elements definition elementos = preprocessor.getElementLoader elementos.defaultTransformation = "lin" elementos.defaultMaterial = "seccion" elementos.defaultTag = 1 #Tag for the next element. beam3d = elementos.newElement("elastic_beam_3d", xc.ID([1, 2])) # Constraints coacciones = preprocessor.getConstraintLoader fix_node_6dof.fixNode6DOF(coacciones, 1) # Loads definition cargas = preprocessor.getLoadLoader casos = cargas.getLoadPatterns #Load modulation. ts = casos.newTimeSeries("constant_ts", "ts") casos.currentTimeSeries = "ts" #Load case definition lp0 = casos.newLoadPattern("default", "0") lp0.newNodalLoad(2, xc.Vector([0, 0, 0, 0, 0, M])) #We add the load case to domain. casos.addToDomain("0") # Solution analisis = predefined_solutions.simple_static_linear(prueba)
sctFibers.setupFibers() # #report of the section material # sectParam=sectionReport.SectionInfo(preprocessor=preprocessor,sectName='example_7.3_EC2W',sectDescr='Test example 7.3 EC2 Worked examples. Section definition',concrete=concrete,rfSteel=rfSteel,concrDiag=concrDiagram,rfStDiag=steelDiagram,geomSection=geomSectFibers,width=width,depth=depth) #Obtains section parameters for report # sectParam.writeReport(archTex='figures/sections/secEx73.tex', pathFigura='figures/sections/secEx73.eps') # Elements definition elementos = preprocessor.getElementLoader elementos.defaultMaterial = 'sctFibers' elementos.dimElem = 1 elementos.defaultTag = 1 elem = elementos.newElement("zero_length_section", xc.ID([1, 2])) # Constraints constCont = preprocessor.getConstraintLoader #constraints container fix_node_6dof.fixNode6DOF(constCont, 1) fix_node_6dof.Nodo6DOFMovXGiroYLibres(constCont, 2) # Loads definition cargas = preprocessor.getLoadLoader #loads container casos = cargas.getLoadPatterns #Load modulation. ts = casos.newTimeSeries("constant_ts", "ts") casos.currentTimeSeries = "ts" #Load case definition lp0 = casos.newLoadPattern("default", "0") pointLoad = xc.Vector([0, 0, 0, 0, M_y, 0]) lp0.newNodalLoad(2, pointLoad) #applies the point load on node 2 #We add the load case to domain.
# Definimos materiales memb1= typical_materials.defElasticMembranePlateSection(prep,"memb1",E,nu,dens,h) elementos= prep.getElementHandler elementos.defaultMaterial= "memb1" elem= elementos.newElement("shell_mitc4",xc.ID([1,2,3,4])) # Condiciones de contorno coacciones= prep.getBoundaryCondHandler fix_node_6dof.fixNode6DOF(coacciones,1) fix_node_6dof.fixNode6DOF(coacciones,2) # Definimos cargas cargas= prep.getLoadHandler casos= cargas.getLoadPatterns #Load modulation. ts= casos.newTimeSeries("constant_ts","ts") casos.currentTimeSeries= "ts" #Define un caso de carga lp0= casos.newLoadPattern("default","0") #casos.currentLoadPattern= "0"
apoyosPot.defineMaterialesTeflon(preprocessor, diamPot, "teflonKX", "teflonKY") nodes = preprocessor.getNodeLoader modelSpace = predefined_spaces.StructuralMechanics3D(nodes) nodes.defaultTag = 1 #First node number. nod1 = nodes.newNodeXYZ(1, 1, 1) nod2 = nodes.newNodeXYZ(1, 1, 1) apoyo_pot.colocaApoyoFicticioPotDeslizanteNodos(preprocessor, nod1.tag, nod2.tag, 1, "teflonKX", "teflonKY") # Constraints coacciones = preprocessor.getConstraintLoader # fix_node_6dof.fixNode6DOF(coacciones, nod1.tag) spc = coacciones.newSPConstraint(nod2.tag, 3, 0.0) # Nodo 2 spc = coacciones.newSPConstraint(nod2.tag, 4, 0.0) spc = coacciones.newSPConstraint(nod2.tag, 5, 0.0) # Loads definition cargas = preprocessor.getLoadLoader casos = cargas.getLoadPatterns #Load modulation. ts = casos.newTimeSeries("constant_ts", "ts") casos.currentTimeSeries = "ts" #Load case definition lp0 = casos.newLoadPattern("default", "0") lp0.newNodalLoad(2, xc.Vector([FX, FY, FZ, MX, MY, MZ]))