MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
membrane.h File Reference
#include "myassert.h"
#include "except.h"
#include "strnode.h"
#include "elem.h"
#include "constltp.h"
#include "Rot.hh"
#include "joint.h"
Include dependency graph for membrane.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Membrane
 

Functions

ElemReadMembrane4EAS (DataManager *pDM, MBDynParser &HP, const DofOwner *pDO, unsigned int uLabel)
 
int ReadMembraneConstLaw (MBDynParser &HP, Membrane::fmh &pD, Membrane::vh &PreStress)
 

Variables

const char * psMembraneNames []
 

Function Documentation

Elem* ReadMembrane4EAS ( DataManager pDM,
MBDynParser HP,
const DofOwner pDO,
unsigned int  uLabel 
)

Definition at line 594 of file membraneeas.cc.

References DataManager::fReadOutput(), WithLabel::GetLabel(), DataManager::GetLogFile(), HighParser::GetReal(), MBDYN_EXCEPT_ARGS, Elem::PLATE, ReadMembraneConstLaw(), DataManager::ReadNode(), MyVectorHandler::Reset(), SAFENEWWITHCONSTRUCTOR, and Node::STRUCTURAL.

Referenced by DataManager::ReadOneElem().

598 {
599 
600  const StructDispNode* pN[4];
601  for (unsigned i = 0; i < 4; i++) {
602  pN[i] = pDM->ReadNode<const StructDispNode, Node::STRUCTURAL>(HP);
603  }
604 
605  /* Prestress and prestrain */
606  Membrane::vh PreStress(3);
607  PreStress.Reset();
608 
609 #ifdef USE_CL_IN_MEMBRANE
611 
613 
614  Membrane::fmh S(3, 3);
615  for (unsigned ir = 1; ir <= 3; ir++) {
616  for (unsigned ic = 1; ic <= 3; ic++) {
617  S(ir, ic) = HP.GetReal();
618  }
619  }
620 
621  pD[0] = 0;
622  SAFENEWWITHCONSTRUCTOR(pD[0], LEGCLMembrane, LEGCLMembrane(pTplDC, PreStress, S));
623 
624  for (unsigned i = 1; i < 4; i++) {
625  pD[i] = pD[0]->Copy();
626  }
627 #else // ! USE_CL_IN_MEMBRANE
628  Membrane::fmh pD(3, 3);
629 
630  if (ReadMembraneConstLaw(HP, pD, PreStress)) {
631  silent_cerr("Membrane(" << uLabel << "): unable to read constitutive law" << std::endl);
633  }
634 #endif // ! USE_CL_IN_MEMBRANE
635 
636  flag fOut = pDM->fReadOutput(HP, Elem::PLATE);
637 
638  Elem *pEl = 0;
640  Membrane4EAS(uLabel, pDO,
641  pN[0], pN[1], pN[2], pN[3],
642 #ifdef USE_CL_IN_MEMBRANE
643 #else // ! USE_CL_IN_MEMBRANE
644  pD, PreStress,
645 #endif // ! USE_CL_IN_MEMBRANE
646  fOut));
647 
648  std::ostream& out = pDM->GetLogFile();
649  out << "membrane4: " << uLabel
650  << " " << pN[0]->GetLabel()
651  << " " << pN[1]->GetLabel()
652  << " " << pN[2]->GetLabel()
653  << " " << pN[3]->GetLabel()
654  << std::endl;
655 
656  return pEl;
657 }
flag fReadOutput(MBDynParser &HP, const T &t) const
Definition: dataman.h:1064
long int flag
Definition: mbdyn.h:43
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
int ReadMembraneConstLaw(MBDynParser &HP, Membrane::fmh &pD, Membrane::vh &PreStress)
Definition: membrane.cc:74
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
Definition: elem.h:75
std::ostream & GetLogFile(void) const
Definition: dataman.h:326
unsigned int GetLabel(void) const
Definition: withlab.cc:62
Node * ReadNode(MBDynParser &HP, Node::Type type) const
Definition: dataman3.cc:2309
LinearElasticGenericConstitutiveLaw< Membrane::vh, Membrane::fmh > LEGCLMembrane
Definition: membraneeas.cc:591
virtual doublereal GetReal(const doublereal &dDefval=0.0)
Definition: parser.cc:1056

