MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
shapefnc.cc File Reference
#include "mbconfig.h"
#include <limits>
#include <cfloat>
#include "matvec3.h"
#include "shapefnc.h"
Include dependency graph for shapefnc.cc:

Go to the source code of this file.

Functions

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

Variables

const doublereal dN2_1 = .5
 
const doublereal dN2_2 = .5
 
const doublereal dN2P_1 = -.5
 
const doublereal dN2P_2 = .5
 
const doublereal dN2PP_1 = 0.
 
const doublereal dN2PP_2 = 0.
 
const doublereal dN2 [2]
 
const doublereal dN2P [2]
 
const doublereal dN2PP [2]
 
const doublereal dS = 1./sqrt(3.)
 
const doublereal dN1_I = (1.+sqrt(3.))/6.
 
const doublereal dN2_I = 2./3.
 
const doublereal dN3_I = (1.-sqrt(3.))/6.
 
const doublereal dN1P_I = -(2.*sqrt(3.)+3.)/6.
 
const doublereal dN2P_I = 2./sqrt(3.)
 
const doublereal dN3P_I = -(2.*sqrt(3.)-3.)/6.
 
const doublereal dN1PP_I = 1.
 
const doublereal dN2PP_I = -2.
 
const doublereal dN3PP_I = 1.
 
const doublereal dN1II = dN3_I
 
const doublereal dN2II = dN2_I
 
const doublereal dN3II = dN1_I
 
const doublereal dN1PII = -dN3P_I
 
const doublereal dN2PII = -dN2P_I
 
const doublereal dN3PII = -dN1P_I
 
const doublereal dN1PPII = dN3PP_I
 
const doublereal dN2PPII = dN2PP_I
 
const doublereal dN3PPII = dN1PP_I
 
const doublereal dN3 [2][3]
 
const doublereal dN3P [2][3]
 
const doublereal dN3PP [2][3]
 

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 
)

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 
)

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 dN1_I = (1.+sqrt(3.))/6.

Definition at line 131 of file shapefnc.cc.

const doublereal dN1II = dN3_I

Definition at line 144 of file shapefnc.cc.

const doublereal dN1P_I = -(2.*sqrt(3.)+3.)/6.

Definition at line 135 of file shapefnc.cc.

const doublereal dN1PII = -dN3P_I

Definition at line 148 of file shapefnc.cc.

const doublereal dN1PP_I = 1.

Definition at line 139 of file shapefnc.cc.

const doublereal dN1PPII = dN3PP_I

Definition at line 152 of file shapefnc.cc.

const doublereal dN2_1 = .5

Definition at line 42 of file shapefnc.cc.

const doublereal dN2_2 = .5

Definition at line 43 of file shapefnc.cc.

const doublereal dN2_I = 2./3.

Definition at line 132 of file shapefnc.cc.

const doublereal dN2II = dN2_I

Definition at line 145 of file shapefnc.cc.

const doublereal dN2P[2]
Initial value:
= {
}
const doublereal dN2P_2
Definition: shapefnc.cc:46
const doublereal dN2P_1
Definition: shapefnc.cc:45

Definition at line 56 of file shapefnc.cc.

Referenced by Beam2::AssStiffnessMat(), ViscoElasticBeam2::AssStiffnessMat(), and Beam2::InterpDeriv().

const doublereal dN2P_1 = -.5

Definition at line 45 of file shapefnc.cc.

const doublereal dN2P_2 = .5

Definition at line 46 of file shapefnc.cc.

const doublereal dN2P_I = 2./sqrt(3.)

Definition at line 136 of file shapefnc.cc.

const doublereal dN2PII = -dN2P_I

Definition at line 149 of file shapefnc.cc.

const doublereal dN2PP[2]
Initial value:
= {
}
const doublereal dN2PP_1
Definition: shapefnc.cc:48
const doublereal dN2PP_2
Definition: shapefnc.cc:49

Definition at line 60 of file shapefnc.cc.

const doublereal dN2PP_1 = 0.

Definition at line 48 of file shapefnc.cc.

const doublereal dN2PP_2 = 0.

Definition at line 49 of file shapefnc.cc.

const doublereal dN2PP_I = -2.

Definition at line 140 of file shapefnc.cc.

const doublereal dN2PPII = dN2PP_I

Definition at line 153 of file shapefnc.cc.

const doublereal dN3[2][3]
Initial value:
= {
{ dN1_I, dN2_I, dN3_I },
}
const doublereal dN3_I
Definition: shapefnc.cc:133
const doublereal dN1II
Definition: shapefnc.cc:144
const doublereal dN1_I
Definition: shapefnc.cc:131
const doublereal dN2II
Definition: shapefnc.cc:145
const doublereal dN2_I
Definition: shapefnc.cc:132
const doublereal dN3II
Definition: shapefnc.cc:146

Definition at line 157 of file shapefnc.cc.

Referenced by AerodynamicBeam::AssJac(), Beam::AssStiffnessMat(), ViscoElasticBeam::AssStiffnessMat(), AerodynamicBeam::AssVec(), Beam::InterpState(), and Beam::Omega0().

const doublereal dN3_I = (1.-sqrt(3.))/6.

Definition at line 133 of file shapefnc.cc.

const doublereal dN3II = dN1_I

Definition at line 146 of file shapefnc.cc.

const doublereal dN3P[2][3]
Initial value:
= {
}
const doublereal dN1PII
Definition: shapefnc.cc:148
const doublereal dN2P_I
Definition: shapefnc.cc:136
const doublereal dN3P_I
Definition: shapefnc.cc:137
const doublereal dN1P_I
Definition: shapefnc.cc:135
const doublereal dN2PII
Definition: shapefnc.cc:149
const doublereal dN3PII
Definition: shapefnc.cc:150

Definition at line 162 of file shapefnc.cc.

Referenced by Beam::AssStiffnessMat(), ViscoElasticBeam::AssStiffnessMat(), and Beam::InterpDeriv().

const doublereal dN3P_I = -(2.*sqrt(3.)-3.)/6.

Definition at line 137 of file shapefnc.cc.

const doublereal dN3PII = -dN1P_I

Definition at line 150 of file shapefnc.cc.

const doublereal dN3PP[2][3]
Initial value:
= {
}
const doublereal dN3PP_I
Definition: shapefnc.cc:141
const doublereal dN1PP_I
Definition: shapefnc.cc:139
const doublereal dN2PPII
Definition: shapefnc.cc:153
const doublereal dN1PPII
Definition: shapefnc.cc:152
const doublereal dN2PP_I
Definition: shapefnc.cc:140
const doublereal dN3PPII
Definition: shapefnc.cc:154

Definition at line 167 of file shapefnc.cc.

const doublereal dN3PP_I = 1.

Definition at line 141 of file shapefnc.cc.

const doublereal dN3PPII = dN1PP_I

Definition at line 154 of file shapefnc.cc.

const doublereal dS = 1./sqrt(3.)

Definition at line 128 of file shapefnc.cc.