mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-22 09:20:33 +05:00
Representation of structural elements 'general beams' as rectangular beams (PAL #1881)
This commit is contained in:
parent
52489860fc
commit
d50f2187f3
@ -451,7 +451,9 @@ def TEST_StructuralElement():
|
||||
'VECT_Y': (1.0, 0.0, 1.0)}),
|
||||
('Orientation', {'MeshGroups': 'Edge_5',
|
||||
'ANGL_VRIL': 45.0}),
|
||||
('GeneralBeam', {'MeshGroups': 'Edge_1, Edge_7'}),
|
||||
('GeneralBeam', {'MeshGroups': 'Edge_1, Edge_7',
|
||||
'A': 1, 'IY1': 20, 'IY2': 40,
|
||||
'IZ1': 60, 'IZ2': 30}),
|
||||
('VisuPoutreCercle', {'MeshGroups': ['Edge_6'],
|
||||
'R1': 30, 'R2': 20}),
|
||||
('CircularBeam', {'MeshGroups': ['Edge_2', 'Edge_3'],
|
||||
|
@ -25,6 +25,8 @@ directly in the general case. Structural elements should be created by the
|
||||
class :class:`~salome.geom.structelem.StructuralElementManager`.
|
||||
"""
|
||||
|
||||
import math
|
||||
|
||||
import salome
|
||||
|
||||
from salome.kernel.logger import Logger
|
||||
@ -347,30 +349,6 @@ class Beam(StructuralElementPart):
|
||||
return listMarkers
|
||||
|
||||
|
||||
class GeneralBeam(Beam):
|
||||
"""
|
||||
This class defines a beam with a generic section. It is represented only
|
||||
as the underlying wire. See class :class:`StructuralElementPart` for the
|
||||
description of the parameters.
|
||||
"""
|
||||
|
||||
def __init__(self, studyId, groupName, groupGeomObj, parameters,
|
||||
name = Beam.DEFAULT_NAME):
|
||||
Beam.__init__(self, studyId, groupName, groupGeomObj, parameters,
|
||||
name)
|
||||
logger.debug(repr(self))
|
||||
|
||||
def _buildPart(self):
|
||||
"""
|
||||
Create a copy of the underlying wire.
|
||||
"""
|
||||
edges = self._getSubShapes(1e-7)
|
||||
wire = None
|
||||
if len(edges) > 0:
|
||||
wire = self.geom.MakeWire(edges)
|
||||
return wire
|
||||
|
||||
|
||||
class CircularBeam(Beam):
|
||||
"""
|
||||
This class defines a beam with a circular section. It can be full or
|
||||
@ -573,6 +551,48 @@ class RectangularBeam(Beam):
|
||||
return (outerRect1, innerRect1, outerRect2, innerRect2)
|
||||
|
||||
|
||||
def getParameterInDict(nameList, parametersDict, default = None):
|
||||
"""
|
||||
This method finds the value of a parameter in the parameters
|
||||
dictionary. The argument is a list because some parameters can have
|
||||
several different names.
|
||||
"""
|
||||
for name in nameList:
|
||||
if parametersDict.has_key(name):
|
||||
return parametersDict[name]
|
||||
return default
|
||||
|
||||
|
||||
class GeneralBeam(RectangularBeam):
|
||||
"""
|
||||
This class defines a beam with a generic section. It is represented as a
|
||||
full rectangular beam with the following parameters:
|
||||
|
||||
* HY1 = sqrt(12 * IZ1 / A1)
|
||||
* HZ1 = sqrt(12 * IY1 / A1)
|
||||
* HY2 = sqrt(12 * IZ2 / A2)
|
||||
* HZ2 = sqrt(12 * IY2 / A2)
|
||||
|
||||
See class :class:`StructuralElementPart` for the description of the other
|
||||
parameters.
|
||||
"""
|
||||
|
||||
def __init__(self, studyId, groupName, groupGeomObj, parameters,
|
||||
name = Beam.DEFAULT_NAME):
|
||||
self.IY1 = getParameterInDict(["IY1", "IY"], parameters)
|
||||
self.IZ1 = getParameterInDict(["IZ1", "IZ"], parameters)
|
||||
self.IY2 = getParameterInDict(["IY2", "IY"], parameters)
|
||||
self.IZ2 = getParameterInDict(["IZ2", "IZ"], parameters)
|
||||
self.A1 = getParameterInDict(["A1", "A"], parameters)
|
||||
self.A2 = getParameterInDict(["A2", "A"], parameters)
|
||||
parameters["HY1"] = math.sqrt(12 * self.IZ1 / self.A1)
|
||||
parameters["HZ1"] = math.sqrt(12 * self.IY1 / self.A1)
|
||||
parameters["HY2"] = math.sqrt(12 * self.IZ2 / self.A2)
|
||||
parameters["HZ2"] = math.sqrt(12 * self.IY2 / self.A2)
|
||||
RectangularBeam.__init__(self, studyId, groupName, groupGeomObj, parameters,
|
||||
name)
|
||||
|
||||
|
||||
class StructuralElementPart2D(StructuralElementPart):
|
||||
"""
|
||||
This class is an "abstract" class for all 2D structural element parts. It
|
||||
|
Loading…
Reference in New Issue
Block a user