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

Go to the source code of this file.

Enumerations

enum  Order { ORD_ALG = 0, ORD_D1 = 1, ORD_D2 = 2 }
 

Functions

doublereal ShapeFunc2N (doublereal d, integer iNode, enum Order Ord=ORD_ALG)
 
doublereal DxDcsi2N (doublereal d, const Vec3 &X1, const Vec3 &X2)
 
doublereal ShapeFunc3N (doublereal d, integer iNode, enum Order Ord=ORD_ALG)
 
doublereal DxDcsi3N (doublereal d, const Vec3 &X1, const Vec3 &X2, const Vec3 &X3)
 

Variables

const doublereal dN3 [2][3]
 
const doublereal dN3P [2][3]
 
const doublereal dN3PP [2][3]
 
const doublereal dN2 [2]
 
const doublereal dN2P [2]
 
const doublereal dN2PP [2]
 

Enumeration Type Documentation

enum Order
Enumerator
ORD_ALG 
ORD_D1 
ORD_D2 

Definition at line 42 of file shapefnc.h.

42 { ORD_ALG = 0, ORD_D1 = 1, ORD_D2 = 2 };

Function Documentation

doublereal DxDcsi2N ( doublereal  d,
const Vec3 X1,
const Vec3 X2 
)

Definition at line 113 of file shapefnc.cc.

References Vec3::Dot(), ORD_D1, ShapeFunc2N(), and grad::sqrt().

Referenced by AerodynamicBeam2::AssJac(), and AerodynamicBeam2::AssVec().

114 {
115  doublereal dN1p = ShapeFunc2N(d, 1, ORD_D1);
116  doublereal dN2p = ShapeFunc2N(d, 2, ORD_D1);
117  Vec3 DXDcsi(X1*dN1p+X2*dN2p);
118  doublereal dd = DXDcsi.Dot();
119 
120  if (dd > std::numeric_limits<doublereal>::epsilon()) {
121  return std::sqrt(dd);
122  }
123 
124  return 0.;
125 }
Definition: matvec3.h:98
doublereal ShapeFunc2N(doublereal d, integer iNode, enum Order Ord)
Definition: shapefnc.cc:66
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

doublereal DxDcsi3N ( doublereal  d,
const Vec3 X1,
const Vec3 X2,
const Vec3 X3 
)

Definition at line 228 of file shapefnc.cc.

References Vec3::Dot(), ORD_D1, ShapeFunc3N(), and grad::sqrt().

Referenced by AerodynamicBeam::AssJac(), and AerodynamicBeam::AssVec().

229 {
230  doublereal dN1p = ShapeFunc3N(d, 1, ORD_D1);
231  doublereal dN2p = ShapeFunc3N(d, 2, ORD_D1);
232  doublereal dN3p = ShapeFunc3N(d, 3, ORD_D1);
233  Vec3 DXDcsi(X1*dN1p+X2*dN2p+X3*dN3p);
234  doublereal dd = DXDcsi.Dot();
235 
236  if (dd > std::numeric_limits<doublereal>::epsilon()) {
237  return std::sqrt(dd);
238  }
239 
240  return 0.;
241 }
Definition: matvec3.h:98
doublereal ShapeFunc3N(doublereal d, integer iNode, enum Order Ord)
Definition: shapefnc.cc:173
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

doublereal ShapeFunc2N ( doublereal  d,
integer  iNode,
enum Order  Ord = ORD_ALG 
)

Definition at line 66 of file shapefnc.cc.

References ASSERT, MBDYN_EXCEPT_ARGS, ORD_ALG, ORD_D1, and ORD_D2.

Referenced by AerodynamicBeam2::AssJac(), AerodynamicBeam2::AssVec(), and DxDcsi2N().

67 {
68  ASSERT(iNode == 1 || iNode == 2);
69 
70  switch (Ord) {
71  case ORD_ALG:
72  switch (iNode) {
73  case 1:
74  return .5*(1.-d);
75 
76  case 2:
77  return .5*(1.+d);
78 
79  default:
81  }
82 
83  case ORD_D1:
84  switch (iNode) {
85  case 1:
86  return -.5;
87 
88  case 2:
89  return .5;
90 
91  default:
93  }
94 
95  case ORD_D2:
96  switch (iNode) {
97  case 1:
98  return 0.;
99 
100  case 2:
101  return 0.;
102 
103  default:
105  }
106  }
107 
108  /* Per evitare warnings */
109  return 0.;
110 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
#define ASSERT(expression)
Definition: colamd.c:977
doublereal ShapeFunc3N ( doublereal  d,
integer  iNode,
enum Order  Ord = ORD_ALG 
)

Definition at line 173 of file shapefnc.cc.

References ASSERT, MBDYN_EXCEPT_ARGS, ORD_ALG, ORD_D1, and ORD_D2.

Referenced by AerodynamicBeam::AssJac(), BeamSliderJoint::AssRes(), AerodynamicBeam::AssVec(), and DxDcsi3N().

174 {
175  ASSERT(iNode == 1 || iNode == 2 || iNode == 3);
176 
177  switch (Ord) {
178  case ORD_ALG:
179  switch (iNode) {
180  case 1:
181  return .5*d*(d-1.);
182 
183  case 2:
184  return 1.-d*d;
185 
186  case 3:
187  return .5*d*(d+1.);
188 
189  default:
191  }
192 
193  case ORD_D1:
194  switch (iNode) {
195  case 1:
196  return d-.5;
197 
198  case 2:
199  return -2.*d;
200 
201  case 3:
202  return d+.5;
203 
204  default:
206  }
207  case ORD_D2:
208  switch (iNode) {
209  case 1:
210  return 1.;
211 
212  case 2:
213  return -2.;
214 
215  case 3:
216  return 1.;
217 
218  default:
220  }
221  }
222 
223  /* Per evitare warnings */
224  return 0.;
225 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
#define ASSERT(expression)
Definition: colamd.c:977

Variable Documentation

const doublereal dN2P[2]
const doublereal dN2PP[2]

Definition at line 60 of file shapefnc.cc.

const doublereal dN3P[2][3]
const doublereal dN3PP[2][3]

Definition at line 167 of file shapefnc.cc.