blockgrid.cc 52.9 KB
Newer Older
Phillip Lino Rall's avatar
Phillip Lino Rall committed
1
/**********************************************************************************
Phillip Lino Rall's avatar
Phillip Lino Rall committed
2
 * Copyright 2010 Christoph Pflaum
Phillip Lino Rall's avatar
Phillip Lino Rall committed
3
4
 * 		Department Informatik Lehrstuhl 10 - Systemsimulation
 *		Friedrich-Alexander Universität Erlangen-Nürnberg
Phillip Lino Rall's avatar
Phillip Lino Rall committed
5
 *
Phillip Lino Rall's avatar
Phillip Lino Rall committed
6
7
8
9
10
11
12
13
14
15
16
17
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **********************************************************************************/
Phillip Lino Rall's avatar
Phillip Lino Rall committed
18

Phillip Lino Rall's avatar
Phillip Lino Rall committed
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <sstream>
#include <stdexcept>

#include "../mympi.h"
#include "../abbrevi.h"
#include "../parameter.h"
#include "../math_lib/math_lib.h"
#include "../basics/basic.h"
#include "elements.h"
#include "parti.h"
#include "ug.h"
#include "blockgrid.h"


#define HWSD hex->Give_coord(WSDdir3D)
#define HESD hex->Give_coord(ESDdir3D)
#define HWND hex->Give_coord(WNDdir3D)
#define HEND hex->Give_coord(ENDdir3D)
#define HWST hex->Give_coord(WSTdir3D)
#define HEST hex->Give_coord(ESTdir3D)
#define HWNT hex->Give_coord(WNTdir3D)
#define HENT hex->Give_coord(ENTdir3D)

int Blockgrid::id_count_grid = 0;

Phillip Lino Rall's avatar
Phillip Lino Rall committed
44

45

Phillip Lino Rall's avatar
Phillip Lino Rall committed
46

Phillip Lino Rall's avatar
Phillip Lino Rall committed
47
48
Blockgrid::Blockgrid() {
  id_of_grid = id_count_grid; ++id_count_grid;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
49
50
    phase_shift = NULL;
  bg_coord = NULL;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
51
52
53
  variable_set = false;
}

54
55


Phillip Lino Rall's avatar
Phillip Lino Rall committed
56
57
58
Blockgrid::Blockgrid ( Unstructured_grid *ug_ ) {
  id_of_grid = id_count_grid; ++id_count_grid;
  phase_shift = NULL;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
59
  bg_coord = NULL;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
60
61
62
63
64
65
66
  ug = ug_;
  number_points = new int[ug->degree_of_freedom() ];
  for ( int i=0;i<ug->degree_of_freedom();++i )
  {
    number_points[i] = 10;
  }
  variable_set = false;
67
 }
Phillip Lino Rall's avatar
Phillip Lino Rall committed
68
69

Blockgrid::Blockgrid ( Unstructured_grid *ug_, int N ) {
Phillip Lino Rall's avatar
Phillip Lino Rall committed
70
  id_of_grid = id_count_grid; ++id_count_grid;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
71
  phase_shift = NULL;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
72
  bg_coord = NULL;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
73
74
75
76
77
78
79
80
81
82
  ug = ug_;
  number_points = new int[ug->degree_of_freedom() ];
  for ( int i=0;i<ug->degree_of_freedom();++i )
  {
    number_points[i] = N;
  }
  variable_set = false;
}

Blockgrid::Blockgrid ( Unstructured_grid *ug_, int Nx, int Ny, int Nz ) {
Phillip Lino Rall's avatar
Phillip Lino Rall committed
83
  id_of_grid = id_count_grid; ++id_count_grid;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
84
85
    phase_shift = NULL;
  bg_coord = NULL;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
  ug = ug_;
  if ( ug->degree_of_freedom() <3 )
    cout << " error in Blockgrid::Blockgrid(Unstructured_grid *ug_, int Nx, int Ny, int Nz) "
    << endl;
  number_points = new int[ug->degree_of_freedom() ];

  number_points[0] = Nx;
  number_points[1] = Ny;
  for ( int i = 2; i < ug->degree_of_freedom();++i )
  {
    number_points[i] = Nz;
  }

  variable_set = false;
}


Blockgrid::Blockgrid ( Unstructured_grid *ug_, int Nx, int Ny, int Nz, int Nr ) {
Phillip Lino Rall's avatar
Phillip Lino Rall committed
104
  id_of_grid = id_count_grid; ++id_count_grid;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
105
106
    phase_shift = NULL;
  bg_coord = NULL;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
  ug = ug_;
  if ( ug->degree_of_freedom() !=4 ) {
    cout << " error in Blockgrid::Blockgrid(Unstructured_grid *ug_,int Nx,int Ny,int Nz,int Nr) "
    << endl;
    cout << " number of degree of freedom is: " << ug->degree_of_freedom() << endl;
  }
  number_points = new int[4];

  number_points[0] = Nx;
  number_points[1] = Ny;
  number_points[2] = Nz;
  number_points[3] = Nr;

  variable_set = false;
}

123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
Blockgrid::Blockgrid(Unstructured_grid *ug_, int Nx, int Ny, int Nz, int Nr, int Nr2){
   id_of_grid = id_count_grid; ++id_count_grid;
     phase_shift = NULL;
   bg_coord = NULL;
   ug = ug_;
   if ( ug->degree_of_freedom() !=5 ) {
     cout << " error in Blockgrid::Blockgrid(Unstructured_grid *ug_,int Nx,int Ny,int Nz,int Nr) "
     << endl;
     cout << " number of degree of freedom is: " << ug->degree_of_freedom() << endl;
   }
   number_points = new int[5];

   number_points[0] = Nx;
   number_points[1] = Ny;
   number_points[2] = Nz;
   number_points[3] = Nr;
   number_points[4] = Nr2;

   variable_set = false;
 }

