libsurf
Programmer's Documentation

elementproperty.h (r6227/r5617)
1 
2 /* Copyright (C) 2015 David Eller <david@larosterna.com>
3  *
4  * Commercial License Usage
5  * Licensees holding valid commercial licenses may use this file in accordance
6  * with the terms contained in their respective non-exclusive license agreement.
7  * For further information contact david@larosterna.com .
8  *
9  * GNU General Public License Usage
10  * Alternatively, this file may be used under the terms of the GNU General
11  * Public License version 3.0 as published by the Free Software Foundation and
12  * appearing in the file gpl.txt included in the packaging of this file.
13  */
14 
15 #ifndef SURF_ELEMENTPROPERTY_H
16 #define SURF_ELEMENTPROPERTY_H
17 
18 #include "forward.h"
19 #include <genua/propmacro.h>
20 
26 {
27 public:
28 
29  static const Real NoValue;
30 
32  ElementProperty(uint id=NotFound) : m_iid(id) {}
33 
35  virtual ~ElementProperty();
36 
38  virtual void storeMaterials(MaterialPropertyArray &matlib);
39 
41  virtual void loadMaterials(const MaterialPropertyArray &matlib);
42 
44  virtual void writeNastran(std::ostream &os) const = 0;
45 
47  virtual XmlElement toXml(bool share=false) const;
48 
50  virtual void fromXml(const XmlElement &xe);
51 
53  static XmlElement collectionToXml(const ElementPropertyArray &c);
54 
55 protected:
56 
58  void bulkIfValid(Real v, std::ostream &os) const;
59 
60  GENUA_PROP(uint, iid)
61  GENUA_PROP(std::string, name)
62  GENUA_PROP_INI(Real, nonStructuralMass, 0.0)
63 };
64 
71 {
72 public:
73 
75  PlainShellProperty(uint id=NotFound) : ElementProperty(id) {}
76 
78  virtual void storeMaterials(MaterialPropertyArray &matlib);
79 
81  virtual void loadMaterials(const MaterialPropertyArray &matlib);
82 
84  virtual void writeNastran(std::ostream &os) const;
85 
87  virtual XmlElement toXml(bool share=false) const;
88 
90  virtual void fromXml(const XmlElement &xe);
91 
92 private:
93 
94  GENUA_PROP(MaterialPropertyPtr, membraneMaterial)
95  GENUA_PROP(MaterialPropertyPtr, bendingMaterial)
96  GENUA_PROP(MaterialPropertyPtr, shearMaterial)
97  GENUA_PROP(MaterialPropertyPtr, couplingMaterial)
98  GENUA_PROP_INI(Real, thickness, NoValue)
99  GENUA_PROP_INI(Real, bendingMomentRatio, 1.0)
100  GENUA_PROP_INI(Real, shearThicknessRatio, NoValue)
101  GENUA_PROP_INI(Real, bottomFiberDistance, NoValue)
102  GENUA_PROP_INI(Real, topFiberDistance, NoValue)
103 };
104 
110 class CompositeShellProperty : public ElementProperty
111 {
112 public:
113 
114  using ElementProperty::NoValue;
115 
116  struct Layer {
117 
119  Layer(MaterialPropertyPtr mat, Real t, Real angle)
120  : material(mat), thickness(t), theta(angle) {}
121 
123  Layer(OrthotropicMaterialPtr mat, Real angle=0.0);
124 
126  MaterialPropertyPtr material;
127 
129  Real thickness = 0.0;
130 
132  Real theta = 0.0;
133 
135  XmlElement toXml() const;
136 
138  void fromXml(const XmlElement &xe);
139  };
140 
142  CompositeShellProperty(uint id=NotFound) : ElementProperty(id) {}
143 
145  uint append(const Layer &a);
146 
148  uint nlayers() const {return m_layup.size();}
149 
151  void clear() {m_layup.clear();}
152 
154  virtual void storeMaterials(MaterialPropertyArray &matlib);
155 
157  virtual void loadMaterials(const MaterialPropertyArray &matlib);
158 
160  virtual void writeNastran(std::ostream &os) const;
161 
163  virtual XmlElement toXml(bool share=false) const;
164 
166  virtual void fromXml(const XmlElement &xe);
167 
168 private:
169 
171  std::vector<Layer> m_layup;
172 
173  GENUA_PROP_INI(Real, refToBottomDistance, NoValue)
174  GENUA_PROP_INI(Real, allowableILSS, NoValue)
175  GENUA_PROP_INI(Real, refTemperature, NoValue)
176  GENUA_PROP_INI(Real, dampingCoefficient, NoValue)
177  GENUA_PROP_INI(std::string, failureTheory, "")
178 };
179 
180 #endif // ELEMENTPROPERTY_H
static XmlElement collectionToXml(const ElementPropertyArray &c)
retrieve element and material property data from a collection
Definition: elementproperty.cpp:54
virtual XmlElement toXml(bool share=false) const
return XML representation
Definition: elementproperty.cpp:38
uint nlayers() const
number of layers/plies
Definition: elementproperty.h:148
Element properties for layered composite shell elements.
Definition: elementproperty.h:110
virtual void fromXml(const XmlElement &xe)
recover from XML representation
Definition: elementproperty.cpp:47
virtual void writeNastran(std::ostream &os) const =0
write property card in NASTRAN bulk data format
void clear()
erase all layers
Definition: elementproperty.h:151
std::vector< Layer > m_layup
all layers, sorted bottom up
Definition: elementproperty.h:171
virtual void loadMaterials(const MaterialPropertyArray &matlib)
recover all materials from library
Definition: elementproperty.cpp:36
void bulkIfValid(Real v, std::ostream &os) const
write value in NASTRAN bulk data if defined
Definition: elementproperty.cpp:68
PlainShellProperty(uint id=NotFound)
empty property definition
Definition: elementproperty.h:75
Layer(MaterialPropertyPtr mat, Real t, Real angle)
create a layer from full specification
Definition: elementproperty.h:119
Base class for structural element properties.
Definition: elementproperty.h:25
ElementProperty(uint id=NotFound)
create empty property
Definition: elementproperty.h:32
CompositeShellProperty(uint id=NotFound)
empty layup definition
Definition: elementproperty.h:142
MaterialPropertyPtr material
material used in this ply
Definition: elementproperty.h:126
virtual ~ElementProperty()
virtual destruction
Definition: elementproperty.cpp:32
Definition: elementproperty.h:116
virtual void storeMaterials(MaterialPropertyArray &matlib)
add all materials used by this property to material library
Definition: elementproperty.cpp:34
Shell element property.
Definition: elementproperty.h:70
Generated on Wed Jan 19 2022 03:03:15 for libsurf by   doxygen 1.8.5