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