master
rifki sadikin 6 years ago
parent 427669a9db
commit 303779e59c
  1. 81
      PETUNJUKPENGGUNAAN.md
  2. 4
      README.md
  3. 152
      example/PoissonSolver3DGPUTest.cpp
  4. 2
      example/PoissonSolver3DGPUTest.h
  5. 4
      interface/PoissonSolver3DCylindricalGPU.cxx
  6. 5
      interface/PoissonSolver3DCylindricalGPU.h

@ -192,7 +192,24 @@ add_executable(${TARGET_NAME}
target_link_libraries(${TARGET_NAME} ${PSLIB} ${LIBCUDA_SO_PATH}) target_link_libraries(${TARGET_NAME} ${PSLIB} ${LIBCUDA_SO_PATH})
``` ```
2. Buat folder terpisah untuk mebangun proyek yang menggunakan pustaka misal **buildexamplepoissonsolver** lalu jalankan **cmake** dengan flag spesial yaitu **-DCMAKE_PREFIX_PATH** yang ditetapkan dengan absolute path tempat direktori PoissonSolver3DCylindricalGPU dibangun. 2. Pada kode sumber include header file sehingga definisi fungsi dan kelas dapat dipanggil di badan kode.
```c++
#include "PoissonSolver3DCylindricalGPU.h"
...
// create poissonSolver
PoissonSolver3DCylindricalGPU *poissonSolver = new PoissonSolver3DCylindricalGPU();
PoissonSolver3DCylindricalGPU::fgConvergenceError = 1e-8;
poissonSolver->SetExactSolution(VPotentialExact,kRows,kColumns, kPhiSlices);
poissonSolver->SetStrategy(PoissonSolver3DCylindricalGPU::kMultiGrid);
poissonSolver->SetCycleType(PoissonSolver3DCylindricalGPU::kFCycle);
poissonSolver->PoissonSolver3D(VPotential,RhoCharge,kRows,kColumns,kPhiSlices, kIterations,kSymmetry) ;
```
3. Buat folder terpisah untuk mebangun proyek yang menggunakan pustaka misal **buildexamplepoissonsolver** lalu jalankan **cmake** dengan flag spesial yaitu **-DCMAKE_PREFIX_PATH** yang ditetapkan dengan absolute path tempat direktori PoissonSolver3DCylindricalGPU dibangun.
```console ```console
$ mkdir buildexamplepoissonsolver $ mkdir buildexamplepoissonsolver
@ -205,7 +222,7 @@ $ cmake ../PoissonSolver3D/example/ -DCMAKE_PREFIX_PATH=/home/usertest/trypoisso
-- Generating done -- Generating done
-- Build files have been written to: /home/usertest/trypoissonsolver/buildexamplepoissonsolver -- Build files have been written to: /home/usertest/trypoissonsolver/buildexamplepoissonsolver
``` ```
3. Jalankan **make** untuk membuat *executable file* 4. Jalankan **make** untuk membuat *executable file*
```console ```console
$ make $ make
@ -217,3 +234,63 @@ $ make
[ 50%] Linking CXX executable poissonsolvergputest [ 50%] Linking CXX executable poissonsolvergputest
[100%] Built target poissonsolvergputest [100%] Built target poissonsolvergputest
``` ```
5. Hasil dari **make** adalah program yang dapat dieksekusi yang berjalan di GPU card
6.
```console
$ ./poissonsolvergputest
Poisson Solver 3D Cylindrical GPU test
Ukuran grid (r,phi,z) = (17,17,18)
Waktu komputasi: 0.55 s
Jumlah iterasi siklus multigrid: 5
Iterasi Error Convergen Error Absolut
[0]: 8.362587e-01 2.430797e-03
[1]: 5.126660e-02 4.434380e-04
[2]: 9.490424e-03 1.892288e-04
[3]: 2.084086e-03 1.314385e-04
[4]: 1.141812e-03 1.217592e-04
Poisson Solver 3D Cylindrical GPU test
Ukuran grid (r,phi,z) = (33,33,36)
Waktu komputasi: 1.000000e-02 s
Jumlah iterasi siklus multigrid: 10
Iterasi Error Convergen Error Absolut
[0]: 1.724319e-03 1.315177e-04
[1]: 8.652242e-05 1.266415e-04
[2]: 5.450314e-05 1.256187e-04
[3]: 5.081671e-05 1.249848e-04
[4]: 4.951065e-05 1.244460e-04
[5]: 4.904093e-05 1.241379e-04
[6]: 4.890266e-05 1.239894e-04
[7]: 4.885175e-05 1.239208e-04
[8]: 4.883604e-05 1.238959e-04
[9]: 4.883501e-05 1.238844e-04
Poisson Solver 3D Cylindrical GPU test
Ukuran grid (r,phi,z) = (65,65,72)
Waktu komputasi: 5.000000e-02 s
Jumlah iterasi siklus multigrid: 3
Iterasi Error Convergen Error Absolut
[0]: 1.084726e-04 1.291784e-04
[1]: 5.680057e-06 1.283386e-04
[2]: 1.501479e-06 1.278558e-04
Poisson Solver 3D Cylindrical GPU test
Ukuran grid (r,phi,z) = (129,129,144)
Waktu komputasi: 1.200000e-01 s
Jumlah iterasi siklus multigrid: 3
Iterasi Error Convergen Error Absolut
[0]: 1.373293e-05 1.302576e-04
[1]: 2.154564e-06 1.299626e-04
[2]: 1.048384e-06 1.297261e-04
Poisson Solver 3D Cylindrical GPU test
Ukuran grid (r,phi,z) = (257,257,288)
Waktu komputasi: 6.900000e-01 s
Jumlah iterasi siklus multigrid: 5
Iterasi Error Convergen Error Absolut
[0]: 5.469890e-06 1.388922e-04
[1]: 1.783695e-06 1.384964e-04
[2]: 1.345343e-06 1.381199e-04
[3]: 1.156555e-06 1.377524e-04
[4]: 1.050234e-06 1.373983e-04
```

@ -1,4 +1,4 @@
# PoissonSolver3D # PoissonSolver3DCylindricalGPU
PoissonSolver3D adalah pustaka yang dikembangkan untuk menyelesaikan persamaan Poisson 3 dimensi dalam sistem koordinat silinder. Persamaan Poisson secara umum berbentuk $$\nabla^{2}(r,\phi,z) = \rho(r,\phi,z)$$ dengan diketahui nilai tepi pada potensial $$\mathbf{V}$$ dan distribusi buatan $$\rho$$. Untuk menyelesaikan persamaan tersebut digunakan metode multigrid yang diimplementasikan pada akselerator GPU. PoissonSolver3D adalah pustaka yang dikembangkan untuk menyelesaikan persamaan Poisson 3 dimensi dalam sistem koordinat silinder. Persamaan Poisson secara umum berbentuk $$\nabla^{2}(r,\phi,z) = \rho(r,\phi,z)$$ dengan diketahui nilai tepi pada potensial $$\mathbf{V}$$ dan distribusi buatan $$\rho$$. Untuk menyelesaikan persamaan tersebut digunakan metode multigrid yang diimplementasikan pada akselerator GPU.
@ -9,7 +9,7 @@ Pustaka ini dikembangkan oleh Kelompok Penelitian Komputasi Kinerja Tinggi, Pusa
- Rifki Sadikin (rifki.sadikin@lipi.go.id), koordinator - Rifki Sadikin (rifki.sadikin@lipi.go.id), koordinator
- I Wayan Aditya Swardiana (i.wayan.aditya.swardiana@lipi.go.id), anggota - I Wayan Aditya Swardiana (i.wayan.aditya.swardiana@lipi.go.id), anggota
- Taufiq Wirahman (taufiq.wirahman@lipi.go.id), anggota - Taufiq Wirahman (taufiq.wirahman@lipi.go.id), anggota
- Arnida L. Latifah (arnida.lailatul.lattifah@lipigo.id), anggota
## Kontak ## Kontak
Untuk pertanyaan, komentar atau diskusi dapat menghubungi tim pengembang di atas atau mengunjungi situs kami di: Untuk pertanyaan, komentar atau diskusi dapat menghubungi tim pengembang di atas atau mengunjungi situs kami di:

@ -1,10 +1,17 @@
#include <iostream> #include <iostream>
#include <math.h> #include <math.h>
#include <iostream>
#include <cstdio>
#include <ctime>
#include "PoissonSolver3DGPUTest.h" #include "PoissonSolver3DGPUTest.h"
#include "PoissonSolver3DGPU.h"
/// ///
/// DoPoissonSolverExperiments /// DoPoissonSolverExperiments
/// ///
/// dibuat oleh: Rifki Sadikin (rifki.sadikin@lipi.go.id)
/// tanggal: 7 November 2018
void DoPoissonSolverExperiment(const int kRows, const int kColumns, const int kPhiSlices, const int kIterations, const int kSymmetry) { void DoPoissonSolverExperiment(const int kRows, const int kColumns, const int kPhiSlices, const int kIterations, const int kSymmetry) {
@ -26,6 +33,7 @@ void DoPoissonSolverExperiment(const int kRows, const int kColumns, const int kP
InitVoltandCharge3D(VPotentialExact,VPotential,RhoCharge,kRows,kColumns,kPhiSlices,gridSizeR,gridSizeZ,gridSizePhi); InitVoltandCharge3D(VPotentialExact,VPotential,RhoCharge,kRows,kColumns,kPhiSlices,gridSizeR,gridSizeZ,gridSizePhi);
/**
const float ratioPhi = gridSizeR*gridSizeR / (gridSizePhi*gridSizePhi) ; // ratio_{phi} = gridsize_{r} / gridsize_{phi} const float ratioPhi = gridSizeR*gridSizeR / (gridSizePhi*gridSizePhi) ; // ratio_{phi} = gridsize_{r} / gridsize_{phi}
const float ratioZ = gridSizeR*gridSizeR / (gridSizeZ*gridSizeZ) ; // ratio_{Z} = gridsize_{r} / gridsize_{z} const float ratioZ = gridSizeR*gridSizeR / (gridSizeZ*gridSizeZ) ; // ratio_{Z} = gridsize_{r} / gridsize_{z}
const float convErr = fgConvergenceError; const float convErr = fgConvergenceError;
@ -59,95 +67,65 @@ void DoPoissonSolverExperiment(const int kRows, const int kColumns, const int kP
// VCycle // VCycle
PoissonMultigrid3DSemiCoarseningGPUError(VPotential, RhoCharge, kRows, kColumns ,kPhiSlices, 0 , fparam, iparam, true, errorConv,errorExact, VPotentialExact); PoissonMultigrid3DSemiCoarseningGPUError(VPotential, RhoCharge, kRows, kColumns ,kPhiSlices, 0 , fparam, iparam, true, errorConv,errorExact, VPotentialExact);
// Call poisson solver // Call poisson solver
**/
/**
for (int k=0;k<kPhiSlices;k++) { for (int k=0;k<1;k++) {
for (int i=0;i<kRows;i++) { for (int i=0;i<kRows;i++) {
for (int j=0;j< kColumns;j++) printf("%.3f\t",VPotential[k * (kRows * kColumns) + i * kColumns + j] - VPotentialExact[k* (kRows * kColumns) + i * kColumns + j]); for (int j=0;j< kColumns;j++) printf("%.3f\t",VPotentialExact[k* (kRows * kColumns) + i * kColumns + j]);
printf("\n"); printf("\n");
} }
printf("\n"); printf("\n");
} }
**/
/**
TVectorD *error[5];
TVectorD *errorConv[5];
int iterations[5];
// memory allocation
TMatrixD *arrayofArrayV[kPhiSlices], *arrayofCharge[kPhiSlices] ;
TMatrixD *arrayofArrayVGrid[kPhiSlices], *arrayofChargeGrid[kPhiSlices] ;
TMatrixD *arrayofArrayVExact[kPhiSlices];
for ( int k = 0 ; k < kPhiSlices ; k++ ) {
arrayofArrayV[k] = new TMatrixD(kRows,kColumns) ;
arrayofArrayVExact[k] = new TMatrixD(kRows,kColumns) ;
arrayofCharge[k] = new TMatrixD(kRows,kColumns) ;
arrayofArrayVGrid[k] = new TMatrixD(kRows,kColumns) ;
arrayofChargeGrid[k] = new TMatrixD(kRows,kColumns) ;
}
// side in TPC chamber
int side = 0;
/// Generate exact problems -- solutios pair
InitVoltandCharge3D(arrayofArrayVExact,arrayofChargeGrid,kRows,kColumns,kPhiSlices,side,gridSizeR,gridSizeZ,gridSizePhi,1);
/// zeroing potential for inital guess
for ( int k = 0 ; k < kPhiSlices ; k++ ) {
*arrayofArrayVGrid[k] = *arrayofArrayVExact[k];
*arrayofArrayV[k] = *arrayofArrayVExact[k];
for ( int i = 1 ; i < kRows-1 ; i++ ) {
for ( int j = 1 ; j < kColumns-1 ; j++ ) {
(*arrayofArrayVGrid[k])(i,j) = 0.0;
(*arrayofArrayV[k])(i,j) = 0.0;
}
}
}
// create poissonSolver // create poissonSolver
AliTPCPoissonSolverCuda *poissonSolver = new AliTPCPoissonSolverCuda(); PoissonSolver3DCylindricalGPU *poissonSolver = new PoissonSolver3DCylindricalGPU();
AliTPCPoissonSolverCuda::fgConvergenceError = 1e-8; PoissonSolver3DCylindricalGPU::fgConvergenceError = 1e-6;
// zeroring array of error // zeroring array of error
poissonSolver->SetExactSolution(arrayofArrayVExact,kRows,kColumns, kPhiSlices); poissonSolver->SetExactSolution(VPotentialExact,kRows,kColumns, kPhiSlices);
// Case 1. Set the strategy as multigrid, fullmultigrid, and full 3d // Case 1. Set the strategy as multigrid, fullmultigrid, and full 3d
poissonSolver->SetStrategy(kMultiGrid); poissonSolver->SetStrategy(PoissonSolver3DCylindricalGPU::kMultiGrid);
poissonSolver->SetCycleType(kFCycle); poissonSolver->SetCycleType(PoissonSolver3DCylindricalGPU::kFCycle);
TStopwatch w; // TStopwatch w;
w.Start(); std::clock_t start,stop;
poissonSolver->PoissonSolver3D(arrayofArrayVGrid,arrayofChargeGrid,kRows,kColumns,kPhiSlices, kIterations,kSymmetry) ; double duration;
w.Stop();
TMatrixD vError(kRows,kColumns);
arrayofArrayVGrid[0]->Print();
::Info("testAliTPCPoissonSolverMem3D_Consistency",Form("Time Poisson Multigrid F-Cycle 3D: = %f \n",w.CpuTime()));
start = std::clock();
//w.Start();
poissonSolver->PoissonSolver3D(VPotential,RhoCharge,kRows,kColumns,kPhiSlices, kIterations,kSymmetry) ;
//w.Stop();
stop = std::clock();
/**
for (int k=0;k<1;k++) {
for (int i=0;i<kRows;i++) {
for (int j=0;j< kColumns;j++) printf("%.3f\t",VPotential[k* (kRows * kColumns) + i * kColumns + j]);
printf("\n");
}
printf("\n");
}**/
duration = ( stop - start ) / (double) CLOCKS_PER_SEC;
std::cout<<"Poisson Solver 3D Cylindrical GPU test" << '\n';
std::cout<<"Ukuran grid (r,phi,z) = (" << kRows << "," << kColumns << "," << kPhiSlices <<") \n";
std::cout<<"Waktu komputasi: \t\t\t"<< duration <<" s \n";
std::cout<<"Jumlah iterasi siklus multigrid: \t"<< poissonSolver->fIterations << '\n';
std::cout<<"Iterasi\tError Convergen\t\tError Absolut \n";
std::cout<< std::scientific;
for (int i=0;i<poissonSolver->fIterations;i++) {
std::cout<<"[" << i << "]:\t" << poissonSolver->GetErrorConv(i) << "\t" << poissonSolver->GetErrorExact(i) << '\n' << std::scientific;
}
delete poissonSolver; delete poissonSolver;
for ( int k = 0 ; k < kPhiSlices ; k++ ) {
delete arrayofArrayV[k];
delete arrayofArrayVExact[k];
delete arrayofCharge[k];
delete arrayofArrayVGrid[k];
delete arrayofChargeGrid[k];
}
**/
delete VPotential; delete VPotential;
delete VPotentialExact; delete VPotentialExact;
delete RhoCharge; delete RhoCharge;
delete[] iparam;
delete[] fparam;
} }
@ -155,17 +133,15 @@ void DoPoissonSolverExperiment(const int kRows, const int kColumns, const int kP
// set init // set init
void InitVoltandCharge3D(float * VPotentialExact,float *VPotential,float * RhoCharge,const int kRows, const int kColumns,const int kPhiSlices,float gridSizeR,float gridSizeZ,float gridSizePhi) { void InitVoltandCharge3D(float * VPotentialExact,float *VPotential,float * RhoCharge,const int kRows, const int kColumns,const int kPhiSlices,float gridSizeR,float gridSizeZ,float gridSizePhi) {
//TFormula vTestFunction1("f1", "[0]*(x^4 - 338.0 *x^3 + 21250.75 * x^2)*cos([1]* y)^2*exp(-1* [2] * z^2)");
//TFormula rhoTestFunction1("ff1", "[0]*(((16.0 * x^2 - 9.0 * 338.0 * x + 4.0*21250.75) *cos([1] * y)^2 * exp(-1 *[2]*z^2)) - ((x^2 - 338.0 * x + 21250.75) * 2 * [1]^2 * cos(2 * [1] * y) * exp(-1 *[2]*z^2)) + ((x^4 - 338.0 * x^3 + 21250.75 * x^2) * cos([1] * y)^2 * (4*[2]^2*z^2 - 2 * [2]) * exp(-1 *[2]*z^2)))");
double rlist[kRows], zedlist[kColumns] , philist[kPhiSlices]; double rlist[kRows], zedlist[kColumns] , philist[kPhiSlices];
float phi0,radius0,z0; float phi0,radius0,z0;
double a,b,c; double a,b,c;
a = fgkOFCRadius*fgkOFCRadius; a = 1e-7;
a*= (fgkOFCRadius - fgkIFCRadius); b = 0.5;
a*= (fgkOFCRadius - fgkIFCRadius); c = 1e-4;
a = (100.0/a);
b = 0.5;
c = M_E / (fgkTPCZ0 * fgkTPCZ0 );
int index; int index;
// list points on grid in cm // list points on grid in cm
for ( int k = 0 ; k < kPhiSlices ; k++ ) for ( int k = 0 ; k < kPhiSlices ; k++ )
@ -186,7 +162,7 @@ void InitVoltandCharge3D(float * VPotentialExact,float *VPotential,float * RhoCh
z0 = zedlist[j]; z0 = zedlist[j];
VPotentialExact[index] = TestFunction1PotentialEval(a,b,c,radius0,phi0,z0); VPotentialExact[index] = TestFunction1PotentialEval(a,b,c,radius0,phi0,z0);
RhoCharge[index] = TestFunction1ChargeEval(a,b,c,radius0,phi0,z0); RhoCharge[index] = -1 * TestFunction1ChargeEval(a,b,c,radius0,phi0,z0);
if (j == 0) VPotential[index] = VPotentialExact[index]; if (j == 0) VPotential[index] = VPotentialExact[index];
else if (j == kColumns-1) VPotential[index] = VPotentialExact[index]; else if (j == kColumns-1) VPotential[index] = VPotentialExact[index];
@ -203,9 +179,8 @@ void InitVoltandCharge3D(float * VPotentialExact,float *VPotential,float * RhoCh
// //
float TestFunction1PotentialEval(double a, double b, double c, float radius0,float phi0,float z0) { float TestFunction1PotentialEval(double a, double b, double c, float radius0,float phi0,float z0) {
float ret = a * (pow(radius0,4) - 338.0 * pow(radius0,3) + 21250.75 * pow(radius0,2)); //TFormula vTestFunction1("f1", "[0]*(x^4 - 338.0 *x^3 + 21250.75 * x^2)*cos([1]* y)^2*exp(-1* [2] * z^2)");
ret *= cos(b*phi0); float ret = a * (pow(radius0,4) - 338.0 * pow(radius0,3) + 21250.75 * pow(radius0,2)) * pow(cos(b*phi0),2) * exp ( -1 * c * z0*z0);
ret *= exp ( -1 * c * z0*z0);
return ret; return ret;
@ -213,17 +188,26 @@ float TestFunction1PotentialEval(double a, double b, double c, float radius0,fl
// //
float TestFunction1ChargeEval(double a, double b, double c, float radius0,float phi0,float z0) { float TestFunction1ChargeEval(double a, double b, double c, float radius0,float phi0,float z0) {
//TFormula rhoTestFunction1("ff1", "[0]*(((16.0 * x^2 - 9.0 * 338.0 * x + 4.0*21250.75) *cos([1] * y)^2 * exp(-1 *[2]*z^2)) - ((x^2 - 338.0 * x + 21250.75) * 2 * [1]^2 * cos(2 * [1] * y) * exp(-1 *[2]*z^2)) + ((x^4 - 338.0 * x^3 + 21250.75 * x^2) * cos([1] * y)^2 * (4*[2]^2*z^2 - 2 * [2]) * exp(-1 *[2]*z^2)))");
float ret = a * (((16.0 * pow(radius0,2) - 9.0 * 338.0 * radius0 + 4.0*21250.75 ) * pow(cos (b * phi0),2.0) *exp(-1 * c * z0 * z0) ) - ((pow(radius0,2.0) - 338.0 * radius0 + 21250.75) *2 * b*b* cos(2 * b * phi0) * exp(-1 * c *z0 * z0) ) + ((pow(radius0,4.0) - 338.0 * pow(radius0,3.0) + 21250.75 * pow(radius0,2.0)) * pow(cos(b * phi0),2.0) * (4 *c*c *z0*z0 - 2 *c) * exp(-1 * c * z0 * z0))) ; float ret = a * (((16.0 * pow(radius0,2) - 9.0 * 338.0 * radius0 + 4.0*21250.75 ) * pow(cos (b * phi0),2) *exp(-1 * c * z0 * z0) ) - ((pow(radius0,2) - 338.0 * radius0 + 21250.75) *2 * b*b* cos(2 * b * phi0) * exp(-1 * c *z0 * z0) ) + ((pow(radius0,4) - 338.0 * pow(radius0,3) + 21250.75 * pow(radius0,2)) * pow(cos(b * phi0),2) * (4.0 *c*c *z0*z0 - 2 *c) * exp(-1 * c * z0 * z0))) ;
return ret; return ret;
} }
// testing
int main() { int main() {
DoPoissonSolverExperiment(17, 17, 18, 200, 0); DoPoissonSolverExperiment(17, 17, 18, 200, 0);
std::cout << "\n";
DoPoissonSolverExperiment(33, 33, 36, 200, 0);
std::cout << "\n";
DoPoissonSolverExperiment(65, 65, 72, 200, 0);
std::cout << "\n";
DoPoissonSolverExperiment(129, 129, 144, 200, 0);
std::cout << "\n";
DoPoissonSolverExperiment(257, 257, 288, 200, 0);
std::cout << "\n";
return 0; return 0;
} }

@ -2,7 +2,7 @@
#define POISSONSOLVERGPU3DGPUTEST_H #define POISSONSOLVERGPU3DGPUTEST_H
#include <iostream> #include <iostream>
#include "PoissonSolver3DGPU.h" #include "PoissonSolver3DCylindricalGPU.h"
const double fgkTPCZ0 = 249.7; ///< nominal gating grid position const double fgkTPCZ0 = 249.7; ///< nominal gating grid position
const double fgkIFCRadius = 83.5; ///< radius which renders the "18 rod manifold" best -> compare calc. of Jim Thomas const double fgkIFCRadius = 83.5; ///< radius which renders the "18 rod manifold" best -> compare calc. of Jim Thomas

@ -90,7 +90,7 @@ void PoissonSolver3DCylindricalGPU::PoissonMultiGrid3D2D(float *VPotential, floa
if (fMgParameters.cycleType == kFCycle) if (fMgParameters.cycleType == kFCycle)
{ {
if (fExactPresent == true) { if (fExactPresent == true) {
PoissonMultigrid3DSemiCoarseningGPUErrorFCycle(VPotential, RhoChargeDensities,nRRow, nZColumn,phiSlice,symmetry, fparam, iparam, fExactPresent, fErrorConvF, fErrorExactF, fExactSolutionF); PoissonMultigrid3DSemiCoarseningGPUErrorFCycle(VPotential, RhoChargeDensities,nRRow, nZColumn,phiSlice,symmetry, fparam, iparam, fExactPresent, fErrorConvF, fErrorExactF, fExactSolutionF);
} else { } else {
PoissonMultigrid3DSemiCoarseningGPUErrorFCycle(VPotential, RhoChargeDensities,nRRow, nZColumn,phiSlice,symmetry, fparam, iparam, fExactPresent, fErrorConvF, fErrorExactF, NULL); PoissonMultigrid3DSemiCoarseningGPUErrorFCycle(VPotential, RhoChargeDensities,nRRow, nZColumn,phiSlice,symmetry, fparam, iparam, fExactPresent, fErrorConvF, fErrorExactF, NULL);
@ -118,7 +118,7 @@ void PoissonSolver3DCylindricalGPU::SetExactSolution(float*exactSolution,int nRR
fNRRow = nRRow; fNRRow = nRRow;
fNZColumn = nZColumn; fNZColumn = nZColumn;
fPhiSlice = phiSlice; fPhiSlice = phiSlice;
fExactSolutionF = new float[fNRRow * fPhiSlice,fNZColumn]; fExactSolutionF = new float[fNRRow * fPhiSlice * fNZColumn];
fExactPresent = true; fExactPresent = true;
fMaxExact = 0.0;; fMaxExact = 0.0;;
for (int i=0;i<nRRow*nZColumn*phiSlice;i++) { for (int i=0;i<nRRow*nZColumn*phiSlice;i++) {

@ -104,7 +104,10 @@ public:
void SetStrategy(StrategyType strategy) {fStrategy = strategy;} void SetStrategy(StrategyType strategy) {fStrategy = strategy;}
StrategyType GetStrategy() { return fStrategy; } StrategyType GetStrategy() { return fStrategy; }
void SetExactSolution(float *exactSolution,int nRRow, int nZColumn, int phiSlice); void SetExactSolution(float *exactSolution,int nRRow, int nZColumn, int phiSlice);
float *fExactSolutionF; float *fExactSolutionF;
float GetErrorConv(int iteration) {return fErrorConvF[iteration]; }
float GetErrorExact(int iteration) {return fErrorExactF[iteration]; }
private: private:
PoissonSolver3DCylindricalGPU(const PoissonSolver3DCylindricalGPU &); // not implemented PoissonSolver3DCylindricalGPU(const PoissonSolver3DCylindricalGPU &); // not implemented
PoissonSolver3DCylindricalGPU &operator=(const PoissonSolver3DCylindricalGPU &); // not implemented PoissonSolver3DCylindricalGPU &operator=(const PoissonSolver3DCylindricalGPU &); // not implemented

Loading…
Cancel
Save