8 OutPut(
"Example: Benchmark.h" << endl) ;
14 #include <BoundEdge.h>
15 #include <BoundComp.h>
21 void ExactU1(
double x,
double y,
double *values)
29 void ExactU2(
double x,
double y,
double *values)
37 void ExactP(
double x,
double y,
double *values)
48 void BoundCondition(
int i,
double t, BoundCond &cond)
53 cond = SLIP_FRICTION_PENETRATION_RESISTANCE;
73 default: cout <<
"wrong boundary part number: " << i << endl;
77 void U1BoundValue(
int BdComp,
double Param,
double &value)
94 default: cout <<
"wrong boundary part number: " << BdComp << endl;
98 void U2BoundValue(
int BdComp,
double Param,
double &value)
101 if(BdComp>4) cout <<
"wrong boundary part number: " << BdComp << endl;
107 void LinCoeffs(
int n_points,
double *x,
double *y,
108 double **parameters,
double **coeffs)
114 for(i=0;i<n_points;i++)
129 double &cd,
double &cl)
132 int N_Points,N_Edges,comp,ed_nr;
133 double *weights, *xi, *eta;
134 double X[MaxN_QuadPoints_2D];
135 double Y[MaxN_QuadPoints_2D];
136 double AbsDetjk[MaxN_QuadPoints_2D];
137 int N_LocalUsedElements;
138 FE2D LocalUsedElements[2], CurrentElement;
140 double **OrigFEValues, *Orig;
141 bool SecondDer[2] = { FALSE, FALSE };
144 int *UGlobalNumbers, *UBeginIndex;
145 int *PGlobalNumbers, *PBeginIndex;
146 int *N_BaseFunct, N_Cells;
147 BaseFunct2D BaseFunct, *BaseFuncts;
150 double value, value1, value2, value3;
151 double FEFunctValues[MaxN_BaseFunctions2D];
152 double FEFunctValues1[MaxN_BaseFunctions2D];
153 double FEFunctValues2[MaxN_BaseFunctions2D];
154 double FEFunctValues3[MaxN_BaseFunctions2D];
155 int N_DerivativesU = 3;
156 double *Derivatives[MaxN_BaseFunctions2D];
157 MultiIndex2D NeededDerivatives[3] = { D00, D10, D01 };
167 int N_DOF_Circ, *DOF_Circ;
168 char VString[] =
"v";
186 aux =
new double [MaxN_QuadPoints_2D*10];
187 for(j=0;j<MaxN_QuadPoints_2D;j++)
188 Derivatives[j] = aux + j*10;
192 memset(v,0,N_*SizeOfDouble);
201 for(i=0;i<N_Cells;i++)
205 for(j=0;j<N_Edges;j++)
208 if ((joint->
GetType() == BoundaryEdge)||
209 (joint->
GetType() == IsoBoundEdge))
214 comp=BoundComp->
GetID();
217 FEEle = USpace->
GetFE2D(i,cell);
222 DOF = UGlobalNumbers + UBeginIndex[i];
223 for (k=0;k<N_DOF_Circ;k++)
224 v[DOF[DOF_Circ[k]]] = 1;
238 for(i=0;i<N_Cells;i++)
245 N_LocalUsedElements = 2;
246 LocalUsedElements[0] = USpace->
GetFE2D(i, cell);
247 LocalUsedElements[1] = PSpace->
GetFE2D(i, cell);
252 TFEDatabase2D::GetOrig(N_LocalUsedElements, LocalUsedElements, Coll, cell, SecondDer, N_Points, xi, eta, weights, X, Y, AbsDetjk);
255 CurrentElement = LocalUsedElements[1];
256 BaseFunct = BaseFuncts[CurrentElement];
257 N_ = N_BaseFunct[CurrentElement];
259 DOF = PGlobalNumbers + PBeginIndex[i];
261 FEFunctValues[l] = p[DOF[l]];
265 for(j=0;j<N_Points;j++)
267 Orig = OrigFEValues[j];
270 value += FEFunctValues[l] * Orig[l];
272 Derivatives[j][0] = value;
276 CurrentElement = LocalUsedElements[0];
277 BaseFunct = BaseFuncts[CurrentElement];
278 N_ = N_BaseFunct[CurrentElement];
280 DOF = UGlobalNumbers + UBeginIndex[i];
283 FEFunctValues1[l] = u1[DOF[l]];
284 FEFunctValues2[l] = u2[DOF[l]];
285 FEFunctValues3[l] = v[DOF[l]];
288 for(k=0;k<N_DerivativesU;k++)
291 NeededDerivatives[k]);
292 for(j=0;j<N_Points;j++)
294 Orig = OrigFEValues[j];
300 value1 += FEFunctValues1[l] * Orig[l];
301 value2 += FEFunctValues2[l] * Orig[l];
302 value3 += FEFunctValues3[l] * Orig[l];
304 Derivatives[j][k+1] = value1;
305 Derivatives[j][k+4] = value2;
306 Derivatives[j][k+7] = value3;
311 for(j=0;j<N_Points;j++)
313 Der = Derivatives[j];
316 value1 = nu*(Der[2]*Der[8]+Der[3]*Der[9]);
318 value1 += (Der[1]*Der[2]+Der[4]*Der[3])*Der[7];
320 value1 -= Der[0]*Der[8];
322 value2 = nu*(Der[5]*Der[8]+Der[6]*Der[9]);
323 value2 += (Der[1]*Der[5]+Der[4]*Der[6])*Der[7];
324 value2 -= Der[0]*Der[9];
326 cd += AbsDetjk[j]*weights[j] * value1;
327 cl += AbsDetjk[j]*weights[j] * value2;
335 delete Derivatives[0];
double * GetValues()
Definition: FEFunction2D.h:67
static TFE2D * GetFE2D(FE2D FE)
Definition: FEDatabase2D.h:353
int GetLength()
Definition: FEFunction2D.h:63
TCollection * GetCollection() const
Definition: FESpace.h:131
JointType GetType()
Definition: Joint.h:75
TBaseCell * GetCell(int i) const
return Cell with index i in Cells-array
Definition: Collection.h:50
TBoundComp2D * GetBoundComp() const
Definition: BoundEdge.h:77
Definition: FESpace2D.h:28
double RE_NR
Definition: Database.h:313
static double ** GetOrigElementValues(BaseFunct1D BaseFunct, MultiIndex1D MultiIndex)
Definition: FEDatabase2D.h:300
store cells in an array, used by cell iterators
Definition: Collection.h:18
int GetN_Cells() const
return number of cells
Definition: Collection.h:46
TJoint * GetJoint(int J_i)
return the pointer to face with number i
Definition: BaseCell.h:175
TFESpace2D * GetFESpace2D()
Definition: FEFunction2D.h:59
FE2D GetFE2D(int i, TBaseCell *cell)
Definition: FESpace2D.C:1184
TFEDesc2D * GetFEDesc2D() const
Definition: FE2D.h:97
int ** GetJointDOF() const
Definition: FEDesc2D.h:86
static BaseFunct2D * GetBaseFunct2D_IDFromFE2D()
Definition: FEDatabase2D.h:417
static int * GetN_BaseFunctFromFE2D()
Definition: FEDatabase2D.h:421
int GetID() const
Definition: BoundComp.h:49
information for finite element data structure
Definition: BaseCell.h:25
int * GetGlobalNumbers() const
Definition: FESpace.h:135
int GetN_Edges()
return the number of edges of the cell
Definition: BaseCell.h:182
Definition: BoundEdge.h:19
Definition: BoundComp.h:27
static RefTrans2D GetOrig(int N_LocalUsedElements, FE2D *LocalUsedElements, TCollection *Coll, TBaseCell *cell, bool *Needs2ndDer, int &N_Points, double *&xi, double *&eta, double *&weights, double *X, double *Y, double *absdetjk)
Definition: FEDatabase2D.C:1765
Definition: FEDesc2D.h:15
int * GetBeginIndex() const
Definition: FESpace.h:142
int GetN_JointDOF() const
Definition: FEDesc2D.h:61
static TParamDB * ParamDB
Definition: Database.h:1134
Definition: FEFunction2D.h:24