Here is the call graph for this function:

int ReadMembraneConstLaw ( MBDynParser HP,
Membrane::fmh pD,
Membrane::vh PreStress 
)

Definition at line 74 of file membrane.cc.

References ASSERT, IncludeParser::GetLineData(), HighParser::GetReal(), FullMatrixHandler::iGetNumCols(), FullMatrixHandler::iGetNumRows(), MyVectorHandler::iGetSize(), HighParser::IsArg(), HighParser::IsKeyWord(), and FullMatrixHandler::Reset().

Referenced by ReadMembrane4EAS().

75 {
76  ASSERT(pD.iGetNumRows() == 3);
77  ASSERT(pD.iGetNumCols() == 3);
78 
79  if (HP.IsKeyWord("diag")) {
80  pD.Reset();
81  for (unsigned ir = 1; ir <= 3; ir++) {
82  pD(ir, ir) = HP.GetReal();
83  }
84 
85  } else if (HP.IsKeyWord("sym")) {
86  for (unsigned ir = 1; ir <= 3; ir++) {
87  pD(ir, ir) = HP.GetReal();
88  for (unsigned ic = ir + 1; ic <= 3; ic++) {
89  doublereal d = HP.GetReal();
90  pD(ir, ic) = d;
91  pD(ic, ir) = d;
92  }
93  }
94 
95  } else if (HP.IsKeyWord("isotropic")) {
96  doublereal dE;
97  doublereal dnu;
98  doublereal dG;
99  doublereal dh;
100  bool bGot_E(false);
101  bool bGot_nu(false);
102  bool bGot_G(false);
103  bool bGot_h(false);
104 
105  while (HP.IsArg()) {
106  if (HP.IsKeyWord("E") || HP.IsKeyWord("Young" "modulus")) {
107  if (bGot_E) {
108  silent_cerr("Membrane isotropic constitutive law: Young's modulus already provided at line " << HP.GetLineData() << std::endl);
109  return -1;
110  }
111  bGot_E = true;
112  dE = HP.GetReal();
113  if (dE <= 0.) {
114  silent_cerr("Membrane isotropic constitutive law: invalid Young's modulus " << dE << " at line " << HP.GetLineData() << std::endl);
115  return -1;
116  }
117 
118  } else if (HP.IsKeyWord("nu") || HP.IsKeyWord("Poisson" "modulus")) {
119  if (bGot_nu) {
120  silent_cerr("Membrane isotropic constitutive law: Poisson's modulus already provided at line " << HP.GetLineData() << std::endl);
121  return -1;
122  }
123  bGot_nu = true;
124  dnu = HP.GetReal();
125  if (dnu < 0. || dnu >= .5) {
126  silent_cerr("Membrane isotropic constitutive law: invalid Poisson's modulus " << dnu << " at line " << HP.GetLineData() << std::endl);
127  return -1;
128  }
129 
130  } else if (HP.IsKeyWord("G") || HP.IsKeyWord("shear" "modulus")) {
131  if (bGot_G) {
132  silent_cerr("Membrane isotropic constitutive law: shear modulus already provided at line " << HP.GetLineData() << std::endl);
133  return -1;
134  }
135  bGot_G = true;
136  dG = HP.GetReal();
137  if (dG <= 0.) {
138  silent_cerr("Membrane isotropic constitutive law: invalid shear modulus " << dG << " at line " << HP.GetLineData() << std::endl);
139  return -1;
140  }
141 
142  } else if (HP.IsKeyWord("thickness")) {
143  if (bGot_h) {
144  silent_cerr("Membrane isotropic constitutive law: thickness already provided at line " << HP.GetLineData() << std::endl);
145  return -1;
146  }
147  bGot_h = true;
148  dh = HP.GetReal();
149  if (dh <= 0.) {
150  silent_cerr("Membrane isotropic constitutive law: invalid thickness " << dh << " at line " << HP.GetLineData() << std::endl);
151  return -1;
152  }
153 
154  } else {
155  break;
156  }
157  }
158 
159  int got = 0;
160  if (bGot_E) got++;
161  if (bGot_nu) got++;
162  if (bGot_G) got++;
163 
164  if (got < 2) {
165  silent_cerr("Membrane isotropic constitutive law: incomplete material data (need at least two among Young's modulus, Poisson's modulus, shear modulus)" << std::endl);
166  return -1;
167  }
168 
169  if (got > 2) {
170  if (std::abs(dE/(2.*(1 + dnu)) - dG) >
171  std::numeric_limits<doublereal>::epsilon())
172  {
173  silent_cerr("Membrane isotropic constitutive law: inconsistent material data" << std::endl);
174  return -1;
175  }
176  } else {
177  if (!bGot_G) {
178  dG = dE/(2.*(1 + dnu));
179 
180  } else if (!bGot_E) {
181  dE = 2.*(1 + dnu)*dG;
182 
183  } else if (!bGot_nu) {
184  dnu = dE/(2.*dG) - 1.;
185  if (dnu <= 0. || dnu >= .5) {
186  silent_cerr("Membrane isotropic constitutive law: inconsistent material data (computed Poisson's modulus: " << dnu << ")" << std::endl);
187  return -1;
188  }
189  }
190  }
191 
192  if (!bGot_h) {
193  silent_cerr("Membrane isotropic constitutive law: shell thickness missing" << std::endl);
194  return -1;
195  }
196 
197  doublereal C = dE/(1. - dnu*dnu)*dh;
198  // doublereal D = C*dh*dh/12;
199  doublereal G = dG*dh;
200  // doublereal F = G*dh*dh/12;
201 
202  pD.Reset();
203 
204  pD(1, 1) = C;
205  pD(2, 2) = C;
206  pD(1, 2) = C*dnu;
207  pD(2, 1) = C*dnu;
208  pD(3, 3) = 2*G;
209 
210 /*
211  pD(1, 1) = C;
212  pD(1, 5) = C*dnu;
213  pD(2, 2) = 2*G;
214  pD(3, 3) = G*das;
215  pD(4, 4) = 2*G;
216  pD(5, 1) = C*dnu;
217  pD(5, 5) = C;
218  pD(6, 6) = G*das;
219 
220  pD(7, 7) = 2*F;
221  pD(8, 8) = D;
222  pD(8, 10) = -D*dnu;
223  pD(9, 9) = F*dat;
224  pD(10, 10) = D;
225  pD(10, 8) = -D*dnu;
226  pD(11, 11) = 2*F;
227  pD(12, 12) = F*dat;
228 */
229 
230  } else {
231  if (HP.IsKeyWord("matr")) {
232  // tolerate it
233  }
234 
235  for (unsigned ir = 1; ir <= 3; ir++) {
236  for (unsigned ic = 1; ic <= 3; ic++) {
237  pD(ir, ic) = HP.GetReal();
238  }
239  }
240  }
241 
242  if (HP.IsKeyWord("prestress")) {
243  ASSERT(PreStress.iGetSize() == 3);
244  for (unsigned ir = 1; ir <= 3; ir++) {
245  PreStress(ir) = HP.GetReal();
246  }
247  }
248 
249  return 0;
250 }
virtual integer iGetSize(void) const
Definition: vh.h:255
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
#define ASSERT(expression)
Definition: colamd.c:977
virtual integer iGetNumCols(void) const
Definition: fullmh.h:229
virtual bool IsArg(void)
Definition: parser.cc:807
double doublereal
Definition: colamd.c:52
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697
virtual integer iGetNumRows(void) const
Definition: fullmh.h:225
void Reset(void)
Definition: fullmh.cc:44
virtual doublereal GetReal(const doublereal &dDefval=0.0)
Definition: parser.cc:1056

Here is the call graph for this function:

Variable Documentation

const char* psMembraneNames[]