Phillip Lino Rall's avatar
Phillip Lino Rall committed
144
Blockgrid::Blockgrid ( Unstructured_grid *ug_, int Nx, int Ny, std::vector<int>& Nz ) {
Phillip Lino Rall's avatar
Phillip Lino Rall committed
145
  id_of_grid = id_count_grid; ++id_count_grid;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
146
147
    phase_shift = NULL;
  bg_coord = NULL;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
148
149
150
151
152
153
154
155
156
  ug = ug_;
  if ( ug->degree_of_freedom() !=Nz.size() +2 )
  {
    std::stringstream ss;
    ss << " error in Blockgrid::Blockgrid(Unstructured_grid *ug_,int Nx,int Ny,vector<int>& Nz) " << endl << "Nz.size+2 = "<< Nz.size() +2 << endl << "degree_of_freedom = " << ug->degree_of_freedom()
    << endl;
    throw ( std::runtime_error ( ss.str() ) );
  }
  number_points = new int[Nz.size() +2];
Phillip Lino Rall's avatar
Phillip Lino Rall committed
157

Phillip Lino Rall's avatar
Phillip Lino Rall committed
158
159
160
161
162
163
164
165
166
167
168
169
  number_points[0] = Nx;
  number_points[1] = Ny;

//   std::cout << "Nx = " << Nx << endl;
//   std::cout << "Nx = " << Ny << endl;
  int tmp_num;
  for ( unsigned int i = 0; i < Nz.size();++i )
  {
    tmp_num = Nz.at ( i );
    if ( tmp_num <= 0 )
    {
      std::stringstream ss;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
170
171
      ss << " error in Blockgrid::Blockgrid(Unstructured_grid *ug_,int Nx,int Ny,vector<int>& Nz) "
        << endl << "Nz.at("<< i << ") = "
Phillip Lino Rall's avatar
Phillip Lino Rall committed
172
173
174
175
176
177
178
179
180
181
182
        << tmp_num <<" <= 0" << endl;
      throw ( std::runtime_error ( ss.str() ) );
    }

//     cout << "Nz.at("<< i << ") = " << tmp_num << endl;
    number_points[i+2] = tmp_num;
  }

  variable_set = false;
}

Phillip Lino Rall's avatar
Phillip Lino Rall committed
183
184
185
186
187



Blockgrid::Blockgrid ( Unstructured_grid *ug_,std::vector<int> Nvec) {
  id_of_grid = id_count_grid; ++id_count_grid;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
188
189
    phase_shift = NULL;
  bg_coord = NULL;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
  ug = ug_;
  if ( ug->degree_of_freedom() !=Nvec.size() )
  {
    std::stringstream ss;
    ss << " error in Blockgrid::Blockgrid(Unstructured_grid *ug_,std::vector<int> Nvec) " << endl << "Nvec.size() = "<< Nvec.size() << endl << "degree_of_freedom = " << ug->degree_of_freedom()
    << endl;
    throw ( std::runtime_error ( ss.str() ) );
  }
  number_points = new int[Nvec.size()];

  for(unsigned int i = 0; i < Nvec.size();++i)  {
    number_points[i] = Nvec.at(i);
  }

  variable_set = false;
}





Phillip Lino Rall's avatar
Phillip Lino Rall committed
211
212
Blockgrid::Blockgrid ( Unstructured_grid *ug_, int Nx, int Ny, std::vector<int>& Nz, int Nr ) {
  id_of_grid = id_count_grid; ++id_count_grid;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
213

Phillip Lino Rall's avatar
Phillip Lino Rall committed
214
215
    phase_shift = NULL;
  bg_coord = NULL;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
216
217
218
219
220
221
222
223
224
  ug = ug_;
  if ( ug->degree_of_freedom() !=Nz.size() +3 )
  {
    std::stringstream ss;
    ss << " error in Blockgrid::Blockgrid(Unstructured_grid *ug_,int Nx,int Ny,vector<int>& Nz,, int Nr) " << endl << "Nz.size+3 = "<< Nz.size() +3 << endl << "degree_of_freedom = " << ug->degree_of_freedom()
    << endl;
    throw ( std::runtime_error ( ss.str() ) );
  }
  number_points = new int[Nz.size() +3];
Phillip Lino Rall's avatar
Phillip Lino Rall committed
225

Phillip Lino Rall's avatar
Phillip Lino Rall committed
226
227
228
  number_points[0] = Nx;
  number_points[1] = Ny;
  number_points[Nz.size()+2] = Nr;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
229

Phillip Lino Rall's avatar
Phillip Lino Rall committed
230
231
232
233
234
235
236
237
238
//   std::cout << "Nx = " << Nx << endl;
//   std::cout << "Nx = " << Ny << endl;
  int tmp_num;
  for ( unsigned int i = 0; i < Nz.size();++i )
  {
    tmp_num = Nz.at ( i );
    if ( tmp_num <= 0 )
    {
      std::stringstream ss;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
239
240
      ss << " error in Blockgrid::Blockgrid(Unstructured_grid *ug_,int Nx,int Ny,vector<int>& Nz,int Nr) "
        << endl << "Nz.at("<< i << ") = "
Phillip Lino Rall's avatar
Phillip Lino Rall committed
241
242
243
244
245
246
247
248
249
250
251
252
253
254
        << tmp_num <<" <= 0" << endl;
      throw ( std::runtime_error ( ss.str() ) );
    }
//     cout << "Nz.at("<< i << ") = " << tmp_num << endl;
    number_points[i+2] = tmp_num;
  }

  variable_set = false;
}



