ParMooN
 All Classes Functions Variables Friends Pages
Hemker_Wide_DEVSS.h
1 // Navier-Stokes coupled with conformation stress tensor problem, Benchmark problem
2 
3 
4 void ExampleFile()
5 {
6  OutPut("Example: Hemker_DEVSS" << endl) ;
7 }
8 
9 #define __BENCH__
10 
11 
12 #include <Joint.h>
13 #include <BoundEdge.h>
14 #include <BoundComp.h>
15 #include <FE2D.h>
16 #include <FEDesc2D.h>
17 
18 #include <MainUtilities.h>
19 
20 
21 #include <MacroCell.h>
22 #include <BoundEdge.h>
23 #include <IsoBoundEdge.h>
24 #include <gridgen.h>
25 #include <IsoInterfaceJoint.h>
26 #include <BdLine.h>
27 #include <BdCircle.h>
28 #include <GridCell.h>
29 
30 #include <QuadAffin.h>
31 #include <QuadBilinear.h>
32 #include <QuadIsoparametric.h>
33 #include <TriaAffin.h>
34 #include <TriaIsoparametric.h>
35 
36 extern "C"
37 {
38  void triangulate(char*, struct triangulateio*,
39  struct triangulateio*, struct triangulateio*);
40 }
41 
42 // ========================================================================
43 // exact solution
44 // ========================================================================
45 void ExactU1(double x, double y, double *values)
46 {
47  values[0] = 0;
48  values[1] = 0;
49  values[2] = 0;
50  values[3] = 0;
51 }
52 
53 void ExactU2(double x, double y, double *values)
54 {
55  values[0] = 0;
56  values[1] = 0;
57  values[2] = 0;
58  values[3] = 0;
59 }
60 
61 void ExactP(double x, double y, double *values)
62 {
63  values[0] = 0;
64  values[1] = 0;
65  values[2] = 0;
66  values[3] = 0;
67 }
68 
69 // ========================================================================
70 // boundary conditions
71 // ========================================================================
72 void BoundCondition(int i, double t, BoundCond &cond)
73 {
74  cond = DIRICHLET;
75 }
76 
77 void U1BoundValue(int BdComp, double Param, double &value)
78 {
79  switch(BdComp)
80  {
81  case 0: value = 0;
82  break;
83  case 1: value=1.5*(1.0 - (pow(-8+16*Param,2))/64.0);
84  break;
85  case 2: value = 0;
86  break;
87  case 3: value=1.5*(1.0 - (pow(8-16*Param,2))/64.0) ;
88  break;
89  case 4: value=0;
90  break;
91  default: cout << "wrong boundary part number: " << BdComp << endl;
92  }
93 }
94 
95 void U2BoundValue(int BdComp, double Param, double &value)
96 {
97  value = 0;
98  if(BdComp>4) cout << "wrong boundary part number: " << BdComp << endl;
99 }
100 
101 // ========================================================================
102 // coefficients for Stokes form: A, B1, B2, f1, f2
103 // ========================================================================
104 void LinCoeffs(int n_points, double *x, double *y,
105  double **parameters, double **coeffs)
106 {
107  double eps = 1/TDatabase::ParamDB->RE_NR, beta = TDatabase::ParamDB->P3;
108  int i;
109  double *coeff, nondim;
110 
111  if (TDatabase::ParamDB->TENSOR_TYPE == 1)
112  nondim = beta*eps;
113  else if (TDatabase::ParamDB->TENSOR_TYPE == 2)
114  nondim = eps;
115 
116  for(i=0;i<n_points;i++)
117  {
118  coeff = coeffs[i];
119 
120  coeff[0] = eps;
121  coeff[1] = 0; // f1
122  coeff[2] = 0; // f2
123  }
124 }
125 
126 // ========================================================================
127 // exact solution
128 // ========================================================================
129 void ExactS1(double x, double y, double *values)
130 {
131  values[0] = 0;
132  values[1] = 0;
133  values[2] = 0;
134  values[3] = 0;
135 }
136 
137 void ExactS2(double x, double y, double *values)
138 {
139  values[0] = 0;
140  values[1] = 0;
141  values[2] = 0;
142  values[3] = 0;
143 }
144 
145 void ExactS3(double x, double y, double *values)
146 {
147  values[0] = 0;
148  values[1] = 0;
149  values[2] = 0;
150  values[3] = 0;
151 }
152 
153 // ========================================================================
154 // boundary conditions
155 // ========================================================================
156 void BoundCondition_CST(int i, double t, BoundCond &cond)
157 {
158  switch(i)
159  {
160  case 0:
161  case 1:
162  case 2:
163  case 4:
164  cond = NEUMANN;
165  break;
166  case 3:
167  cond = DIRICHLET;
168  break;
169  }
170 }
171 
172 void S1BoundValue(int BdComp, double Param, double &value)
173 {
174  double Wei = TDatabase::ParamDB->WEI_NR;
175  switch(BdComp)
176  {
177  case 0: value=0.0;
178  break;
179 // case 1: value= (pow(1.5*Wei*(1-2*Param),2) * 2.0 )+1.0;
180 // break;
181  case 1: value=0.0;
182  break;
183  case 2: value=0.0;
184  break;
185  case 3: value=(pow(0.375*Wei*(-1+2*Param),2) * 2.0 )+1.0;
186  break;
187  case 4: value=0.0;
188  break;
189 
190  }
191 }
192 
193 void S2BoundValue(int BdComp, double Param, double &value)
194 {
195  double Wei = TDatabase::ParamDB->WEI_NR;
196  switch(BdComp)
197  {
198  case 0: value=0;
199  break;
200 // case 1: value=1.5*Wei*(1-2*Param);
201 // break;
202  case 1: value=0.0;
203  break;
204  case 2: value=0;
205  break;
206  case 3: value=0.375*Wei*(-1+2*Param);
207  break;
208  case 4: value=0;
209  break;
210 
211  }
212  return;
213 }
214 
215 
216 
217 void S3BoundValue(int BdComp, double Param, double &value)
218 {
219  switch(BdComp)
220  {
221  case 0: value=0.0;
222  break;
223 // case 1: value=1.0;
224 // break;
225  case 1: value=0.0;
226  break;
227  case 2: value=0.0;
228  break;
229  case 3: value=1.0;
230  break;
231  case 4: value=0.0;
232  break;
233 
234  }
235  return;
236 }
237 
238 void LinCoeffs_CST(int n_points, double *X, double *Y,
239  double **parameters, double **coeffs)
240 {
241  double nu=1./TDatabase::ParamDB->WEI_NR;
242 
243  int i;
244  double *coeff;
245 
246  for(i=0;i<n_points;i++)
247  {
248  coeff = coeffs[i];
249 
250  coeff[0] = nu;
251  coeff[1] = nu; //f1
252  coeff[2] = 0.0; //f2
253  coeff[3] = nu; //f3
254 
255 
256  }
257 }
258 
259 
260 // ========================================================================
261 // exact solution
262 // ========================================================================
263 void ExactD1(double x, double y, double *values)
264 {
265  values[0] = 0;
266  values[1] = 0;
267  values[2] = 0;
268  values[3] = 0;
269 }
270 
271 void ExactD2(double x, double y, double *values)
272 {
273  values[0] = 0;
274  values[1] = 0;
275  values[2] = 0;
276  values[3] = 0;
277 }
278 
279 void ExactD3(double x, double y, double *values)
280 {
281  values[0] = 0;
282  values[1] = 0;
283  values[2] = 0;
284  values[3] = 0;
285 }
286 
287 // ========================================================================
288 // boundary conditions
289 // ========================================================================
290 void BoundCondition_DFT(int i, double t, BoundCond &cond)
291 {
292  switch(i)
293  {
294  case 0:
295  case 1:
296  case 2:
297  case 4:
298  cond = NEUMANN;
299  break;
300  case 3:
301  cond = DIRICHLET;
302  break;
303  }
304 }
305 
306 void D1BoundValue(int BdComp, double Param, double &value)
307 {
308  switch(BdComp)
309  {
310  case 0: value=0;
311  break;
312  case 1: value=0;
313  break;
314  case 2: value=0;
315  break;
316  case 3: value=0;
317  break;
318  case 4: value=0;
319  break;
320  default: cout << "wrong boundary part number" << endl;
321  break;
322  }
323  return;
324 }
325 
326 void D2BoundValue(int BdComp, double Param, double &value)
327 {
328  switch(BdComp)
329  {
330  case 0: value=0;
331  break;
332  case 1: value=0;
333  break;
334  case 2: value=0;
335  break;
336  case 3: value=(2*Param-1)*3.0/16.0;
337  break;
338  case 4: value=0;
339  break;
340  default: cout << "wrong boundary part number" << endl;
341  break;
342  }
343  return;
344 }
345 
346 
347 
348 void D3BoundValue(int BdComp, double Param, double &value)
349 {
350 switch(BdComp)
351  {
352  case 0: value=0;
353  break;
354  case 1: value=0;
355  break;
356  case 2: value=0;
357  break;
358  case 3: value=0;
359  break;
360  case 4: value=0;
361  break;
362  default: cout << "wrong boundary part number" << endl;
363  break;
364  }
365  return;
366 }
367 
368 
369 void LinCoeffs_DFT(int n_points, double *X, double *Y,
370  double **parameters, double **coeffs)
371 {
372  int i;
373  double *coeff, x, y, *param;
374  double u1x, u1y, u2x, u2y;
375 
376  for(i=0;i<n_points;i++)
377  {
378  coeff = coeffs[i];
379 
380  x = X[i];
381  y = Y[i];
382 
383 // param = parameters[i];
384 //
385 // u1x = param[2];
386 // u1y = param[4];
387 // u2x = param[3];
388 // u2y = param[5];
389 
390  coeff[0] = 1;
391 // coeff[1] = u1x;
392 // coeff[2] = (u1y+u2x)*0.5;
393 // coeff[3] = u2y;
394 
395  }
396 }
397 
399 void GetCdCl(TFEFunction2D *u1fct, TFEFunction2D *u2fct,
400  TFEFunction2D *pfct, TFEFunction2D *tau1fct,
401  TFEFunction2D *tau2fct, TFEFunction2D *tau3fct,
402  double &cd, double &cl)
403 {
404  int i,j,k,l, N_;
405  int N_Points,N_Edges,comp,ed_nr;
406  double *weights, *xi, *eta;
407  double X[MaxN_QuadPoints_2D];
408  double Y[MaxN_QuadPoints_2D];
409  double AbsDetjk[MaxN_QuadPoints_2D];
410  int N_LocalUsedElements;
411  FE2D LocalUsedElements[3], CurrentElement;
412  int *DOF;
413  double **OrigFEValues, *Orig;
414  bool SecondDer[3] = { FALSE, FALSE, FALSE };
415  double *u1, *u2, *p, *tau1, *tau2, *tau3;
416  TFESpace2D *USpace, *PSpace, *TauSpace;
417  int *UGlobalNumbers, *UBeginIndex;
418  int *PGlobalNumbers, *PBeginIndex;
419  int *TauGlobalNumbers, *TauBeginIndex;
420  int *N_BaseFunct, N_Cells;
421  BaseFunct2D BaseFunct, *BaseFuncts;
422  TCollection *Coll;
423  TBaseCell *cell;
424  double value, value1, value2, value3, value4, value5, value6;
425  double FEFunctValues[MaxN_BaseFunctions2D];
426  double FEFunctValues1[MaxN_BaseFunctions2D];
427  double FEFunctValues2[MaxN_BaseFunctions2D];
428  double FEFunctValues3[MaxN_BaseFunctions2D];
429  double FEFunctValues4[MaxN_BaseFunctions2D];
430  double FEFunctValues5[MaxN_BaseFunctions2D];
431  double FEFunctValues6[MaxN_BaseFunctions2D];
432 
433  int N_DerivativesU = 3;
434  double *Derivatives[MaxN_BaseFunctions2D];
435  MultiIndex2D NeededDerivatives[3] = { D00, D10, D01 };
436  TFEFunction2D *vfct;
437  double *v, nu = 1/TDatabase::ParamDB->RE_NR;
438  double wei = 1/TDatabase::ParamDB->WEI_NR, beta = TDatabase::ParamDB->P3;
439  double *Der, *aux;
440  TJoint *joint;
441  TBoundEdge *boundedge;
442  TBoundComp *BoundComp;
443  TFE2D *eleCell;
444  FE2D FEEle;
445  TFEDesc2D *FEDesc;
446  int N_DOF_Circ, *DOF_Circ;
447  char VString[] = "v";
448 
449  u1 = u1fct->GetValues();
450  u2 = u2fct->GetValues();
451  p = pfct->GetValues();
452  tau1 = tau1fct->GetValues();
453  tau2 = tau2fct->GetValues();
454  tau3 = tau3fct->GetValues();
455 
456  USpace = u1fct->GetFESpace2D();
457  PSpace = pfct->GetFESpace2D();
458  TauSpace = tau1fct->GetFESpace2D();
459 
460  UGlobalNumbers = USpace->GetGlobalNumbers();
461  UBeginIndex = USpace->GetBeginIndex();
462 
463  PGlobalNumbers = PSpace->GetGlobalNumbers();
464  PBeginIndex = PSpace->GetBeginIndex();
465 
466  TauGlobalNumbers = TauSpace->GetGlobalNumbers();
467  TauBeginIndex = TauSpace->GetBeginIndex();
468 
471 
472  aux = new double [MaxN_QuadPoints_2D*13];
473  for(j=0;j<MaxN_QuadPoints_2D;j++)
474  Derivatives[j] = aux + j*13;
475 
476  N_ = u1fct->GetLength();
477  v = new double[N_];
478  memset(v,0,N_*SizeOfDouble);
479  vfct = new TFEFunction2D(USpace, VString, VString, v, N_);
480 
481 // ########################################################################
482 // loop over all cells
483 // ########################################################################
484  Coll = USpace->GetCollection(); // all spaces use same Coll
485  N_Cells = Coll->GetN_Cells();
486 
487  for(i=0;i<N_Cells;i++)
488  {
489  cell = Coll->GetCell(i);
490  N_Edges=cell->GetN_Edges();
491  for(j=0;j<N_Edges;j++) // loop over all edges of cell
492  {
493  joint=cell->GetJoint(j);
494  if ((joint->GetType() == BoundaryEdge)||
495  (joint->GetType() == IsoBoundEdge)) // boundary edge
496  {
497 
498  boundedge=(TBoundEdge *)joint;
499  BoundComp=boundedge->GetBoundComp(); // get boundary component
500  comp=BoundComp->GetID(); // boundary id
501  if (comp==4)
502  {
503  FEEle = USpace->GetFE2D(i,cell); // finite element of cell
504  eleCell = TFEDatabase2D::GetFE2D(FEEle);
505  FEDesc = eleCell->GetFEDesc2D(); // fe descriptor
506  N_DOF_Circ = FEDesc->GetN_JointDOF(); // # local dofs on joints
507  DOF_Circ = FEDesc->GetJointDOF(j); // local dofs on joint j
508  DOF = UGlobalNumbers + UBeginIndex[i]; // pointer to global dofs
509  for (k=0;k<N_DOF_Circ;k++) // set fe on circle to 1
510  v[DOF[DOF_Circ[k]]] = 1;
511  }
512  }
513  }
514  }
515 
516  cd = 0;
517  cl = 0;
518 
519 // ########################################################################
520 // loop over all cells
521 // ########################################################################
522  Coll = USpace->GetCollection(); // all spaces use same Coll
523  N_Cells = Coll->GetN_Cells();
524  for(i=0;i<N_Cells;i++)
525  {
526  cell = Coll->GetCell(i);
527 
528  // ####################################################################
529  // find local used elements on this cell
530  // ####################################################################
531  N_LocalUsedElements = 3;
532  LocalUsedElements[0] = USpace->GetFE2D(i, cell);
533  LocalUsedElements[1] = PSpace->GetFE2D(i, cell);
534  LocalUsedElements[2] = TauSpace->GetFE2D(i, cell);
535 
536  // ####################################################################
537  // calculate values on original element
538  // ####################################################################
539  TFEDatabase2D::GetOrig(N_LocalUsedElements, LocalUsedElements, Coll, cell, SecondDer, N_Points, xi, eta, weights, X, Y, AbsDetjk);
540 
541  // calculate all needed values of p
542  CurrentElement = LocalUsedElements[1];
543  BaseFunct = BaseFuncts[CurrentElement];
544  N_ = N_BaseFunct[CurrentElement];
545 
546  DOF = PGlobalNumbers + PBeginIndex[i];
547  for(l=0;l<N_;l++)
548  FEFunctValues[l] = p[DOF[l]];
549 
550  OrigFEValues = TFEDatabase2D::GetOrigElementValues(BaseFunct, D00);
551 
552  for(j=0;j<N_Points;j++)
553  {
554  Orig = OrigFEValues[j];
555  value = 0;
556  for(l=0;l<N_;l++)
557  value += FEFunctValues[l] * Orig[l];
558 
559  Derivatives[j][0] = value;
560  }
561 
562  // calculate all needed values of u1, u2
563  CurrentElement = LocalUsedElements[0];
564  BaseFunct = BaseFuncts[CurrentElement];
565  N_ = N_BaseFunct[CurrentElement];
566 
567  DOF = UGlobalNumbers + UBeginIndex[i];
568  for(l=0;l<N_;l++)
569  {
570  FEFunctValues1[l] = u1[DOF[l]];
571  FEFunctValues2[l] = u2[DOF[l]];
572  FEFunctValues3[l] = v[DOF[l]];
573  }
574 
575  for(k=0;k<N_DerivativesU;k++)
576  {
577  OrigFEValues = TFEDatabase2D::GetOrigElementValues(BaseFunct,
578  NeededDerivatives[k]);
579  for(j=0;j<N_Points;j++)
580  {
581  Orig = OrigFEValues[j];
582  value1 = 0;
583  value2 = 0;
584  value3 = 0;
585  for(l=0;l<N_;l++)
586  {
587  value1 += FEFunctValues1[l] * Orig[l];
588  value2 += FEFunctValues2[l] * Orig[l];
589  value3 += FEFunctValues3[l] * Orig[l];
590  } // endfor l
591  Derivatives[j][k+1] = value1;
592  Derivatives[j][k+4] = value2;
593  Derivatives[j][k+7] = value3;
594  } // endfor j
595  } // endfor k
596 
597 
598  // calculate all needed values of tau1, tau2, tau3
599  CurrentElement = LocalUsedElements[2];
600  BaseFunct = BaseFuncts[CurrentElement];
601  N_ = N_BaseFunct[CurrentElement];
602 
603  DOF = TauGlobalNumbers + TauBeginIndex[i];
604  for(l=0;l<N_;l++)
605  {
606  FEFunctValues4[l] = tau1[DOF[l]];
607  FEFunctValues5[l] = tau2[DOF[l]];
608  FEFunctValues6[l] = tau3[DOF[l]];
609 
610  }
611  OrigFEValues = TFEDatabase2D::GetOrigElementValues(BaseFunct, D00);
612 
613  for(j=0;j<N_Points;j++)
614  {
615  Orig = OrigFEValues[j];
616  value4 = 0;
617  value5 = 0;
618  value6 = 0;
619  for(l=0;l<N_;l++)
620  {
621  value4 += FEFunctValues4[l] * Orig[l];
622  value5 += FEFunctValues5[l] * Orig[l];
623  value6 += FEFunctValues6[l] * Orig[l];
624  } // endfor l
625  Derivatives[j][10] = value4;
626  Derivatives[j][11] = value5;
627  Derivatives[j][12] = value6;
628  }
629 
630 
631 
632 
633  // calculation
634  for(j=0;j<N_Points;j++)
635  {
636  Der = Derivatives[j];
637 
638  // beta*nu * (u1_x*v_x, u1_y*v_y), v= (v,0)
639  value1 = beta*nu*(Der[2]*Der[8]+Der[3]*Der[9]);
640  // (u1 * u1_x + u2* u1_y) * (1,0)
641  // value1 += (Der[1]*Der[2]+Der[4]*Der[3])*Der[7];
642  // pressure times divergence of test function (1,0)
643  value1 -= Der[0]*Der[8];
644 // // (1-beta)*nu*wei* (tau1*v_x + tau2*v_y)
645  value1 += (1.0-beta)*nu*wei*(Der[10]*Der[8] + Der[11]*Der[9]);
646 
647 // value2 = beta*nu*(Der[5]*Der[8]+Der[6]*Der[9]);
648 // // value2 += (Der[1]*Der[5]+Der[4]*Der[6])*Der[7];
649 // value2 -= Der[0]*Der[9];
650 // value2 += (1.0-beta)*nu*wei*(Der[11]*Der[8] + Der[12]*Der[9]);
651 
652  cd += AbsDetjk[j]*weights[j] * value1;
653  cl += AbsDetjk[j]*weights[j] * value2;
654  }
655 
656  } // endfor i
657 
658  cd *= -1;
659  cl *= -1;
660 
661  delete Derivatives[0];
662  delete vfct;
663  delete v;
664 }
665 
666 // **************************************************************************
667 // Triangular Mesh Generation
668 // **************************************************************************
669 
670 void TriaReMeshGen(TDomain *&Domain)
671 {
672  int j, ID, k, N_G, *PartMarker, *PointNeighb, maxEpV=0;
673  int a, b, len1, len2, Neighb_tmp, BDpart;
674  int i, temp, N_Cells, N_RootCells, CurrVertex, N_Joints, N_Vertices;
675  int N_Interface_Vert, N_Verti, N_Hori, N_SlipBound_Vert, N_BDVertices;
676  int CurrComp, In_Index, *Triangles, Neib[2], CurrNeib;
677 
678  double deviation, hi, x0, y0, x, y, phi1, phi2;
679  double T_a, T_b, C_x, C_y, s, theta;
680  double dt, area = TDatabase::ParamDB->Area;
681  double *Coordinates, *Hole_List;
682 
683  double Xi[4] = {-40., 40., 40.,-40.};
684  double Yi[4] = {-8.,-8., 8., 8.};
685 
686  TBaseCell **CellTree, *cell;
687  TBoundPart *BoundPart;
688  TJoint *Joint;
689  TCollection *coll;
690  TVertex **VertexDel, **NewVertices;
691  TBdLine *UpdateBound[12];
692  TBdCircle *UpdateIntface;
693 
694 
695  boolean AllowEdgeRef = (boolean) TDatabase::ParamDB->MESHGEN_ALLOW_EDGE_REF;
696 
697  struct triangulateio In, Out;
698  std::ostringstream opts;
699  opts << " ";
700 
701  Out.pointlist = NULL;
702  Out.pointattributelist = NULL;
703  Out.pointmarkerlist = NULL;
704  Out.trianglelist = NULL;
705  Out.triangleattributelist = NULL;
706  Out.trianglearealist = NULL;
707  Out.neighborlist = NULL;
708  Out.segmentlist = NULL;
709  Out.segmentmarkerlist = NULL;
710  Out.holelist = NULL;
711  Out.regionlist = NULL;
712  Out.edgelist = NULL;
713  Out.edgemarkerlist = NULL;
714  Out.normlist = NULL;
715 
716  opts.seekp(std::ios::beg);
717 
718 
719  BoundPart = Domain->GetBdPart(0);
720  UpdateBound[0] = (TBdLine*)BoundPart->GetBdComp(0);
721  UpdateBound[1] = (TBdLine*)BoundPart->GetBdComp(1);
722  UpdateBound[2] = (TBdLine*)BoundPart->GetBdComp(2);
723  UpdateBound[3] = (TBdLine*)BoundPart->GetBdComp(3);
724  BoundPart = Domain->GetBdPart(1);
725  UpdateIntface = (TBdCircle*)BoundPart->GetBdComp(0);
726 
727 
728 //OutPut("MESHGEN_REF_QUALIT " << TDatabase::ParamDB->MESHGEN_REF_QUALITY << endl);
729 
730  opts<<'p'; // Constrained Delaunay Triangulation:
731  // initial values - only points defined on the boundary of the domain;
732  // triangulation near boundary may variate from Delaunay criterion
733  opts<<"q"<< TDatabase::ParamDB->MESHGEN_REF_QUALITY;
734  // Quality mesh generation with no angles smaller than 20 degrees;
735  opts<<"a"<< area; // Imposes a maximum triangle area.
736  opts<<'e'; // Outputs a list of edges of the triangulation
737  opts<<'z'; // Numbers if items starting from 0
738  //opts<<"VVVV"; // Gives detailed information about what Triangle is doing
739  opts<<'Q'; // Supress all explanation of what Triangle is doing, unless an error occurs
740 // opts<<'Y'; // Supress adding vertices on boundary edges
741  opts<<ends;
742 
743  N_Interface_Vert = int (TDatabase::ParamDB->P6); //Freesurf except end point
744  N_Hori = 300; // number of horrizontal BD vertices
745  N_Verti = 50; // number of vertical BD vertices
746  N_SlipBound_Vert = 2*N_Hori + 2*N_Verti;
747 
748  N_BDVertices = N_Interface_Vert+N_SlipBound_Vert;
749  In.numberofpoints = N_BDVertices;
750  In.pointlist = new double[2*In.numberofpoints];
751  In.pointmarkerlist = new int[In.numberofpoints];
752  In.numberofpointattributes = 0;
753 
754  In.numberofsegments = In.numberofpoints;
755  In.segmentlist = new int[2*In.numberofsegments];
756  In.segmentmarkerlist = new int[In.numberofsegments];
757  In.numberofregions = 0;
758  In.regionlist = NULL;
759 
760  In.numberofholes = 1;
761  In.holelist = NULL;
762 
763  Hole_List = new double[2* In.numberofholes];
764  Hole_List[0] = 0.;
765  Hole_List[1] = 0.;
766  In.holelist = Hole_List;
767 
768  In_Index = 0;
769  CurrComp = 1;
770 
771  hi = (Xi[1] - Xi[0])/(double)N_Hori;
772  x0 = Xi[0];
773  y0 = Yi[0];
774  x = Xi[0];
775 
776  // points and segments on the horizontal boundary (marker=1)
777  for(i=0;i<N_Hori;i++) // without last point
778  {
779  x = x0 + (double)i*hi;
780  In.pointlist[2*In_Index] = x;
781  In.pointlist[2*In_Index+1] = y0;
782 // cout<<" x : "<< In.pointlist[2*In_Index] << " y : "<< In.pointlist[2*In_Index+1] <<endl;
783  In.pointmarkerlist[In_Index] = CurrComp;
784  In.segmentlist[2*In_Index] = In_Index;
785  In.segmentlist[2*In_Index+1] = In_Index+1;
786  In.segmentmarkerlist[In_Index] = CurrComp;
787  In_Index++;
788  }
789 
790  CurrComp++;
791 
792  hi = (Yi[2] - Yi[1])/(double)N_Verti;
793  x0 = Xi[1];
794  y0 = Yi[1];
795  y = Yi[1];
796  // points and segments on the horizontal boundary (marker=1)
797  for(i=0;i<N_Verti;i++) // without last point
798  {
799  y = y0 + (double)i*hi;
800  In.pointlist[2*In_Index] = x0;
801  In.pointlist[2*In_Index+1] = y;
802 // cout<<" x : "<< In.pointlist[2*In_Index] << " y : "<< In.pointlist[2*In_Index+1] <<endl;
803  In.pointmarkerlist[In_Index] = CurrComp;
804  In.segmentlist[2*In_Index] = In_Index;
805  In.segmentlist[2*In_Index+1] = In_Index+1;
806  In.segmentmarkerlist[In_Index] = CurrComp;
807  In_Index++;
808 
809  }
810 
811  CurrComp++;
812 // cout<<endl;
813 
814  hi = (Xi[3] - Xi[2])/(double)N_Hori;
815  x0 = Xi[2];
816  y0 = Yi[2];
817  x = Xi[2];
818  // points and segments on the horizontal boundary (marker=1)
819  for(i=0;i<N_Hori;i++) // without last point
820  {
821  x = x0 + (double)i*hi;
822  In.pointlist[2*In_Index] = x;
823  In.pointlist[2*In_Index+1] = y0;
824 // cout<<" x : "<< In.pointlist[2*In_Index] << " y : "<< In.pointlist[2*In_Index+1] <<endl;
825  In.pointmarkerlist[In_Index] = CurrComp;
826  In.segmentlist[2*In_Index] = In_Index;
827  In.segmentlist[2*In_Index+1] = In_Index+1;
828  In.segmentmarkerlist[In_Index] = CurrComp;
829  In_Index++;
830 
831  }
832 
833  CurrComp++;
834 // cout<<endl;
835 
836  hi = (Yi[0] - Yi[3])/(double)N_Verti;
837  x0 = Xi[3];
838  y0 = Yi[3];
839  y = Yi[3];
840  // points and segments on the horizontal boundary (marker=1)
841  for(i=0;i<N_Verti;i++) // without last point
842  {
843  y = y0 + (double)i*hi;
844  In.pointlist[2*In_Index] = x0;
845  In.pointlist[2*In_Index+1] = y;
846 // cout<<" x : "<< In.pointlist[2*In_Index] << " y : "<< In.pointlist[2*In_Index+1] <<endl;
847  In.pointmarkerlist[In_Index] = CurrComp;
848  In.segmentlist[2*In_Index] = In_Index;
849  In.segmentlist[2*In_Index+1] = In_Index+1;
850  In.segmentmarkerlist[In_Index] = CurrComp;
851  In_Index++;
852 
853  }
854  CurrComp++;
855 
856  In.segmentlist[2*(In_Index-1)+1] = 0;
857  temp=In_Index;
858 
859 
860  T_a = TDatabase::ParamDB->P1; // x axis value in ellipse
861  T_b = TDatabase::ParamDB->P2; // y axis value in ellipse !!! set in modifyGausscoord funct also
862 // deviation = fabs( T_a - T_b);
863 
864 
865  C_x = 0.0; // center of the inner phase
866  C_y = 0.0, // center of the inner phase
867  phi1 = 0.000000E+0000; // end degree value of interface
868  phi2 = 2.*Pi;
869 
870 // C_x = 0.0; // center of the inner phase
871 // C_y = 0.0, // center of the inner phase
872  s = (phi2- phi1)/(double)N_Interface_Vert;
873 
874  // points and segments on the interface (marker=2)
875 // theta = 0.;
876 // t0 = theta;
877 
878  for(i=0;i<N_Interface_Vert;i++)
879  {
880  theta = phi1 + (double)i*s;
881 // cout<<" theta : "<< theta <<endl;
882 
883 // if(fabs(I_FaceX[i]) < 1e-10 ) I_FaceX[i] = 0.0;
884  In.pointlist[2*In_Index] = T_a*cos(theta);;
885  In.pointlist[2*In_Index+1] = T_b*sin(theta);
886 
887 // if(i==0)
888 // {
889 // FreeBD_X = I_FaceX[i]; FreeBD_Y = I_FaceY[i];
890 // cout << " sorting " << FreeBD_X << ' ' << FreeBD_Y<<endl;
891 // }
892 
893 // if(i==1)
894 // {
895 // h_interface = sqrt((I_FaceX[i-1]-I_FaceX[i])*(I_FaceX[i-1]-I_FaceX[i]) +
896 // (I_FaceY[i-1]-I_FaceY[i])*(I_FaceY[i-1]-I_FaceY[i]) );
897 // OutPut("h_interface " <<h_interface << endl);
898 // }
899 // cout<<(180./Pi)*theta<< " x : "<< In.pointlist[2*In_Index] << " y : "<< In.pointlist[2*In_Index+1] <<endl;
900 
901  In.pointmarkerlist[In_Index] = CurrComp;
902  In.segmentlist[2*In_Index] = In_Index;
903  In.segmentlist[2*In_Index+1] = In_Index+1;
904  In.segmentmarkerlist[In_Index] = CurrComp;
905  In_Index++;
906  }
907 
908  In.segmentlist[2*(In_Index-1)+1] = temp;
909 
910 // exit(0);
911 
912  if(Out.pointlist!=NULL) {
913  free(Out.pointlist); Out.pointlist = NULL;}
914  if(Out.pointattributelist!=NULL) {
915  free(Out.pointattributelist); Out.pointattributelist = NULL;}
916  if(Out.pointmarkerlist!=NULL) {
917  free(Out.pointmarkerlist); Out.pointmarkerlist = NULL;}
918  if(Out.trianglelist!=NULL) {
919  free(Out.trianglelist); Out.trianglelist = NULL;}
920  if(Out.triangleattributelist!=NULL) {
921  free(Out.triangleattributelist); Out.triangleattributelist = NULL;}
922  if(Out.trianglearealist!=NULL) {
923  free(Out.trianglearealist); Out.trianglearealist = NULL;}
924  if(Out.neighborlist!=NULL) {
925  free(Out.neighborlist); Out.neighborlist = NULL;}
926  if(Out.segmentlist!=NULL) {
927  free(Out.segmentlist); Out.segmentlist = NULL;}
928  if(Out.segmentmarkerlist!=NULL) {
929  free(Out.segmentmarkerlist); Out.segmentmarkerlist = NULL;}
930  if(Out.holelist!=NULL) {
931  free(Out.holelist); Out.holelist = NULL;}
932  if(Out.regionlist!=NULL) {
933  free(Out.regionlist); Out.regionlist = NULL;}
934  if(Out.edgelist!=NULL) {
935  free(Out.edgelist); Out.edgelist = NULL;}
936  if(Out.edgemarkerlist!=NULL) {
937  free(Out.edgemarkerlist); Out.edgemarkerlist = NULL;}
938  if(Out.normlist!=NULL) {
939  free(Out.normlist); Out.normlist = NULL;}
940 
941  // call triangle
942  triangulate((char*)opts.str().c_str(), &In, &Out, (struct triangulateio *)NULL);
943 
944 
945  Domain->GetTreeInfo(CellTree, N_RootCells);
946  coll = Domain->GetCollection(It_Finest, 0);
947  N_Cells = coll->GetN_Cells();
948 
949  // remove all existing vertices and joints
950  VertexDel = new TVertex*[3*N_RootCells];
951 
952  CurrVertex = 0;
953 
954  for(i=0;i<N_Cells;i++)
955  {
956  cell = coll->GetCell(i);
957  N_Joints = cell->GetN_Joints();
958  N_Vertices = cell->GetN_Vertices();
959  for(j=0;j<N_Joints;j++)
960  {
961  if(CurrVertex==0)
962  {
963  VertexDel[CurrVertex] = cell->GetVertex(j);
964  CurrVertex++;
965  }
966  else
967  {
968  ID = 0;
969  for(k=0;k<CurrVertex;k++)
970  if(VertexDel[k]==cell->GetVertex(j))
971  {
972  ID = 1; break;
973  }
974  if(ID!=1)
975  {
976  VertexDel[CurrVertex] = cell->GetVertex(j);
977  CurrVertex++;
978  }
979  } // else if(CurrVertex==0)
980 
981  ID = 0;
982  for(k=0;k<CurrVertex;k++)
983  if(VertexDel[k]==cell->GetVertex((j+1)%N_Vertices))
984  {
985  ID = 1; break;
986  }
987  if(ID!=1)
988  {
989  VertexDel[CurrVertex] = cell->GetVertex((j+1)%N_Vertices);
990  CurrVertex++;
991  }
992  } // for j
993  } // for i
994  for(i=0;i<CurrVertex;i++)
995  delete VertexDel[i];
996 
997  delete []VertexDel;
998  OutPut(CurrVertex<<" vertices were deleted"<<endl);
999 
1000  // remove all existing cells and joints
1001  for(i=0;i<N_RootCells;i++)
1002  delete (TGridCell*)CellTree[i];
1003  OutPut(N_RootCells<<" cells were deleted"<<endl);
1004  delete CellTree;
1005  delete coll;
1006 
1007 
1008 
1009  // Solid Bound startx, starty, x length and y length
1010  UpdateBound[0]->SetParams(Xi[0], Yi[0], Xi[1]-Xi[0],Yi[1]-Yi[0]);
1011  UpdateBound[1]->SetParams(Xi[1], Yi[1], Xi[2]-Xi[1],Yi[2]-Yi[1]);
1012  UpdateBound[2]->SetParams(Xi[2], Yi[2], Xi[3]-Xi[2],Yi[3]-Yi[2]);
1013  UpdateBound[3]->SetParams(Xi[3], Yi[3], Xi[0]-Xi[3],Yi[0]-Yi[3]);
1014 
1015 
1016 // Free boundary xmid, ymid, radius_a, radius_b, start angle, end angle
1017  UpdateIntface->SetParams(C_x, C_y, T_a, T_b, phi1, phi2);
1018 
1019 
1020  N_RootCells = Out.numberoftriangles;
1021 
1022  // allocate auxillary fields
1023  Coordinates = Out.pointlist;
1024  Triangles = Out.trianglelist;
1025  PartMarker = new int[Out.numberofpoints];
1026 
1027  // generate new vertices
1028  N_G = Out.numberofpoints;
1029  NewVertices = new TVertex*[N_G];
1030 
1031  for (i=0;i<N_G;i++)
1032  NewVertices[i] = new TVertex(Coordinates[2*i], Coordinates[2*i+1]);
1033 
1034 // // set bounding box
1035 // left = bottom = 1e8;
1036 // right = top = -1e8;
1037 //
1038 // for(i=0;i<In.numberofpoints;i++)
1039 // {
1040 // if(left>In.pointlist[2*i]) left = In.pointlist[2*i];
1041 // if(right<In.pointlist[2*i]) right = In.pointlist[2*i];
1042 // if(top<In.pointlist[2*i+1]) top = In.pointlist[2*i+1];
1043 // if(bottom>In.pointlist[2*i+1]) bottom = In.pointlist[2*i+1];
1044 // }
1045 
1046 /* // Solid Bound startx, starty, x length and y length
1047  UpdateSlipBound[0]->SetParams(Xi[0], Yi[0], Xi[1]-Xi[0],Yi[1]-Yi[0]);
1048  UpdateSlipBound[1]->SetParams(Xi[1], Yi[1], Xi[2]-Xi[1],Yi[2]-Yi[1]);
1049  UpdateSlipBound[2]->SetParams(Xi[2], Yi[2], Xi[3]-Xi[2],Yi[3]-Yi[2]);
1050  UpdateSlipBound[3]->SetParams(Xi[3], Yi[3], Xi[0]-Xi[3],Yi[0]-Yi[3]);
1051 
1052 // Free boundary xmid, ymid, radius_a, radius_b, start angle, end angle
1053  UpdateIntface->SetParams(C_x, C_y, T_a, T_b, phi1, phi2);*/
1054 
1055  // generate cells
1056  CellTree = new TBaseCell*[N_RootCells];
1057 
1058  for (i=0;i<N_RootCells;i++)
1059  {
1060  CellTree[i] = new TMacroCell(TDatabase::RefDescDB[Triangle], 0);
1061 
1062  CellTree[i]->SetVertex(0, NewVertices[Out.trianglelist[3*i ]]);
1063  CellTree[i]->SetVertex(1, NewVertices[Out.trianglelist[3*i + 1]]);
1064  CellTree[i]->SetVertex(2, NewVertices[Out.trianglelist[3*i + 2]]);
1065 
1066  ((TMacroCell *) CellTree[i])->SetSubGridID(0);
1067  }
1068 
1069  Domain->SetTreeInfo(CellTree, N_RootCells);
1070 
1071  // initialize iterators
1072  TDatabase::IteratorDB[It_EQ]->SetParam(Domain);
1073  TDatabase::IteratorDB[It_LE]->SetParam(Domain);
1074  TDatabase::IteratorDB[It_Finest]->SetParam(Domain);
1075  TDatabase::IteratorDB[It_Between]->SetParam(Domain);
1076  TDatabase::IteratorDB[It_OCAF]->SetParam(Domain);
1077 
1078  // search neighbours
1079  N_G = Out.numberofpoints;
1080  PointNeighb = new int[N_G];
1081 
1082  memset(PointNeighb, 0, N_G *SizeOfInt);
1083 
1084  for (i=0;i<3*N_RootCells;i++)
1085  PointNeighb[Triangles[i]]++;
1086 
1087  maxEpV=0;
1088 
1089  for (i=0;i<N_G;i++)
1090  if (PointNeighb[i] > maxEpV) maxEpV = PointNeighb[i];
1091  delete [] PointNeighb;
1092 
1093  PointNeighb = new int[++maxEpV * N_G];
1094 
1095  memset(PointNeighb, 0, maxEpV * N_G *SizeOfInt);
1096 
1097  // first colomn contains the number of following elements
1098  // for every point at first column we set the number of neighbour points
1099  // at further columns we set the index of corresponding cells
1100  for(i=0;i<3*N_RootCells;i++)
1101  {
1102  j = Triangles[i]*maxEpV;
1103  PointNeighb[j]++;
1104  PointNeighb[j + PointNeighb[j]] = i / 3;
1105  }
1106 
1107  // generate new edges
1108  N_G = Out.numberofedges;
1109  for (i=0;i<N_G;i++)
1110  {
1111  a = Out.edgelist[2*i];
1112  b = Out.edgelist[2*i+1];
1113  Neib[0] = -1;
1114  Neib[1] = -1;
1115  CurrNeib = 0;
1116 
1117  len1 = PointNeighb[a*maxEpV];
1118  len2 = PointNeighb[b*maxEpV];
1119 
1120  // find indexes of cells containing the current edge
1121  for (j=1;j<=len1;j++)
1122  {
1123  Neighb_tmp = PointNeighb[a*maxEpV + j];
1124  for (k=1;k<=len2;k++)
1125  if (Neighb_tmp == PointNeighb[b*maxEpV + k])
1126  {
1127  Neib[CurrNeib++] = Neighb_tmp;
1128  break;
1129  }
1130  if (CurrNeib == 2) break;
1131  }
1132 
1133 // cout<<BDpart << " BDpart CurrComp "<< CurrComp <<endl;
1134 
1135 
1136 
1137  if (Out.edgemarkerlist[i]) // 0 for inner edges and Boundcomp+1 for Boundedge respect
1138  {
1139  CurrComp = Out.edgemarkerlist[i] - 1;
1140  if (CurrComp >= 100000) CurrComp -= 100000;
1141 
1142  BDpart=Domain->GetBdPartID(CurrComp);
1143  CurrComp= Domain->GetLocalBdCompID(CurrComp);
1144 
1145 // cout<<BDpart << " BDpart CurrComp "<< CurrComp <<endl;
1146 
1147  if(Domain->GetBdPart(BDpart)->GetBdComp(CurrComp)->GetTofXY(
1148  NewVertices[a]->GetX(), NewVertices[a]->GetY(), T_a) ||
1149  Domain->GetBdPart(BDpart)->GetBdComp(CurrComp)->GetTofXY(
1150  NewVertices[b]->GetX(), NewVertices[b]->GetY(), T_b))
1151  {
1152  cerr<<"Error: could not set parameter values"<<endl;
1153  OutPut(NewVertices[a]<<endl);
1154  OutPut(NewVertices[b]<<endl);
1155  // exit(0);
1156  }
1157 
1158 // ===============================================================================
1159  // due to the hole the orientation of the circle is colck-wise from out side
1160 // the parameter of the starting edge (in 0, 2pi) is for e.g (0, 0.9) (colck-wise)
1161 // while refining to get the mid point we should get the mid point parameter as 0.95
1162 // but we will get only (0+0.9)/2 =0.45 (wrong mid point). So we change.
1163 // Note only if the orientation is colck-wise !!!!!!!
1164 // ===============================================================================
1165 
1166  if(BDpart==1 && CurrComp==0 && fabs(T_a)==0 ) T_a=1;
1167 
1168 
1169 // cout<<BDpart << " BDpart CurrComp "<< CurrComp <<endl;
1170 
1171 
1172  if (CurrNeib == 2) // 2 cells contain the current edge
1173  {
1174  if(Domain->GetBdPart(BDpart)->GetBdComp(CurrComp)->IsFreeBoundary())
1175  {
1176  Joint = new TIsoInterfaceJoint(Domain->GetBdPart(BDpart)->GetBdComp(CurrComp),
1177  T_a, T_b, CellTree[Neib[0]], CellTree[Neib[1]]);
1178  }
1179  else
1180  {
1181  Joint = new TInterfaceJoint(Domain->GetBdPart(BDpart)->GetBdComp(CurrComp),
1182  T_a, T_b, CellTree[Neib[0]], CellTree[Neib[1]]);
1183  }
1184  }
1185  else
1186  {
1187  if(Domain->GetBdPart(BDpart)->GetBdComp(CurrComp)->IsFreeBoundary())
1188  {
1189  Joint = new TIsoBoundEdge(Domain->GetBdPart(BDpart)->GetBdComp(CurrComp), T_a, T_b);
1190 // cout<<" FreeBoundary"<<endl;
1191  }
1192  else
1193  {
1194  Joint = new TBoundEdge(Domain->GetBdPart(BDpart)->GetBdComp(CurrComp), T_a, T_b);
1195  }
1196  }
1197  }
1198  else // inner edge
1199  {
1200  if (CurrNeib != 2)
1201  cerr << "Error!!!!!!!! not enough neighbours!" << endl;
1202 
1203  Joint = new TJointEqN(CellTree[Neib[0]], CellTree[Neib[1]]);
1204  }
1205 
1206  // find the local index for the point 'a' on the cell
1207  for (j=0;j<3;j++)
1208  if (Triangles[3*Neib[0]+j] == a) break;
1209 
1210  // find the local index for the point 'b' on the cell
1211  for (k=0;k<3;k++)
1212  if (Triangles[3*Neib[0]+k] == b) break;
1213 
1214  k = k*10 + j;
1215 
1216  switch (k)
1217  {
1218  case 1:
1219  case 10:
1220  j = 0;
1221  break;
1222  case 12:
1223  case 21:
1224  j = 1;
1225  break;
1226  case 2:
1227  case 20:
1228  j = 2;
1229  break;
1230  }
1231 
1232  CellTree[Neib[0]]->SetJoint(j, Joint);
1233 
1234  if (Neib[1] != -1)
1235  {
1236  // find the local index for the point 'a' on the cell
1237  for (j=0;j<3;j++)
1238  if (Triangles[3*Neib[1]+j] == a) break;
1239 
1240  // find the local index for the point 'b' on the cell
1241  for (k=0;k<3;k++)
1242  if (Triangles[3*Neib[1]+k] == b) break;
1243 
1244  k = k*10 + j;
1245 
1246  switch (k) // j will contain the local index for the current
1247  {
1248  case 1:
1249  case 10:
1250  j = 0;
1251  break;
1252  case 12:
1253  case 21:
1254  j = 1;
1255  break;
1256  case 2:
1257  case 20:
1258  j = 2;
1259  break;
1260  }
1261 
1262  CellTree[Neib[1]]->SetJoint(j, Joint);
1263  }
1264 
1265  if (Joint->GetType() == InterfaceJoint ||
1266  Joint->GetType() == IsoInterfaceJoint)
1267  ((TInterfaceJoint *) Joint)->CheckOrientation();
1268  }
1269 
1270 
1271  delete [] NewVertices;
1272  delete [] PointNeighb;
1273  delete [] In.pointlist;
1274  delete [] In.pointmarkerlist;
1275  delete [] In.segmentlist;
1276  delete [] In.segmentmarkerlist;
1277 
1278  if(Out.pointlist!=NULL) {
1279  free(Out.pointlist); Out.pointlist = NULL;}
1280  if(Out.pointattributelist!=NULL) {
1281  free(Out.pointattributelist); Out.pointattributelist = NULL;}
1282  if(Out.pointmarkerlist!=NULL) {
1283  free(Out.pointmarkerlist); Out.pointmarkerlist = NULL;}
1284  if(Out.trianglelist!=NULL) {
1285  free(Out.trianglelist); Out.trianglelist = NULL;}
1286  if(Out.triangleattributelist!=NULL) {
1287  free(Out.triangleattributelist); Out.triangleattributelist = NULL;}
1288  if(Out.trianglearealist!=NULL) {
1289  free(Out.trianglearealist); Out.trianglearealist = NULL;}
1290  if(Out.neighborlist!=NULL) {
1291  free(Out.neighborlist); Out.neighborlist = NULL;}
1292  if(Out.segmentlist!=NULL) {
1293  free(Out.segmentlist); Out.segmentlist = NULL;}
1294  if(Out.segmentmarkerlist!=NULL) {
1295  free(Out.segmentmarkerlist); Out.segmentmarkerlist = NULL;}
1296  if(Out.holelist!=NULL) {
1297  free(Out.holelist); Out.holelist = NULL;}
1298  if(Out.regionlist!=NULL) {
1299  free(Out.regionlist); Out.regionlist = NULL;}
1300  if(Out.edgelist!=NULL) {
1301  free(Out.edgelist); Out.edgelist = NULL;}
1302  if(Out.edgemarkerlist!=NULL) {
1303  free(Out.edgemarkerlist); Out.edgemarkerlist = NULL;}
1304  if(Out.normlist!=NULL) {
1305  free(Out.normlist); Out.normlist = NULL;}
1306 
1307 //======================================================================
1308 // Triangular for grid generation --end
1309 //======================================================================
1310 
1311 
1312 // cout<< "tetgen" <<endl;
1313 // exit(0);
1314 
1315 
1316 } // TriaReMeshGen
double * GetValues()
Definition: FEFunction2D.h:67
virtual int GetTofXY(double X, double Y, double &T)=0
static TFE2D * GetFE2D(FE2D FE)
Definition: FEDatabase2D.h:353
int GetLength()
Definition: FEFunction2D.h:63
void GetTreeInfo(TBaseCell **&celltree, int &N_rootcells)
get tree of cells
Definition: Domain.h:176
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
int GetBdPartID(int BdCompID)
get boundary part of BdCompID
Definition: Domain.C:88
void SetParams(double xmid, double ymid, double radius_a, double radius_b, double phi1, double phi2)
Definition: BdCircle.C:21
Definition: IsoBoundEdge.h:18
Definition: FE2D.h:20
Definition: gridgen.h:21
TBoundComp2D * GetBdComp(int i)
Definition: BoundPart.h:49
int SetJoint(int J_i, TJoint *J)
set the pointer to face J_i to J
Definition: BaseCell.h:168
contains the boundary description, the virtual cell tree and macro grid
Definition: Domain.h:36
void SetParams(double xstart, double ystart, double delx, double dely)
Definition: BdLine.C:21
Definition: FESpace2D.h:28
double RE_NR
Definition: Database.h:313
int SetParam(TDomain *domain)
Definition: Iterator.C:17
static double ** GetOrigElementValues(BaseFunct1D BaseFunct, MultiIndex1D MultiIndex)
Definition: FEDatabase2D.h:300
static TIterator ** IteratorDB
Definition: Database.h:1131
store cells in an array, used by cell iterators
Definition: Collection.h:18
int GetN_Joints()
return the number of joints
Definition: BaseCell.h:185
virtual TVertex * GetVertex(int Vert_i)=0
return the pointer to vertex with number i
represent a unit of the macro grid
Definition: MacroCell.h:15
Definition: JointEqN.h:20
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
Definition: Joint.h:48
TFESpace2D * GetFESpace2D()
Definition: FEFunction2D.h:59
TBoundPart * GetBdPart(int i)
get i-th boundary part
Definition: Domain.h:172
FE2D GetFE2D(int i, TBaseCell *cell)
Definition: FESpace2D.C:1184
TFEDesc2D * GetFEDesc2D() const
Definition: FE2D.h:97
int GetN_Vertices()
return the number of vertices of the cell
Definition: BaseCell.h:179
int ** GetJointDOF() const
Definition: FEDesc2D.h:86
static BaseFunct2D * GetBaseFunct2D_IDFromFE2D()
Definition: FEDatabase2D.h:417
Definition: BoundPart.h:21
void SetTreeInfo(TBaseCell **celltree, int N_rootcells)
set tree of cells
Definition: Domain.h:183
static int * GetN_BaseFunctFromFE2D()
Definition: FEDatabase2D.h:421
bool IsFreeBoundary() const
Definition: BoundComp.h:57
TCollection * GetCollection(Iterators it, int level)
produce a collection with all cells returned by iterator it
Definition: Domain.C:1982
int GetID() const
Definition: BoundComp.h:49
Definition: BdCircle.h:18
information for finite element data structure
Definition: BaseCell.h:25
int * GetGlobalNumbers() const
Definition: FESpace.h:135
Definition: Vertex.h:19
int GetN_Edges()
return the number of edges of the cell
Definition: BaseCell.h:182
static TRefDesc ** RefDescDB
Definition: Database.h:1125
Definition: BoundEdge.h:19
Definition: IsoInterfaceJoint.h:18
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
virtual int SetVertex(int Vert_i, TVertex *Vert)=0
set the pointer of vertex Vert_i to Vert
Definition: FEDesc2D.h:15
Definition: BdLine.h:18
represent geometric information of the cell
Definition: GridCell.h:15
int * GetBeginIndex() const
Definition: FESpace.h:142
int GetN_JointDOF() const
Definition: FEDesc2D.h:61
Definition: InterfaceJoint.h:18
static TParamDB * ParamDB
Definition: Database.h:1134
int GetLocalBdCompID(int BdCompID)
get local number of boundary component
Definition: Domain.C:98
Definition: FEFunction2D.h:24