00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 char grille3d_C[] = "$Header: /cvsroot/Lorene/C++/Source/Grille3d/grille3d.C,v 1.6 2008/08/27 08:47:38 jl_cornou Exp $" ;
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092 #include <stdlib.h>
00093 #include <math.h>
00094 #include <assert.h>
00095
00096 #include "grilles.h"
00097 #include "type_parite.h"
00098 #include "proto.h"
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108 Grille3d::Grille3d(int nrs, int nts, int nps)
00109 : nr(nrs), nt(nts), np(nps)
00110 {
00111 x = new double[nr] ;
00112 tet = new double[nt] ;
00113 phi = new double[np] ;
00114 }
00115
00116
00117
00118 Grille3d::~Grille3d() {
00119 delete [] x ;
00120 delete [] tet ;
00121 delete [] phi ;
00122 }
00123
00124
00125
00126
00127
00128
00129 Grille3d_r::Grille3d_r(int nrs, int nts, int nps)
00130 : Grille3d(nrs, nts, nps)
00131 {
00132
00133
00134 assert(nps != 1) ;
00135
00136 type_r = RARE ;
00137 type_t = NONSYM ;
00138 type_p = NONSYM ;
00139
00140
00141 double xx = 0 ;
00142 if (nr>1) xx = M_PI/double(2*(nr-1)) ;
00143 for (int i=0 ; i<nr ; i++) {
00144 x[i] = sin(xx*i) ;
00145 }
00146
00147 if (nt > 1)
00148 xx = M_PI/double(nt-1) ;
00149 else
00150 xx = 0. ;
00151 for (int i=0 ; i<nt ; i++) {
00152 tet[i] = xx*i ;
00153 }
00154
00155 xx = 2.*M_PI/double(np) ;
00156 for (int i=0 ; i<np ; i++) {
00157 phi[i] = xx*i ;
00158 }
00159 }
00160
00161
00162
00163 Grille3d_r::~Grille3d_r() { }
00164
00165
00166
00167
00168
00169
00170
00171
00172 Grille3d_f::Grille3d_f(int nrs, int nts, int nps)
00173 : Grille3d(nrs, nts, nps)
00174 {
00175
00176 assert(nps != 1) ;
00177
00178 double xx ;
00179
00180 type_r = FIN ;
00181 type_t = NONSYM ;
00182 type_p = NONSYM ;
00183
00184
00185 xx = 0 ;
00186 if (nr>1) xx = M_PI/double(nr-1) ;
00187 for (int i=0 ; i<nr ; i++) {
00188 x[i] = -cos(xx*i) ;
00189 }
00190
00191 if (nt > 1)
00192 xx = M_PI/double(nt-1) ;
00193 else
00194 xx = 0. ;
00195 for (int i=0 ; i<nt ; i++) {
00196 tet[i] = xx*i ;
00197 }
00198
00199 xx = 2.*M_PI/double(np) ;
00200 for (int i=0 ; i<np ; i++) {
00201 phi[i] = xx*i ;
00202 }
00203 }
00204
00205
00206
00207 Grille3d_f::~Grille3d_f() { }
00208
00209
00210
00211
00212
00213
00214
00215 Grille3d_i::Grille3d_i(int nrs, int nts, int nps)
00216 : Grille3d(nrs, nts, nps)
00217 {
00218
00219 assert(nps != 1) ;
00220
00221 double xx ;
00222
00223 type_r = UNSURR ;
00224 type_t = NONSYM ;
00225 type_p = NONSYM ;
00226
00227
00228 xx = 0 ;
00229 if (nr>1) xx = M_PI/double(nr-1) ;
00230 for (int i=0 ; i<nr ; i++) {
00231 x[i] = -cos(xx*i) ;
00232 }
00233
00234 if (nt > 1)
00235 xx = M_PI/double(nt-1) ;
00236 else
00237 xx = 0. ;
00238 for (int i=0 ; i<nt ; i++) {
00239 tet[i] = xx*i ;
00240 }
00241
00242 xx = 2.*M_PI/double(np) ;
00243 for (int i=0 ; i<np ; i++) {
00244 phi[i] = xx*i ;
00245 }
00246 }
00247
00248
00249
00250 Grille3d_i::~Grille3d_i() { }
00251
00252
00253
00254
00255
00256
00257
00258 Grille3d_req::Grille3d_req(int nrs, int nts, int nps)
00259 : Grille3d(nrs, nts, nps)
00260 {
00261
00262 double xx ;
00263
00264 type_r = RARE ;
00265 type_t = SYM ;
00266 type_p = NONSYM ;
00267
00268
00269 xx = 0 ;
00270 if (nr>1) xx = M_PI/double(2*(nr-1)) ;
00271 for (int i=0 ; i<nr ; i++) {
00272 x[i] = sin(xx*i) ;
00273 }
00274
00275 if (nt > 1)
00276 xx = M_PI/double(2*(nt-1)) ;
00277 else
00278 xx = 0. ;
00279 for (int i=0 ; i<nt ; i++) {
00280 tet[i] = xx*i ;
00281 }
00282
00283 xx = 2.*M_PI/double(np) ;
00284 for (int i=0 ; i<np ; i++) {
00285 phi[i] = xx*i ;
00286 }
00287 }
00288
00289
00290
00291 Grille3d_req::~Grille3d_req() { }
00292
00293
00294
00295
00296
00297
00298
00299
00300 Grille3d_feq::Grille3d_feq(int nrs, int nts, int nps)
00301 : Grille3d(nrs, nts, nps)
00302 {
00303
00304 double xx ;
00305
00306 type_r = FIN ;
00307 type_t = SYM ;
00308 type_p = NONSYM ;
00309
00310
00311 xx = 0 ;
00312 if (nr>1) xx = M_PI/double(nr-1) ;
00313 for (int i=0 ; i<nr ; i++) {
00314 x[i] = -cos(xx*i) ;
00315 }
00316
00317 if (nt > 1)
00318 xx = M_PI/double(2*(nt-1)) ;
00319 else
00320 xx = 0. ;
00321 for (int i=0 ; i<nt ; i++) {
00322 tet[i] = xx*i ;
00323 }
00324
00325 xx = 2.*M_PI/double(np) ;
00326 for (int i=0 ; i<np ; i++) {
00327 phi[i] = xx*i ;
00328 }
00329 }
00330
00331
00332
00333 Grille3d_feq::~Grille3d_feq() { }
00334
00335
00336
00337
00338
00339
00340
00341 Grille3d_ieq::Grille3d_ieq(int nrs, int nts, int nps)
00342 : Grille3d(nrs, nts, nps)
00343 {
00344
00345 double xx ;
00346
00347 type_r = UNSURR ;
00348 type_t = SYM ;
00349 type_p = NONSYM ;
00350
00351
00352 xx = 0 ;
00353 if (nr>1) xx = M_PI/double(nr-1) ;
00354 for (int i=0 ; i<nr ; i++) {
00355 x[i] = -cos(xx*i) ;
00356 }
00357
00358 if (nt > 1)
00359 xx = M_PI/double(2*(nt-1)) ;
00360 else
00361 xx = 0. ;
00362 for (int i=0 ; i<nt ; i++) {
00363 tet[i] = xx*i ;
00364 }
00365
00366 xx = 2.*M_PI/double(np) ;
00367 for (int i=0 ; i<np ; i++) {
00368 phi[i] = xx*i ;
00369 }
00370 }
00371
00372
00373
00374 Grille3d_ieq::~Grille3d_ieq() { }
00375
00376
00377
00378
00379
00380
00381
00382 Grille3d_r2p::Grille3d_r2p(int nrs, int nts, int nps)
00383 : Grille3d(nrs, nts, nps)
00384 {
00385
00386 double xx ;
00387
00388 type_r = RARE ;
00389 type_t = NONSYM ;
00390 type_p = SYM ;
00391
00392
00393 xx = 0 ;
00394 if (nr>1) xx = M_PI/double(2*(nr-1)) ;
00395 for (int i=0 ; i<nr ; i++) {
00396 x[i] = sin(xx*i) ;
00397 }
00398
00399 if (nt > 1)
00400 xx = M_PI/double(nt-1) ;
00401 else
00402 xx = 0. ;
00403 for (int i=0 ; i<nt ; i++) {
00404 tet[i] = xx*i ;
00405 }
00406
00407 xx = M_PI/double(np) ;
00408 for (int i=0 ; i<np ; i++) {
00409 phi[i] = xx*i ;
00410 }
00411 }
00412
00413
00414
00415 Grille3d_r2p::~Grille3d_r2p() { }
00416
00417
00418
00419
00420
00421
00422
00423 Grille3d_f2p::Grille3d_f2p(int nrs, int nts, int nps)
00424 : Grille3d(nrs, nts, nps)
00425 {
00426
00427 double xx ;
00428
00429 type_r = FIN ;
00430 type_t = NONSYM ;
00431 type_p = SYM ;
00432
00433
00434 xx = 0 ;
00435 if (nr>1) xx = M_PI/double(nr-1) ;
00436 for (int i=0 ; i<nr ; i++) {
00437 x[i] = -cos(xx*i) ;
00438 }
00439
00440 if (nt > 1)
00441 xx = M_PI/double(nt-1) ;
00442 else
00443 xx = 0. ;
00444 for (int i=0 ; i<nt ; i++) {
00445 tet[i] = xx*i ;
00446 }
00447
00448 xx = M_PI/double(np) ;
00449 for (int i=0 ; i<np ; i++) {
00450 phi[i] = xx*i ;
00451 }
00452 }
00453
00454
00455
00456 Grille3d_f2p::~Grille3d_f2p() { }
00457
00458
00459
00460
00461
00462
00463
00464 Grille3d_i2p::Grille3d_i2p(int nrs, int nts, int nps)
00465 : Grille3d(nrs, nts, nps)
00466 {
00467
00468 double xx ;
00469
00470 type_r = UNSURR ;
00471 type_t = NONSYM ;
00472 type_p = SYM ;
00473
00474
00475 xx = 0 ;
00476 if (nr>1) xx = M_PI/double(nr-1) ;
00477 for (int i=0 ; i<nr ; i++) {
00478 x[i] = -cos(xx*i) ;
00479 }
00480
00481 if (nt > 1)
00482 xx = M_PI/double(nt-1) ;
00483 else
00484 xx = 0. ;
00485 for (int i=0 ; i<nt ; i++) {
00486 tet[i] = xx*i ;
00487 }
00488
00489 xx = M_PI/double(np) ;
00490 for (int i=0 ; i<np ; i++) {
00491 phi[i] = xx*i ;
00492 }
00493 }
00494
00495
00496
00497 Grille3d_i2p::~Grille3d_i2p() { }
00498
00499
00500
00501
00502
00503
00504
00505 Grille3d_rs::Grille3d_rs(int nrs, int nts, int nps)
00506 : Grille3d(nrs, nts, nps)
00507 {
00508
00509 double xx ;
00510
00511 type_r = RARE ;
00512 type_t = SYM ;
00513 type_p = SYM ;
00514
00515
00516 xx = 0 ;
00517 if (nr>1) xx = M_PI/double(2*(nr-1)) ;
00518 for (int i=0 ; i<nr ; i++) {
00519 x[i] = sin(xx*i) ;
00520 }
00521
00522 if (nt > 1)
00523 xx = M_PI/double(2*(nt-1)) ;
00524 else
00525 xx = 0. ;
00526 for (int i=0 ; i<nt ; i++) {
00527 tet[i] = xx*i ;
00528 }
00529
00530 xx = M_PI/double(np) ;
00531 for (int i=0 ; i<np ; i++) {
00532 phi[i] = xx*i ;
00533 }
00534 }
00535
00536
00537
00538 Grille3d_rs::~Grille3d_rs() { }
00539
00540
00541
00542
00543
00544
00545
00546 Grille3d_fs::Grille3d_fs(int nrs, int nts, int nps)
00547 : Grille3d(nrs, nts, nps)
00548 {
00549
00550 double xx ;
00551
00552 type_r = FIN ;
00553 type_t = SYM ;
00554 type_p = SYM ;
00555
00556
00557 xx = 0 ;
00558 if (nr>1) xx = M_PI/double(nr-1) ;
00559 for (int i=0 ; i<nr ; i++) {
00560 x[i] = -cos(xx*i) ;
00561 }
00562
00563 if (nt > 1)
00564 xx = M_PI/double(2*(nt-1)) ;
00565 else
00566 xx = 0. ;
00567 for (int i=0 ; i<nt ; i++) {
00568 tet[i] = xx*i ;
00569 }
00570
00571 xx = M_PI/double(np) ;
00572 for (int i=0 ; i<np ; i++) {
00573 phi[i] = xx*i ;
00574 }
00575 }
00576
00577
00578
00579 Grille3d_fs::~Grille3d_fs() { }
00580
00581
00582
00583
00584
00585
00586
00587 Grille3d_is::Grille3d_is(int nrs, int nts, int nps)
00588 : Grille3d(nrs, nts, nps)
00589 {
00590
00591 double xx ;
00592
00593 type_r = UNSURR ;
00594 type_t = SYM ;
00595 type_p = SYM ;
00596
00597
00598 xx = 0 ;
00599 if (nr>1) xx = M_PI/double(nr-1) ;
00600 for (int i=0 ; i<nr ; i++) {
00601 x[i] = -cos(xx*i) ;
00602 }
00603
00604 if (nt > 1)
00605 xx = M_PI/double(2*(nt-1)) ;
00606 else
00607 xx = 0. ;
00608 for (int i=0 ; i<nt ; i++) {
00609 tet[i] = xx*i ;
00610 }
00611
00612 xx = M_PI/double(np) ;
00613 for (int i=0 ; i<np ; i++) {
00614 phi[i] = xx*i ;
00615 }
00616 }
00617
00618
00619
00620 Grille3d_is::~Grille3d_is() { }
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632 Grille3d_fj::Grille3d_fj(int nrs, int nts, int nps)
00633 : Grille3d(nrs, nts, nps)
00634 {
00635
00636
00637 assert(nps != 1) ;
00638
00639 double xx ;
00640
00641 type_r = FINJAC ;
00642 type_t = NONSYM ;
00643 type_p = NONSYM ;
00644
00645
00646 if (nr > 1) {
00647 double* yy = pointsgausslobatto(nr-1);
00648 for (int i=0 ; i<nr ; i++) {
00649 x[i] = yy[i] ;
00650 }
00651 delete [] yy ;
00652 }
00653 else
00654 x[0]=0;
00655
00656
00657 if (nt > 1)
00658 xx = M_PI/double(nt-1) ;
00659 else
00660 xx = 0. ;
00661 for (int i=0 ; i<nt ; i++) {
00662 tet[i] = xx*i ;
00663 }
00664
00665 xx = 2.*M_PI/double(np) ;
00666 for (int i=0 ; i<np ; i++) {
00667 phi[i] = xx*i ;
00668 }
00669 }
00670
00671
00672
00673 Grille3d_fj::~Grille3d_fj() { }
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683 Grille3d_fjeq::Grille3d_fjeq(int nrs, int nts, int nps)
00684 : Grille3d(nrs, nts, nps)
00685 {
00686
00687 double xx ;
00688
00689
00690 type_r = FINJAC ;
00691 type_t = SYM ;
00692 type_p = NONSYM ;
00693
00694
00695 if (nr > 1) {
00696 double* yy = pointsgausslobatto(nr-1);
00697 for (int i=0 ; i<nr ; i++) {
00698 x[i] = yy[i] ;
00699 }
00700 delete [] yy ;
00701 }
00702 else
00703 x[0]=0;
00704
00705 if (nt > 1)
00706 xx = M_PI/double(2*(nt-1)) ;
00707 else
00708 xx = 0. ;
00709 for (int i=0 ; i<nt ; i++) {
00710 tet[i] = xx*i ;
00711 }
00712
00713 xx = 2.*M_PI/double(np) ;
00714 for (int i=0 ; i<np ; i++) {
00715 phi[i] = xx*i ;
00716 }
00717 }
00718
00719
00720
00721 Grille3d_fjeq::~Grille3d_fjeq() { }
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731 Grille3d_fj2p::Grille3d_fj2p(int nrs, int nts, int nps)
00732 : Grille3d(nrs, nts, nps)
00733 {
00734
00735 double xx ;
00736
00737 type_r = FINJAC ;
00738 type_t = NONSYM ;
00739 type_p = SYM ;
00740
00741
00742 if (nr > 1) {
00743 double* yy = pointsgausslobatto(nr-1);
00744 for (int i=0 ; i<nr ; i++) {
00745 x[i] = yy[i] ;
00746 }
00747 delete [] yy ;
00748 }
00749 else
00750 x[0]=0;
00751
00752 if (nt > 1)
00753 xx = M_PI/double(nt-1) ;
00754 else
00755 xx = 0. ;
00756 for (int i=0 ; i<nt ; i++) {
00757 tet[i] = xx*i ;
00758 }
00759
00760 xx = M_PI/double(np) ;
00761 for (int i=0 ; i<np ; i++) {
00762 phi[i] = xx*i ;
00763 }
00764 }
00765
00766
00767
00768 Grille3d_fj2p::~Grille3d_fj2p() { }
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778 Grille3d_fjs::Grille3d_fjs(int nrs, int nts, int nps)
00779 : Grille3d(nrs, nts, nps)
00780 {
00781
00782 double xx ;
00783
00784 type_r = FINJAC ;
00785 type_t = SYM ;
00786 type_p = SYM ;
00787
00788
00789
00790
00791 if (nr > 1) {
00792 double* yy = pointsgausslobatto(nr-1);
00793 for (int i=0 ; i<nr ; i++) {
00794 x[i] = yy[i] ;
00795 }
00796 delete [] yy ;
00797 }
00798 else
00799 x[0]=0;
00800
00801 if (nt > 1)
00802 xx = M_PI/double(2*(nt-1)) ;
00803 else
00804 xx = 0. ;
00805 for (int i=0 ; i<nt ; i++) {
00806 tet[i] = xx*i ;
00807 }
00808
00809 xx = M_PI/double(np) ;
00810 for (int i=0 ; i<np ; i++) {
00811 phi[i] = xx*i ;
00812 }
00813 }
00814
00815
00816
00817 Grille3d_fjs::~Grille3d_fjs() { }
00818
00819