Blockgrid::Blockgrid(Unstructured_grid *ug_, std::vector<int>& Nx, std::vector<int>& Ny, std::vector<int>& Nz) {
  id_of_grid = id_count_grid; ++id_count_grid;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
255

Phillip Lino Rall's avatar
Phillip Lino Rall committed
256
257
    phase_shift = NULL;
  bg_coord = NULL;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
  ug = ug_;

  int size = Nx.size()+Ny.size()+Nz.size();

  if ( ug->degree_of_freedom() != size )
  {
    std::stringstream ss;
    ss << " error in Blockgrid::Blockgrid(Unstructured_grid *ug_,std::vector<int>& Nx,std::vector<int>& Ny,vector<int>& Nz,, int Nr) " << endl << "Nx.size+Ny.size+Nz.size = "<< Nx.size()+Ny.size()+Nz.size() << endl << "degree_of_freedom = " << ug->degree_of_freedom()
    << endl;
    throw ( std::runtime_error ( ss.str() ) );
  }

  number_points = new int[size];
  number_points[0] = Nx[0];
  number_points[1] = Ny[0];
  number_points[2] = Nz[0];
  for(int i = 1; i < Nx.size(); ++i)
  {
    number_points[i+2] = Nx[i];
  }
  for(int i = 1; i < Ny.size(); ++i)
  {
    number_points[Nx.size()+i+1] = Ny[i];
  }
  for(int i = 1; i < Nz.size(); ++i)
  {
    number_points[Nx.size()+Ny.size()+i] = Nz[i];
  }
}

Blockgrid::~Blockgrid()
{
  if ( number_points!=NULL )
    delete [] number_points;
  number_points = NULL;
Christoph Pflaum's avatar
Christoph Pflaum committed
293
  
294
295
  if (bg_coord != NULL)
    delete bg_coord;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
}

int Blockgrid::Give_Nx_hexahedron ( int id ) const
{
  return number_points[ug->Give_edge ( ( ug->Give_hexahedron ( id )->
                                         Give_id_edge ( SDed ) ) )->Give_color_of_edge() ];
}

int Blockgrid::Give_Ny_hexahedron ( int id ) const
{
  return number_points[ug->Give_edge ( ( ug->Give_hexahedron ( id )->
                                         Give_id_edge ( WDed ) ) )->Give_color_of_edge() ];
}

int Blockgrid::Give_Nz_hexahedron ( int id ) const
{
  return number_points[ug->Give_edge ( ( ug->Give_hexahedron ( id )->
                                         Give_id_edge ( SWed ) ) )->Give_color_of_edge() ];
}
int Blockgrid::Give_N_total_hexahedron ( int id ) const
{
  return
    ( Give_Nx_hexahedron ( id ) +1 ) *
    ( Give_Ny_hexahedron ( id ) +1 ) *
    ( Give_Nz_hexahedron ( id ) +1 );
}

int Blockgrid::Give_Nx_quadrangle ( int id ) const
{
  return number_points[ug->Give_edge ( ( ug->Give_quadrangle ( id )->
                                         Give_id_edge ( Sdir2D ) ) )->Give_color_of_edge() ];
}

int Blockgrid::Give_Ny_quadrangle ( int id ) const
{
  return number_points[ug->Give_edge ( ( ug->Give_quadrangle ( id )->
                                         Give_id_edge ( Wdir2D ) ) )->Give_color_of_edge() ];
}

int Blockgrid::Give_N_total_quadrangle ( int id ) const
{
  return ( Give_Nx_quadrangle ( id ) +1 ) * ( Give_Ny_quadrangle ( id ) +1 );
}

int Blockgrid::Give_Nx_edge ( int id ) const
{
  return number_points[ug->Give_edge ( id )->Give_color_of_edge() ];
}

int Blockgrid::Give_N_color ( int color ) const
{
  if ( developer_version )
    if ( color>=ug->degree_of_freedom() || color<0 )
      cout << " error in  Blockgrid::Give_N_color " << endl;

  return number_points[color];
}

inline double change ( bool ori, double q )
{
  if ( ori ) return q;
  return 1.0-q;
}

inline double find_p ( Edges_cell ed, double eta, double xi,double phi )
{
  if ( ed<=NTed ) return eta;
  if ( ed<=ETed ) return xi;
  if ( developer_version )
    if ( ed>NEed ) cout << " error in find_p!" << endl;
  return phi;
}

