libsurf
Programmer's Documentation

materialproperty.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_MATERIALPROPERTY_H
16 #define SURF_MATERIALPROPERTY_H
17 
18 #include "forward.h"
19 #include <genua/propmacro.h>
20 
27 {
28 public:
29 
31  static const Real NoValue;
32 
52  };
53 
55  MaterialProperty(uint id = NotFound) : m_iid(id) {}
56 
58  virtual ~MaterialProperty();
59 
61  virtual void writeNastran(std::ostream &os) const = 0;
62 
64  virtual XmlElement toXml() const = 0;
65 
67  virtual void fromXml(const XmlElement &xe) = 0;
68 
70  static MaterialPropertyPtr builtinMaterial(BuiltinMatID mat, uint id=1);
71 
73  static MaterialPropertyPtr createFromXml(const XmlElement &xe);
74 
76  static MaterialPropertyPtr lookup(const MaterialPropertyArray &db, uint id);
77 
79  static XmlElement collectionToXml(const MaterialPropertyArray &db);
80 
82  static MaterialPropertyArray collectionFromXml(const XmlElement &xe);
83 
84 protected:
85 
87  void bulkIfValid(Real v, std::ostream &os) const;
88 
90  XmlElement baseXml(const std::string &tagname) const;
91 
93  void baseFromXml(const XmlElement &xe);
94 
96  GENUA_PROP(uint, iid)
97 
98 
99  GENUA_PROP(std::string, name)
100 
102  GENUA_PROP_INI(Real, rho, NoValue)
103 
105  GENUA_PROP_INI(Real, allowableILSS, NoValue)
106 };
107 
108 inline bool operator< (MaterialPropertyPtr a, MaterialPropertyPtr b)
109 {
110  assert(a != nullptr);
111  assert(b != nullptr);
112  return a->iid() < b->iid();
113 }
114 
115 inline bool operator< (MaterialPropertyPtr a, uint b)
116 {
117  assert(a != nullptr);
118  return a->iid() < b;
119 }
120 
121 inline bool operator< (uint a, MaterialPropertyPtr b)
122 {
123  assert(b != nullptr);
124  return a < b->iid();
125 }
126 
127 inline bool equivalent(MaterialPropertyPtr a, MaterialPropertyPtr b)
128 {
129  assert(a != nullptr);
130  assert(b != nullptr);
131  return a->iid() == b->iid();
132 }
133 
134 inline bool equivalent(MaterialPropertyPtr a, uint b)
135 {
136  assert(a != nullptr);
137  return a->iid() == b;
138 }
139 
140 inline bool equivalent(uint a, MaterialPropertyPtr b)
141 {
142  assert(b != nullptr);
143  return a == b->iid();
144 }
145 
152 {
153 public:
154 
156 
158  DummyMaterial(uint id = NotFound) : MaterialProperty(id) {}
159 
161  virtual void writeNastran(std::ostream &os) const;
162 
164  virtual XmlElement toXml() const;
165 
167  virtual void fromXml(const XmlElement &xe);
168 };
169 
176 {
177 public:
178 
180 
182  IsotropicMaterial(uint id = NotFound);
183 
185  virtual void writeNastran(std::ostream &os) const;
186 
188  virtual XmlElement toXml() const;
189 
191  virtual void fromXml(const XmlElement &xe);
192 
193  GENUA_PROP_INI(Real, youngsModulus, NoValue)
194  GENUA_PROP_INI(Real, shearModulus, NoValue)
195  GENUA_PROP_INI(Real, poisson, NoValue)
196  GENUA_PROP_INI(Real, thermalExpansion, NoValue)
197  GENUA_PROP_INI(Real, refTemperature, NoValue)
198  GENUA_PROP_INI(Real, dampingCoefficient, NoValue)
199  GENUA_PROP_INI(Real, stressTension, NoValue)
200  GENUA_PROP_INI(Real, stressCompression, NoValue)
201  GENUA_PROP_INI(Real, stressShear, NoValue)
202 };
203 
210 {
211 public:
212 
214 
216  OrthotropicMaterial(uint id = NotFound);
217 
219  virtual void writeNastran(std::ostream &os) const;
220 
222  virtual XmlElement toXml() const;
223 
225  virtual void fromXml(const XmlElement &xe);
226 
227  GENUA_PROP_INI(Real, youngsModulus1, NoValue)
228  GENUA_PROP_INI(Real, youngsModulus2, NoValue)
229  GENUA_PROP_INI(Real, poisson12, NoValue)
230  GENUA_PROP_INI(Real, shearModulus12, NoValue)
231  GENUA_PROP_INI(Real, shearModulus1Z, NoValue)
232  GENUA_PROP_INI(Real, shearModulus2Z, NoValue)
233  GENUA_PROP_INI(Real, thermalExpansion1, NoValue)
234  GENUA_PROP_INI(Real, thermalExpansion2, NoValue)
235  GENUA_PROP_INI(Real, refTemperature, NoValue)
236  GENUA_PROP_INI(Real, dampingCoefficient, NoValue)
237  GENUA_PROP_INI(Real, allowableTension1, NoValue)
238  GENUA_PROP_INI(Real, allowableCompression1, NoValue)
239  GENUA_PROP_INI(Real, allowableTension2, NoValue)
240  GENUA_PROP_INI(Real, allowableCompression2, NoValue)
241  GENUA_PROP_INI(Real, allowableShear, NoValue)
242  GENUA_PROP_INI(Real, tsaiWuInteraction, NoValue)
243  GENUA_PROP_INI(Real, plyThickness, NoValue)
244  GENUA_PROP_INI(bool, allowableIsStress, true)
245 };
246 
247 #endif // MATERIALPROPERTY_H
Internallay used placeholder.
Definition: materialproperty.h:151
AISI 4340 Quenched and tempered &lt; 3.5in.
Definition: materialproperty.h:42
2024 T3 Plate t &lt; 3 in
Definition: materialproperty.h:35
virtual void fromXml(const XmlElement &xe)=0
import from xml representation
static MaterialPropertyPtr createFromXml(const XmlElement &xe)
create material from XML representation
Definition: materialproperty.cpp:26
Plain isotropic material.
Definition: materialproperty.h:175
static MaterialPropertyPtr lookup(const MaterialPropertyArray &db, uint id)
lookup an iid in material library
Definition: materialproperty.cpp:44
PH13-8Mo H950 Bar, t &lt; 9 in.
Definition: materialproperty.h:43
virtual ~MaterialProperty()
destruct
Definition: materialproperty.cpp:24
XmlElement baseXml(const std::string &tagname) const
generate xml representattion with basic attributes
Definition: materialproperty.cpp:399
Ti-6Al-4V Annealed plate, &lt; 2in.
Definition: materialproperty.h:46
7050 T76 Plate &lt; 2.5in
Definition: materialproperty.h:38
void baseFromXml(const XmlElement &xe)
extract base class attributes from xml element
Definition: materialproperty.cpp:392
2024 T8 Sheet,Plate t &lt; 0.5 in
Definition: materialproperty.h:36
Ti-6Al-4V Aged extrusion, &lt; 1in.
Definition: materialproperty.h:47
7150 T77 Extrusion, t &lt; 0.5in
Definition: materialproperty.h:40
void bulkIfValid(Real v, std::ostream &os) const
write value in NASTRAN bulk data if defined
Definition: materialproperty.cpp:384
7050 T74 Plate &lt; 8in
Definition: materialproperty.h:37
static MaterialPropertyArray collectionFromXml(const XmlElement &xe)
load a material database from file
Definition: materialproperty.cpp:365
DummyMaterial(uint id=NotFound)
undefined material
Definition: materialproperty.h:158
static const Real NoValue
indicates that a value is not set
Definition: materialproperty.h:31
HexPly M21 + Torayca T700, Vf 0.6.
Definition: materialproperty.h:49
Base class for material property definitions.
Definition: materialproperty.h:26
MaterialProperty(uint id=NotFound)
undefined material
Definition: materialproperty.h:55
2024 T3 Sheet t &gt; 0.01 in
Definition: materialproperty.h:34
Typical values for solid LR285 epoxy.
Definition: materialproperty.h:48
S-Glass/LR285, low-temp.
Definition: materialproperty.h:51
AISI 4130 Steel, sheet, tubing.
Definition: materialproperty.h:41
BuiltinMatID
predefined materials
Definition: materialproperty.h:34
HS Carbon/LR285, low-temp.
Definition: materialproperty.h:50
static XmlElement collectionToXml(const MaterialPropertyArray &db)
write a material database to file
Definition: materialproperty.cpp:376
17-7 PH TH 1050 Sheet, t &lt; 0.2 in
Definition: materialproperty.h:45
virtual XmlElement toXml() const =0
write xml representation
virtual void writeNastran(std::ostream &os) const =0
write NASTRAN bulk data card
static MaterialPropertyPtr builtinMaterial(BuiltinMatID mat, uint id=1)
generate a material from builtin ID
Definition: materialproperty.cpp:59
Orthotropic shell material.
Definition: materialproperty.h:209
17-4 PH H900 Bar, t &lt; 8 in
Definition: materialproperty.h:44
7055 T77 Plate &lt; 1.5in
Definition: materialproperty.h:39
Generated on Wed Jan 19 2022 03:03:15 for libsurf by   doxygen 1.8.5