Phillip Lino Rall's avatar
Phillip Lino Rall committed
369
370
371
372
373
374
inline std::vector<int> find_p_quad ( dir3D quad, Hexahedron_el *hex )
{
    // enum Edges_cell { SDed, NDed, STed, NTed,
    //                   WDed, EDed, WTed, ETed,
    //                   SWed, SEed, NWed, NEed };
    std::vector<int> ijk = {1 , 1 , 1};
375
376
377
378
379
//    for (int iter = 0 ; iter < 12; iter++)
//    {
//        std::cout << hex->orientation[iter] << "\n" ;
//    }
//    std::cout << std::endl;
380

Phillip Lino Rall's avatar
Phillip Lino Rall committed
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
    if (quad == Wdir3D)
    {
        hex->orientation[4];
        hex->orientation[6];
        hex->orientation[8];
        hex->orientation[10];
        ijk[0] = 0;
        if (!hex->orientation[4] && !hex->orientation[6])
        {
            ijk[1] = -1;
        }
        if (!hex->orientation[8] && !hex->orientation[10])
        {
            ijk[2] = -1;
        }
    }
    else if (quad == Edir3D)
    {
        hex->orientation[5];
        hex->orientation[7];
        hex->orientation[9];
        hex->orientation[11];
        ijk[0] = 0;
        if (!hex->orientation[5] && !hex->orientation[7])
        {
            ijk[1] = -1;
        }
        if (!hex->orientation[9] && !hex->orientation[11])
        {
            ijk[2] = -1;
        }
    }
    else if (quad == Sdir3D)
    {
        hex->orientation[0];
        hex->orientation[2];
        hex->orientation[8];
        hex->orientation[9];
        ijk[1] = 0;
        if (!hex->orientation[0] && !hex->orientation[2])
        {
            ijk[0] = -1;
        }
        if (!hex->orientation[8] && !hex->orientation[9])
        {
            ijk[2] = -1;
        }
    }
    else if (quad == Ndir3D)
    {
        hex->orientation[1];
        hex->orientation[3];
        hex->orientation[10];
        hex->orientation[11];
        ijk[1] = 0;
        if (!hex->orientation[1] && !hex->orientation[3])
        {
            ijk[0] = -1;
        }
        if (!hex->orientation[10] && !hex->orientation[11])
        {
            ijk[2] = -1;
        }
    }
    else if (quad == Ddir3D)
    {
        hex->orientation[0];
        hex->orientation[1];
        hex->orientation[4];
        hex->orientation[5];
        ijk[2] = 0;
        if (!hex->orientation[0] && !hex->orientation[1])
        {
            ijk[0] = -1;
        }
        if (!hex->orientation[4] && !hex->orientation[5])
        {
            ijk[1] = -1;
        }
    }
    else if (quad == Tdir3D)
    {
        hex->orientation[2];
        hex->orientation[3];
        hex->orientation[6];
        hex->orientation[7];
        ijk[2] = 0;
        if (!hex->orientation[2] && !hex->orientation[3])
        {
            ijk[0] = -1;
        }
        if (!hex->orientation[6] && !hex->orientation[7])
        {
            ijk[1] = -1;
        }
    }
    return ijk;

}

Phillip Lino Rall's avatar
Phillip Lino Rall committed
481
482
483
D3vector Blockgrid::Give_coord_hexahedron ( int id_hex,
    int i, int j, int k ) const
{
Phillip Lino Rall's avatar
Phillip Lino Rall committed
484

Christoph Pflaum's avatar
Christoph Pflaum committed
485
    if(bg_coord != NULL) if(bg_coord->blockgrid_edge_coordinates_calculated)
486
487
488
489
490
        {
            int Nx = Give_Nx_hexahedron ( id_hex ) +1;
            int Ny = Give_Ny_hexahedron ( id_hex ) +1;
            //cout << "id_hex " << id_hex << " i " << i << " j " << j << " k " << k << endl;
            //cout << "index " << i + Nx* (j  + k * (Ny))<< endl;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
491
            return bg_coord->blockgrid_hexa_coordinates.at(id_hex).at(i + Nx* (j  + k * (Ny))  );
492
        }
493

Phillip Lino Rall's avatar
Phillip Lino Rall committed
494

Phillip Lino Rall's avatar
Phillip Lino Rall committed
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
  double eta,xi,phi;
  D3vector Psi[12];
  Hexahedron_el *hex;
  D3vector PL, PR;
  D3vector PSW, PSE, PNW, PNE;
  D3vector Pres, PT, PD;
  double   p_EW, p_NS;
  double   p;

  eta = ( double ) i/ ( double ) Give_Nx_hexahedron ( id_hex );
  xi  = ( double ) j/ ( double ) Give_Ny_hexahedron ( id_hex );
  phi = ( double ) k/ ( double ) Give_Nz_hexahedron ( id_hex );

  hex = ug->Give_hexahedron ( id_hex );

Phillip Lino Rall's avatar
Phillip Lino Rall committed
510
511
512
513
514
515
516
517
518
519



  std::vector<int> p_quad_Wdir3D = find_p_quad(Wdir3D,hex);
  std::vector<int> p_quad_Edir3D = find_p_quad(Edir3D,hex);
  std::vector<int> p_quad_Sdir3D = find_p_quad(Sdir3D,hex);
  std::vector<int> p_quad_Ndir3D = find_p_quad(Ndir3D,hex);
  std::vector<int> p_quad_Ddir3D = find_p_quad(Ddir3D,hex);
  std::vector<int> p_quad_Tdir3D = find_p_quad(Tdir3D,hex);

520

521

522
523


Phillip Lino Rall's avatar
Phillip Lino Rall committed
524
525
526
527
528
529
530
531
532
533
  int idW = hex->Give_id_quadrangle(Wdir3D);
  int idE = hex->Give_id_quadrangle(Edir3D);
  int idS = hex->Give_id_quadrangle(Sdir3D);
  int idN = hex->Give_id_quadrangle(Ndir3D);
  int idD = hex->Give_id_quadrangle(Ddir3D);
  int idT = hex->Give_id_quadrangle(Tdir3D);


  D3vector QS, QN, QE, QW, QT, QD;

534
  D3vector QPsi[6];
Phillip Lino Rall's avatar
Phillip Lino Rall committed
535
536


537
    if(ug->Give_transform_From_Quadrangle())
Phillip Lino Rall's avatar
Phillip Lino Rall committed
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
    {
        //geht bisher nur fuer 1 hexaeder, allgemien so richtig?
        // idW = 0 ; idE = 1 ; idS = 2 ; idN = 3 ; idD = 4 ; idT = 5;
        int nEdgeX = Give_Nx_hexahedron ( id_hex );
        int nEdgeY = Give_Ny_hexahedron ( id_hex );
        int nEdgeZ = Give_Nz_hexahedron ( id_hex );
        int quadSaddI = (p_quad_Sdir3D[0] == 1) ? 0 : nEdgeX;
        int quadSaddK = (p_quad_Sdir3D[2] == 1) ? 0 : nEdgeZ;
        int quadNaddI = (p_quad_Ndir3D[0] == 1) ? 0 : nEdgeX;
        int quadNaddK = (p_quad_Ndir3D[2] == 1) ? 0 : nEdgeZ;
        int quadDaddI = (p_quad_Ddir3D[0] == 1) ? 0 : nEdgeX;
        int quadDaddJ = (p_quad_Ddir3D[1] == 1) ? 0 : nEdgeY;
        int quadTaddI = (p_quad_Tdir3D[0] == 1) ? 0 : nEdgeX;
        int quadTaddJ = (p_quad_Tdir3D[1] == 1) ? 0 : nEdgeY;
        int quadEaddJ = (p_quad_Edir3D[1] == 1) ? 0 : nEdgeY;
        int quadEaddK = (p_quad_Edir3D[2] == 1) ? 0 : nEdgeZ;
        int quadWaddJ = (p_quad_Wdir3D[1] == 1) ? 0 : nEdgeY;
        int quadWaddK = (p_quad_Wdir3D[2] == 1) ? 0 : nEdgeZ;


558
559
560
561
562
563
564
565
566
//        std::cout <<"Nx "  << Give_Nx_quadrangle ( idW ) << " Ny " << Give_Ny_quadrangle ( idW ) << "\n";
//        std::cout <<"Nx "  << Give_Nx_quadrangle ( idE ) << " Ny " << Give_Ny_quadrangle ( idE ) << "\n";
//        std::cout <<"Nx "  << Give_Nx_quadrangle ( idS ) << " Ny " << Give_Ny_quadrangle ( idS ) << "\n";
//        std::cout <<"Nx "  << Give_Nx_quadrangle ( idN ) << " Ny " << Give_Ny_quadrangle ( idN ) << "\n";
//        std::cout <<"Nx "  << Give_Nx_quadrangle ( idD ) << " Ny " << Give_Ny_quadrangle ( idD ) << "\n";
//        std::cout <<"Nx "  << Give_Nx_quadrangle ( idT ) << " Ny " << Give_Ny_quadrangle ( idT ) << std::endl;

//        std::cout << std::endl;
//        std::cout << " transface coordiantes: "<< std::endl;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
567
568
        //with modification

569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
        bool invertTD = false;
        bool invertNS = false;
        bool invertEW = false;
        if (!(nEdgeY == Give_Nx_quadrangle ( idW ) && nEdgeZ == Give_Ny_quadrangle ( idW )))
        {
                invertEW = true;
        }

        if (!(nEdgeX == Give_Nx_quadrangle ( idS ) && nEdgeZ == Give_Ny_quadrangle ( idS ) ))
        {
            invertNS = true;
        }

        if (!(nEdgeX == Give_Nx_quadrangle ( idD ) && nEdgeY == Give_Ny_quadrangle ( idD )))
        {
            invertTD = true;
        }

        QPsi[0] = Give_coord_quadrangle( idW , quadWaddJ + j*p_quad_Wdir3D[1] , quadWaddK + k*p_quad_Wdir3D[2],invertEW);
        QPsi[1] = Give_coord_quadrangle( idE , quadEaddJ + j*p_quad_Edir3D[1] , quadEaddK + k*p_quad_Edir3D[2],invertEW);
        QPsi[2] = Give_coord_quadrangle( idS , quadSaddI + i*p_quad_Sdir3D[0] , quadSaddK + k*p_quad_Sdir3D[2],invertNS);
        QPsi[3] = Give_coord_quadrangle( idN , quadNaddI + i*p_quad_Ndir3D[0] , quadNaddK + k*p_quad_Ndir3D[2],invertNS);
        QPsi[4] = Give_coord_quadrangle( idD , quadDaddI + i*p_quad_Ddir3D[0] , quadDaddJ + j*p_quad_Ddir3D[1],invertTD);
        QPsi[5] = Give_coord_quadrangle( idT , quadTaddI + i*p_quad_Tdir3D[0] , quadTaddJ + j*p_quad_Tdir3D[1],invertTD);
        //delete again!!!
       // QPsi[5] = Give_coord_quadrangle( idT , quadTaddJ + j*p_quad_Tdir3D[1] , quadTaddI + i*p_quad_Tdir3D[0]);

        //std::cout << std::endl;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
597
598
        // Version: 1 x Flaechen + 2 x Kanten + 3 x Ecken
        // /////////////////////////////////////////////////////////
599
        Pres = (QPsi[0] + eta * (QPsi[1]-QPsi[0]) + QPsi[2] + xi * (QPsi[3]-QPsi[2]) + QPsi[4] + phi * (QPsi[5]-QPsi[4]));
Phillip Lino Rall's avatar
Phillip Lino Rall committed
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614

        //cout << "PresQuad V1 " ; PresQuad.Print();cout<<endl;

        PD = HWSD +
             ( HESD - HWSD ) * eta +
             ( HWND - HWSD ) * xi +
             ( HEND - HESD - HWND + HWSD ) * eta * xi;

        PT = HWST +
             ( HEST - HWST ) * eta +
             ( HWNT - HWST ) * xi +
             ( HENT - HEST - HWNT + HWST ) * eta * xi;

        // Version: 0 x Flaechen + 0 x Kanten + 1 x Ecken
        // /////////////////////////////////////////////////////////
615
        Pres = Pres +
Phillip Lino Rall's avatar
Phillip Lino Rall committed
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
               1.0 * ( PD + ( PT-PD ) * phi );



        // Version: 0 x Flaechen + 1 x Kanten + 3 x Ecken
        // /////////////////////////////////////////////////////////

        bool coordianteFromCorners = false;

        for ( int md = 0; md < 3; ++md )
        {






          if ( md==0 ) // EW
          {

636
              PSW = Give_coord_quadrangle(idS,quadSaddI+i*p_quad_Sdir3D[0] ,quadSaddK, invertNS);
Phillip Lino Rall's avatar
Phillip Lino Rall committed
637
638
639
              if(coordianteFromCorners)
              PSW = Psi[SDed];

640
              PSE = Give_coord_quadrangle(idN,quadNaddI+i * p_quad_Ndir3D[0],quadNaddK, invertNS);
Phillip Lino Rall's avatar
Phillip Lino Rall committed
641
642
643
644
             if(coordianteFromCorners)
              PSE = Psi[NDed];


645
              PNW = Give_coord_quadrangle(idS,quadSaddI+i*p_quad_Sdir3D[0] ,nEdgeZ-quadSaddK, invertNS);
Phillip Lino Rall's avatar
Phillip Lino Rall committed
646
647
648
649
              if(coordianteFromCorners)
              PNW = Psi[STed];


650
              PNE = Give_coord_quadrangle(idN,quadNaddI+i * p_quad_Ndir3D[0],nEdgeZ-quadNaddK, invertNS);
Phillip Lino Rall's avatar
Phillip Lino Rall committed
651
652
653
654
655
656
657
              if(coordianteFromCorners)
              PNE = Psi[NTed];



            p_EW = xi;
            p_NS = phi;
658

Phillip Lino Rall's avatar
Phillip Lino Rall committed
659
660
661
662
663
          }
          if ( md==1 ) // NS
          {


664
              PSW = Give_coord_quadrangle(idD,quadDaddI,quadDaddJ+j*p_quad_Ddir3D[1], invertTD);
Phillip Lino Rall's avatar
Phillip Lino Rall committed
665
666
667
668
              if(coordianteFromCorners)
              PSW = Psi[WDed];


669
            PSE = Give_coord_quadrangle(idD,nEdgeX-quadDaddI,quadDaddJ+j*p_quad_Ddir3D[1], invertTD);
Phillip Lino Rall's avatar
Phillip Lino Rall committed
670
671
672
673
            if(coordianteFromCorners)
            PSE = Psi[EDed];


674
            PNW = Give_coord_quadrangle(idT,quadTaddI,quadTaddJ+j*p_quad_Tdir3D[1], invertTD);
Phillip Lino Rall's avatar
Phillip Lino Rall committed
675
676
677
            if(coordianteFromCorners)
            PNW = Psi[WTed];

678
            PNE = Give_coord_quadrangle(idT,nEdgeX-quadTaddI,quadTaddJ+j*p_quad_Tdir3D[1], invertTD);
Phillip Lino Rall's avatar
Phillip Lino Rall committed
679
680
681
682
683
684
685
686
            if(coordianteFromCorners)
            PNE = Psi[ETed];




            p_EW = eta;
            p_NS = phi;
687

Phillip Lino Rall's avatar
Phillip Lino Rall committed
688
689
690
691
692
          }
          if ( md==2 ) // TD
          {


693
            PSW = Give_coord_quadrangle(idW,quadWaddJ,quadWaddK+k*p_quad_Wdir3D[2], invertEW);
Phillip Lino Rall's avatar
Phillip Lino Rall committed
694
695
696
           if(coordianteFromCorners)
            PSW = Psi[SWed];

697
            PSE = Give_coord_quadrangle(idE,quadEaddJ,quadEaddK+k*p_quad_Edir3D[2], invertEW);
Phillip Lino Rall's avatar
Phillip Lino Rall committed
698
699
700
701
            if(coordianteFromCorners)
            PSE = Psi[SEed];


702
            PNW = Give_coord_quadrangle(idW,nEdgeY-quadWaddJ,quadWaddK+k*p_quad_Wdir3D[2], invertEW);
Phillip Lino Rall's avatar
Phillip Lino Rall committed
703
704
705
            if(coordianteFromCorners)
            PNW = Psi[NWed];

706
            PNE = Give_coord_quadrangle(idE,nEdgeY-quadEaddJ,quadEaddK+k*p_quad_Edir3D[2], invertEW);
Phillip Lino Rall's avatar
Phillip Lino Rall committed
707
708
709
710
711
712
713
714
715
           if(coordianteFromCorners)
            PNE = Psi[NEed];

            p_EW = eta;
            p_NS = xi;


          }

716
          Pres = Pres + ( PSW +
Phillip Lino Rall's avatar
Phillip Lino Rall committed
717
718
719
720
721
                 ( PSE - PSW ) * p_EW +
                 ( PNW - PSW ) * p_NS +
                 ( PNE - PSE - PNW + PSW ) * p_EW * p_NS) * (-1.0);
        }

722

Phillip Lino Rall's avatar
Phillip Lino Rall committed
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
    }
    else
    {
        for ( int ed = 0; ed < 12; ++ed )
        {
          p = find_p ( ( Edges_cell ) ed,eta,xi,phi );
          Psi[ed] = hex->transform[ed] ( change ( hex->orientation[ed],p ) ,
                         hex->shiftPointer(ug->Get_pointer_global_data()));
          PL = hex->Give_coord ( Transform ( ( Edges_cell ) ed,Ldir1D ) );
          PR = hex->Give_coord ( Transform ( ( Edges_cell ) ed,Rdir1D ) );
          Psi[ed] = Psi[ed] + PL + ( PR-PL ) * p;
        }



Phillip Lino Rall's avatar
Phillip Lino Rall committed
738
739
740
741
742
743
744
745
746
747
748

  Pres = D3vector ( 0.0,0.0,0.0 );
  for ( int md = 0; md < 3; ++md )
  {
    if ( md==0 ) // EW
    {
      PSW = Psi[SDed];
      PSE = Psi[NDed];
      PNW = Psi[STed];
      PNE = Psi[NTed];

Phillip Lino Rall's avatar
Phillip Lino Rall committed
749

Phillip Lino Rall's avatar
Phillip Lino Rall committed
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
      p_EW = xi;
      p_NS = phi;
    }
    if ( md==1 ) // NS
    {
      PSW = Psi[WDed];
      PSE = Psi[EDed];
      PNW = Psi[WTed];
      PNE = Psi[ETed];

      p_EW = eta;
      p_NS = phi;
    }
    if ( md==2 ) // TD
    {
      PSW = Psi[SWed];
      PSE = Psi[SEed];
      PNW = Psi[NWed];
      PNE = Psi[NEed];

      p_EW = eta;
      p_NS = xi;
    }
Phillip Lino Rall's avatar
Phillip Lino Rall committed
773
774
775

    // Version: 0 x Flaechen + 1 x Kanten + 3 x Ecken
    // /////////////////////////////////////////////////////////
Phillip Lino Rall's avatar
Phillip Lino Rall committed
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
    Pres = Pres + PSW +
           ( PSE - PSW ) * p_EW +
           ( PNW - PSW ) * p_NS +
           ( PNE - PSE - PNW + PSW ) * p_EW * p_NS;
  }

  PD = HWSD +
       ( HESD - HWSD ) * eta +
       ( HWND - HWSD ) * xi +
       ( HEND - HESD - HWND + HWSD ) * eta * xi;

  PT = HWST +
       ( HEST - HWST ) * eta +
       ( HWNT - HWST ) * xi +
       ( HENT - HEST - HWNT + HWST ) * eta * xi;

  Pres = Pres -
         2.0 * ( PD + ( PT-PD ) * phi );
794
  }
Phillip Lino Rall's avatar
Phillip Lino Rall committed
795

796

Phillip Lino Rall's avatar
Phillip Lino Rall committed
797
798
799
800
801
802
  if ( hex->transform_hex== NULL )
    return Pres;
  else
    return Pres + hex->transform_hex ( id_hex,eta,xi,phi );
}

803
D3vector Blockgrid::Give_coord_quadrangle (int id, int i, int j, bool invert) const
Phillip Lino Rall's avatar
Phillip Lino Rall committed
804
{
805
806
807
808
809
810
811
812
813
    if(bg_coord != NULL) if(bg_coord->blockgrid_quad_coordinates_calculated)
        {
            int Nx = Give_Nx_quadrangle(  id ) +1;
            //cout << "id_hex " << id_hex << " i " << i << " j " << j << " k " << k << endl;
            //cout << "index " << i + Nx* (j  + k * (Ny))<< endl;
            return bg_coord->blockgrid_quad_coordinates.at(id).at(i + Nx* (j  )  );
        }


814
815


Phillip Lino Rall's avatar
Phillip Lino Rall committed
816
817
  double eta, xi;
  D3vector PSW, PSE, PNW, PNE, PW, PE, PN, PS;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
818
  D3vector PTransFace, PWithoutTrans;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
819
820
821
  Quadrangle_el* quad;
  Edge_el* edge;

Phillip Lino Rall's avatar
Phillip Lino Rall committed
822
823
  quad = this->ug->Give_quadrangle ( id );

824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
  double Nx = (double) Give_Nx_quadrangle ( id );
  double Ny = ( double ) Give_Ny_quadrangle ( id );

//  std::cout << "nx ny " << Nx << " " << Ny << std::endl;
//  if (id == 23 && Nx != Ny)
//  {
//      std::cout << "break";
//  }

//  std::cout << "nx ny " << Nx << " " << Ny << std::endl;
  if (invert)
  {
      double temp = Nx; Nx = Ny; Ny = temp;
  }
  //std::cout << "nx ny " << Nx << " " << Ny << std::endl;
  eta = ( double ) i/ Nx;
  xi = ( double ) j/ Ny;

  if (eta > 1 || xi > 1)
  {
      std::cout << "debug : flag is " << invert << ", but should be " << !invert << std::endl;
      std::cout << std::endl;
  }
Phillip Lino Rall's avatar
Phillip Lino Rall committed
847
848
849
850
851
852
853
854


  // @todo : so sollte es sein
  PSW  = quad->Give_coord ( SWdir2D );
  PSE  = quad->Give_coord ( SEdir2D );
  PNW  = quad->Give_coord ( NWdir2D );
  PNE  = quad->Give_coord ( NEdir2D );

Phillip Lino Rall's avatar
Phillip Lino Rall committed
855
856


Phillip Lino Rall's avatar
Phillip Lino Rall committed
857
858
859
860
861
862
863
864
865
866
867
868
869
870
  /*
  // aber ist noch so
  PSW  = ug->Give_point(quad->Give_id_corner(SWdir2D))->Give_coordinate();
  PSE  = ug->Give_point(quad->Give_id_corner(SEdir2D))->Give_coordinate();
  PNW  = ug->Give_point(quad->Give_id_corner(NWdir2D))->Give_coordinate();
  PNE  = ug->Give_point(quad->Give_id_corner(NEdir2D))->Give_coordinate();
  */

  if ( developer_version )
    if ( quad->Give_id_corner ( SWdir2D ) >=quad->Give_id_corner ( SEdir2D ) ||
         quad->Give_id_corner ( SEdir2D ) >=quad->Give_id_corner ( NWdir2D )  ||
         quad->Give_id_corner ( SWdir2D ) >=quad->Give_id_corner ( NEdir2D ) )
      cout << " error in Blockgrid::Give_coord_quadrangle! " << endl;

Phillip Lino Rall's avatar
Phillip Lino Rall committed
871
872
873
874
875
  //Phillip version with deformed faces

  if (quad->transform != NULL)
  {
      PTransFace = quad->transform ( eta, xi, quad->shiftPointer(ug->Get_pointer_global_data()));
876
877
878
      //std::cout << "PTransFace ";PTransFace.Print();
      D3vector TEMP = PSW + (PSE-PSW) * eta + (PNW-PSW)*xi + (PNE-PSE-PNW+PSW)*xi*eta ;
      PTransFace =  TEMP + PTransFace;//   + PTransFace;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
879
880
881
882
      return PTransFace;
  }

  //Christoph version with deformed edges
Phillip Lino Rall's avatar
Phillip Lino Rall committed
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
  edge = ug->Give_edge ( quad->Give_id_edge ( Wdir2D ) );
  PW = edge->transform ( xi, edge->shiftPointer(ug->Get_pointer_global_data()));
  PW = PW + PSW + ( PNW-PSW ) * xi;

  edge = ug->Give_edge ( quad->Give_id_edge ( Sdir2D ) );
  PS = edge->transform ( eta, edge->shiftPointer(ug->Get_pointer_global_data()));
  PS = PS + PSW + ( PSE-PSW ) * eta;

  edge = ug->Give_edge ( quad->Give_id_edge ( Edir2D ) ); // @todo: warum braucht man hier kein orientation
  PE = edge->transform ( xi, edge->shiftPointer(ug->Get_pointer_global_data()));
  PE = PE + PSE + ( PNE-PSE ) * xi;

  edge = ug->Give_edge ( quad->Give_id_edge ( Ndir2D ) ); // @todo: warum braucht man hier kein orientation
  PN = edge->transform ( eta , edge->shiftPointer(ug->Get_pointer_global_data()));
  PN = PN + PNW + ( PNE-PNW ) * eta;

  return
    PW + eta* ( PE-PW ) +
    PS + xi* ( PN-PS )
    - ( PSW +
        ( PSE - PSW ) * eta +
        ( PNW - PSW ) * xi +
        ( PNE - PSE - PNW + PSW ) * eta * xi );
}

D3vector Blockgrid::Give_coord_edge ( int id, int i ) const
{
Phillip Lino Rall's avatar
Phillip Lino Rall committed
910

Christoph Pflaum's avatar
Christoph Pflaum committed
911
        if(bg_coord != NULL) if(bg_coord->blockgrid_edge_coordinates_calculated)
912
        {
Phillip Lino Rall's avatar
Phillip Lino Rall committed
913
            return bg_coord->blockgrid_edge_coordinates.at(id).at(i) ;
914
        }
Phillip Lino Rall's avatar
Phillip Lino Rall committed
915

916

917

Phillip Lino Rall's avatar
Phillip Lino Rall committed
918
    Quadrangle_el* quad;
919
    Hexahedron_el* hex;
Phillip Lino Rall's avatar
Phillip Lino Rall committed
920
    D3vector Psi;
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965

    if (ug->Give_transform_From_Quadrangle())
    {
    int idHex;
    dir3D dirForQuad;
    int quadId;

    if (ug->Give_edge_to_quad_id(id) == -1)
    {
       // cout << "slow way, once each, id " << id << endl;

    //findet hexahedron entsprechend zur kanten ID
    for (int iterHex = 0 ; iterHex < ug->Give_number_hexahedra() ; iterHex++)
    {
        idHex = iterHex;
        hex = ug->Give_hexahedron(iterHex);
        for (int iter = 0 ; iter < 12 ; iter++)
        {
            int idCorner = hex->Give_id_edge(Edges_cell(iter));
            if (idCorner == id)
            {
               iterHex = ug->Give_number_hexahedra() ;
               iter = 12;
            }
        }
    }


    //findet quad ID sowie ausrichtung entsprechend zur kanten ID
    for ( int iter = 0 ; iter < 6 ; iter++)
    {
        quad = ug->Give_quadrangle(hex->Give_id_quadrangle((dir3D)iter));
        dirForQuad = (dir3D)iter ;
        for (int iterEdge = 0 ; iterEdge < 4 ; iterEdge++)
        {
            quadId = quad->Give_id_edge((dir2D)iterEdge);
            if (id == quadId)
            {
                quadId = hex->Give_id_quadrangle((dir3D)iter);
                iterEdge = 4;
                iter = 6;

            }
        }
    }
966
    ug->Set_edge_to_hex_id(id, idHex);
967
968
969
970
971
    ug->Set_edge_to_quad_id(id,quadId);
    ug->Set_edge_to_quad_dir(id,(int)dirForQuad);
    }
    else
    {
972
        idHex = ug->Give_edge_to_hex_id(id);
973
974
975
976
977
        quadId = ug->Give_edge_to_quad_id(id);
        dirForQuad = (dir3D)ug->Give_edge_to_quad_dir(id);
        quad = ug->Give_quadrangle(quadId);
    }

978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
    int Nx = Give_Nx_quadrangle(quadId);
    int Ny = Give_Ny_quadrangle(quadId);
    int nEdgeX = Give_Nx_hexahedron ( idHex );
    int nEdgeY = Give_Ny_hexahedron ( idHex );
    int nEdgeZ = Give_Nz_hexahedron ( idHex );
    bool invert = false;

//    std::cout << "dirForQuad " << dirForQuad << std::endl;
//    std::cout << "Nx " << Nx << " Ny " << Ny << std::endl;
//            if (!(Nx == Give_Nx_quadrangle ( dirForQuad ) && Ny == Give_Ny_quadrangle ( dirForQuad ) ))
//            {
//                invert = true;
//            }
//    if (dirForQuad == Edir3D || dirForQuad == Wdir3D)
//    {
//        if (!(nEdgeY == Give_Nx_quadrangle ( dirForQuad ) && nEdgeZ == Give_Ny_quadrangle ( dirForQuad ) ))
//        {
//            invert = true;
//        }
//    }
//    else if (dirForQuad == Ndir3D || dirForQuad == Sdir3D)
//    {
//        if (!(nEdgeX == Give_Nx_quadrangle ( dirForQuad ) && nEdgeZ == Give_Ny_quadrangle ( dirForQuad ) ))
For faster browsing, not all history is shown. View entire blame