Changeset 4571da
- Timestamp:
- Apr 27, 2012, 11:34:57 PM (14 years ago)
- Children:
- 1a92cf
- Parents:
- b2154a3
- Files:
-
- 4 added
- 1 deleted
- 32 edited
-
src/Makefile.am (modified) (3 diffs)
-
src/base/discretization.hpp (modified) (3 diffs)
-
src/base/stencil.cpp (added)
-
src/base/stencil.hpp (modified) (1 diff)
-
src/commands/com_import_rhs.cpp (modified) (2 diffs)
-
src/grid/grid.cpp (modified) (5 diffs)
-
src/grid/grid.hpp (modified) (3 diffs)
-
src/grid/grid_iterator_suite.cpp (modified) (6 diffs)
-
src/interface/interface_fcs.cpp (modified) (9 diffs)
-
src/interface/interface_fcs.h (modified) (1 diff)
-
src/interface/interface_particles.cpp (modified) (9 diffs)
-
src/interface/interface_particles.hpp (modified) (1 diff)
-
src/interface/interface_particles_cf.cpp (modified) (4 diffs)
-
src/mg.cpp (modified) (1 diff)
-
src/mg.hpp (modified) (1 diff)
-
src/samples/bspline.hpp (modified) (3 diffs)
-
src/samples/discretization_poisson_fd.cpp (added)
-
src/samples/discretization_poisson_fd.hpp (modified) (2 diffs)
-
src/samples/discretization_poisson_fd_collatz.hpp (deleted)
-
src/samples/discretization_poisson_fv.hpp (modified) (1 diff)
-
src/samples/techniques.hpp (modified) (4 diffs)
-
src/smoother/gs.cpp (modified) (1 diff)
-
src/smoother/gsrb.cpp (modified) (1 diff)
-
src/smoother/jacobi.cpp (added)
-
src/smoother/jacobi.hpp (added)
-
src/solver/solver_singular.cpp (modified) (1 diff)
-
test/unit_test/library/dirichlet_cs.cpp (modified) (1 diff)
-
test/unit_test/library/dirichlet_cs_mpi.cpp (modified) (1 diff)
-
test/unit_test/library/dirichlet_fas.cpp (modified) (1 diff)
-
test/unit_test/library/dirichlet_fas_lr.cpp (modified) (1 diff)
-
test/unit_test/library/dirichlet_fas_lr_mpi.cpp (modified) (1 diff)
-
test/unit_test/library/dirichlet_fas_mpi.cpp (modified) (1 diff)
-
test/unit_test/library/periodic_cs.cpp (modified) (1 diff)
-
test/unit_test/library/periodic_cs_mpi.cpp (modified) (1 diff)
-
test/unit_test/library/periodic_fas.cpp (modified) (1 diff)
-
test/unit_test/library/periodic_fas_mpi.cpp (modified) (1 diff)
-
test/unit_test/unit_test/smoother_test.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Makefile.am
rb2154a3 r4571da 29 29 base/proxy.cpp \ 30 30 base/proxy.hpp \ 31 base/stencil.cpp \ 31 32 base/stencil.hpp \ 32 33 base/timer.cpp \ … … 120 121 samples/bspline.cpp \ 121 122 samples/bspline.hpp \ 122 samples/discretization_poisson_fd _collatz.hpp \123 samples/discretization_poisson_fd.cpp \ 123 124 samples/discretization_poisson_fd.hpp \ 124 125 samples/discretization_poisson_fv.cpp \ … … 130 131 smoother/gsrb.cpp \ 131 132 smoother/gsrb.hpp \ 133 smoother/jacobi.cpp \ 134 smoother/jacobi.hpp \ 132 135 smoother/smoother.cpp \ 133 136 smoother/smoother.hpp \ -
src/base/discretization.hpp
rb2154a3 r4571da 28 28 { 29 29 public: 30 Discretization() : stencil(1.0) {} 31 Discretization(const Stencil& stencil_) : stencil(stencil_) {} 30 Discretization() : 31 stencil(1.0), 32 order(2) 33 {} 34 35 Discretization(const int& order) : 36 stencil(1.0), 37 order(order) 38 {} 39 40 Discretization(const Stencil& stencil_, const int& order) : 41 stencil(stencil_), 42 order(order) 43 {} 32 44 33 45 Discretization(std::string id) : 34 46 Object(id), 35 stencil(1.0) 47 stencil(1.0), 48 order(2) 36 49 {} 37 50 38 Discretization(std::string id, const Stencil& stencil_) :51 Discretization(std::string id, const int& order) : 39 52 Object(id), 40 stencil(stencil_) 53 stencil(1.0), 54 order(order) 55 {} 56 57 Discretization(std::string id, const Stencil& stencil_, const int& order) : 58 Object(id), 59 stencil(stencil_), 60 order(order) 41 61 {} 42 62 … … 45 65 virtual vmg_float OperatorPrefactor(const Grid& grid) const = 0; ///< Returns the prefactor of the operator. 46 66 47 /** 67 virtual void ModifyRightHandSide() {} 68 69 /** 48 70 * This function gets called whenever boundary points at inner boundaries are needed. 49 71 * Inner boundaries occur when using adaptive grid refinement. 50 * 72 * 51 73 * @param sol_fine Solution vector / fine level 52 74 * @param rhs_fine Right handside vector / fine level … … 60 82 61 83 private: 62 virtual void SetInnerBoundaryCompute(Grid& sol_fine, Grid& rhs_fine, Grid& sol_coarse) const = 0;84 virtual void SetInnerBoundaryCompute(Grid& sol_fine, Grid& rhs_fine, Grid& sol_coarse) const {} 63 85 64 86 protected: 65 87 VMG::Stencil stencil; 88 int order; 66 89 }; 67 90 -
src/base/stencil.hpp
rb2154a3 r4571da 103 103 } 104 104 105 void Apply(Grid& grid) const; 106 105 107 private: 106 108 std::vector<Displacement> disp; -
src/commands/com_import_rhs.cpp
rb2154a3 r4571da 14 14 15 15 #include "base/command.hpp" 16 #include "base/discretization.hpp" 16 17 #include "comm/comm.hpp" 17 18 #include "grid/multigrid.hpp" … … 29 30 30 31 MG::GetInterface()->ImportRightHandSide(*MG::GetRhs()); 32 MG::GetDiscretization()->ModifyRightHandSide(); 31 33 32 34 MPE_EVENT_END() -
src/grid/grid.cpp
rb2154a3 r4571da 25 25 using namespace VMG; 26 26 27 vmg_float Grid::correction;28 29 27 void Grid::InitGrid() 30 28 { … … 112 110 avg += GetVal(*iter); 113 111 114 avg /= Local().Size().Product(); 112 avg = MG::GetComm()->GlobalSum(avg); 113 avg /= Global().GlobalSize().Product(); 114 115 #ifdef DEBUG_OUTPUT 116 MG::GetComm()->PrintStringOnce("Global constraint enforcement: %e", avg); 117 #endif 115 118 116 119 for (iter = Iterators().Local().Begin(); iter != Iterators().Local().End(); ++iter) … … 126 129 val += GetVal(*iter); 127 130 128 val = MG::GetComm()->GlobalSum(val) ;129 130 if ( fabs(val) > Global().GlobalSize().Product() *std::numeric_limits<vmg_float>::epsilon()) {131 val = MG::GetComm()->GlobalSum(val) / Global().GlobalSize().Product(); 132 133 if (std::abs(val) > std::numeric_limits<vmg_float>::epsilon()) { 131 134 132 135 #ifdef DEBUG_OUTPUT … … 134 137 #endif 135 138 136 val *= Helper::pow_2(this->Extent().MeshWidth().Max());137 139 for (iter = Iterators().Local().Begin(); iter != Iterators().Local().End(); ++iter) 138 140 (*this)(*iter) -= val; … … 155 157 #endif 156 158 157 for (Grid::iterator iter = Iterators().CompleteGrid().Begin(); iter != Iterators().CompleteGrid().End(); ++iter) 158 (*this)(*iter) = rhs.GetVal(*iter); 159 std::memcpy(grid, rhs.grid, local.SizeTotal().Product()*sizeof(vmg_float)); 159 160 } 160 161 -
src/grid/grid.hpp
rb2154a3 r4571da 81 81 const GridIteratorSuite& Iterators() const {return iterators;} 82 82 83 static vmg_float& Correction() {return Grid::correction;}84 85 83 void Clear(); ///< Overwrites all grid points on current level with zeros 86 84 void ClearInner(); … … 93 91 const vmg_float& GetVal(int x, int y, int z) const; ///< Returns the value of a requested gridpoint. 94 92 const vmg_float& GetVal(const Index& index) const; 95 96 vmg_float GetCorrectedVal(int x, int y, int z) const {return this->GetVal(x, y, z) - correction;} ///< Return grid97 vmg_float GetCorrectedVal(const Index& index) const {return this->GetVal(index) - correction;}98 93 99 94 void ForceDiscreteCompatibilityCondition(); … … 142 137 143 138 Multigrid* father; 144 145 static vmg_float correction;146 139 }; 147 140 -
src/grid/grid_iterator_suite.cpp
rb2154a3 r4571da 21 21 local.SetBounds(local_.Begin(), local_.End()); 22 22 complete_grid.SetBounds(0, local_.SizeTotal()); 23 inner_local_grid.SetBounds(local_.Begin()+ 1, local_.End()-1);23 inner_local_grid.SetBounds(local_.Begin()+local_.HaloSize1(), local_.End()-local_.HaloSize2()); 24 24 25 25 halo_1.X().SetBounds(Index(local_.HaloBegin1().X(), 0, 0), … … 61 61 62 62 near_boundary_1.X().SetBounds(Index(local_.Begin().X(), 0, 0), 63 Index(local_.Begin().X()+local_.Halo End1().X()-local_.HaloBegin1().X(),63 Index(local_.Begin().X()+local_.HaloSize1().X(), 64 64 local_.SizeTotal().Y(), 65 65 local_.SizeTotal().Z())); … … 67 67 near_boundary_1.Y().SetBounds(Index(local_.Begin().X(), local_.Begin().Y(), 0), 68 68 Index(local_.End().X(), 69 local_.Begin().Y()+local_.Halo End1().Y()-local_.HaloBegin1().Y(),69 local_.Begin().Y()+local_.HaloSize1().Y(), 70 70 local_.SizeTotal().Z())); 71 71 … … 73 73 Index(local_.End().X(), 74 74 local_.End().Y(), 75 local_.Begin().Z()+local_.Halo End1().Z()-local_.HaloBegin1().Z()));75 local_.Begin().Z()+local_.HaloSize1().Z())); 76 76 77 near_boundary_2.X().SetBounds(Index(local_.End().X()-local_.Halo End2().X()+local_.HaloBegin2().X(),77 near_boundary_2.X().SetBounds(Index(local_.End().X()-local_.HaloSize2().X(), 78 78 0, 79 79 0), … … 81 81 82 82 near_boundary_2.Y().SetBounds(Index(local_.Begin().X(), 83 local_.End().Y()-local_.Halo End2().Y()+local_.HaloBegin2().Y(),83 local_.End().Y()-local_.HaloSize2().Y(), 84 84 0), 85 85 Index(local_.End().X(), local_.End().Y(), local_.SizeTotal().Z())); … … 87 87 near_boundary_2.Z().SetBounds(Index(local_.Begin().X(), 88 88 local_.Begin().Y(), 89 local_.End().Z()-local_.Halo End2().Z()+local_.HaloBegin2().Z()),89 local_.End().Z()-local_.HaloSize2().Z()), 90 90 local_.End()); 91 91 } -
src/interface/interface_fcs.cpp
rb2154a3 r4571da 35 35 #include "samples/stencils.hpp" 36 36 #include "samples/techniques.hpp" 37 #include "smoother/gsrb. cpp"37 #include "smoother/gsrb.hpp" 38 38 #ifdef HAVE_LAPACK 39 39 #include "solver/dgesv.hpp" … … 59 59 static vmg_int near_field_cells = -1; 60 60 static vmg_int interpolation_degree = -1; 61 static vmg_int discretization_order = -1; 61 62 static MPI_Comm mpi_comm; 62 63 } … … 66 67 vmg_float* box_offset, vmg_float box_size, 67 68 vmg_int near_field_cells, vmg_int interpolation_degree, 68 MPI_Comm mpi_comm)69 vmg_int discretization_order, MPI_Comm mpi_comm) 69 70 { 70 71 VMGBackupSettings::level = level; … … 78 79 VMGBackupSettings::near_field_cells = near_field_cells; 79 80 VMGBackupSettings::interpolation_degree = interpolation_degree; 81 VMGBackupSettings::discretization_order = discretization_order; 80 82 VMGBackupSettings::mpi_comm = mpi_comm; 81 83 … … 113 115 Discretization* discretization; 114 116 if (singular) 115 discretization = new DiscretizationPoissonFD( );116 else 117 discretization = new DiscretizationPoissonFV( );117 discretization = new DiscretizationPoissonFD(discretization_order); 118 else 119 discretization = new DiscretizationPoissonFV(discretization_order); 118 120 discretization->Register("DISCRETIZATION"); 119 121 … … 154 156 */ 155 157 if (singular) 156 Techniques::SetCorrectionSchemePeriodic Particle(interface->MinLevel(), interface->MaxLevel(), gamma);158 Techniques::SetCorrectionSchemePeriodic(interface->MinLevel(), interface->MaxLevel(), gamma); 157 159 else 158 160 Techniques::SetFullApproximationSchemeDirichlet(interface->MinLevel(), interface->MaxLevel(), gamma); … … 183 185 vmg_float* box_offset, vmg_float box_size, 184 186 vmg_int near_field_cells, vmg_int interpolation_degree, 185 MPI_Comm mpi_comm)187 vmg_int discretization_order, MPI_Comm mpi_comm) 186 188 { 187 189 if (VMGBackupSettings::level != level || … … 199 201 VMGBackupSettings::near_field_cells != near_field_cells || 200 202 VMGBackupSettings::interpolation_degree != interpolation_degree || 203 VMGBackupSettings::discretization_order != discretization_order || 201 204 VMGBackupSettings::mpi_comm != mpi_comm) { 202 205 … … 205 208 smoothing_steps, gamma, precision, 206 209 box_offset, box_size, near_field_cells, 207 interpolation_degree, mpi_comm); 210 interpolation_degree, discretization_order, 211 mpi_comm); 208 212 209 213 } -
src/interface/interface_fcs.h
rb2154a3 r4571da 17 17 fcs_float* box_offset, fcs_float box_size, 18 18 fcs_int near_field_cells, fcs_int interpolation_degree, 19 MPI_Comm mpi_comm);19 fcs_int discretization_order, MPI_Comm mpi_comm); 20 20 21 21 int VMG_fcs_check(); -
src/interface/interface_particles.cpp
rb2154a3 r4571da 20 20 #endif 21 21 22 #include <algorithm> 22 23 #include <cmath> 23 24 #include <cstring> … … 85 86 for (index.Y()=0; index.Y()<grid.Local().Size().Y(); ++index.Y()) 86 87 for (index.Z()=0; index.Z()<grid.Local().Size().Z(); ++index.Z()) 87 grid(index + grid.Local().Begin()) = 4.0 * Math::pi * particle_grid.GetVal(index + particle_grid.Local().Begin());88 grid(index + grid.Local().Begin()) = 4.0 * Math::pi * particle_grid.GetVal(index + particle_grid.Local().Begin()); 88 89 89 90 #ifdef DEBUG_OUTPUT … … 99 100 void InterfaceParticles::ExportSolution(Grid& grid) 100 101 { 101 Index i ndex;102 Index i; 102 103 vmg_float length; 103 Vector dist_vec;104 104 105 105 #ifdef DEBUG_OUTPUT … … 107 107 vmg_float e_long = 0.0; 108 108 vmg_float e_self = 0.0; 109 vmg_float e_short = 0.0;110 vmg_float e_short corr= 0.0;109 vmg_float e_short_peak = 0.0; 110 vmg_float e_short_spline = 0.0; 111 111 #endif 112 112 … … 125 125 InterpolatePolynomial ip(interpolation_degree); 126 126 127 const vmg_float r_cut = (near_field_cells+0.5) * grid.Extent().MeshWidth().Max(); 128 129 /* 130 * Initialize potential 131 */ 132 for (vmg_int i=0; i<num_particles_local; ++i) { 133 p[i] = 0.0; 134 for (vmg_int j=0;j<3;++j) 135 f[3*i+j] = 0.; 136 } 127 const vmg_float r_cut = near_field_cells * grid.Extent().MeshWidth().Max(); 128 129 // Initialize field 130 std::fill(f, f+3*num_particles_local, 0.0); 137 131 138 132 /* … … 143 137 Grid& particle_grid = comm.GetParticleGrid(); 144 138 145 for (i ndex.X()=0; index.X()<grid.Local().Size().X(); ++index.X())146 for (i ndex.Y()=0; index.Y()<grid.Local().Size().Y(); ++index.Y())147 for (i ndex.Z()=0; index.Z()<grid.Local().Size().Z(); ++index.Z())148 particle_grid(i ndex + particle_grid.Local().Begin()) = grid.GetVal(index+ grid.Local().Begin());139 for (i.X()=0; i.X()<grid.Local().Size().X(); ++i.X()) 140 for (i.Y()=0; i.Y()<grid.Local().Size().Y(); ++i.Y()) 141 for (i.Z()=0; i.Z()<grid.Local().Size().Z(); ++i.Z()) 142 particle_grid(i + particle_grid.Local().Begin()) = grid.GetVal(i + grid.Local().Begin()); 149 143 150 144 comm.CommToGhosts(particle_grid); … … 170 164 171 165 #ifdef DEBUG_OUTPUT 172 // TODO The scaling with 1/2 may not be correct. Check that. 173 e_long += 0.5 * (*p1)->Charge() * Helper::InterpolateTrilinear((*p1)->Pos(), particle_grid); 166 e_long += 0.5 * (*p1)->Charge() * ip.Evaluate((*p1)->Pos()); 174 167 e_self += 0.5 * (*p1)->Charge() * (*p1)->Charge() * spl.GetAntiDerivativeAtZero(); 175 168 #endif 176 169 177 for (i ndex.X()=-1*near_field_cells-1; index.X()<=near_field_cells+1; ++index.X())178 for (i ndex.Y()=-1*near_field_cells-1; index.Y()<=near_field_cells+1; ++index.Y())179 for (i ndex.Z()=-1*near_field_cells-1; index.Z()<=near_field_cells+1; ++index.Z()) {180 181 std::list<Particle::Particle*>& lc_2 = lc(*iter+i ndex);170 for (i.X()=-1*near_field_cells; i.X()<=near_field_cells; ++i.X()) 171 for (i.Y()=-1*near_field_cells; i.Y()<=near_field_cells; ++i.Y()) 172 for (i.Z()=-1*near_field_cells; i.Z()<=near_field_cells; ++i.Z()) { 173 174 std::list<Particle::Particle*>& lc_2 = lc(*iter+i); 182 175 183 176 for (p2=lc_2.begin(); p2!=lc_2.end(); ++p2) … … 186 179 length = ((*p2)->Pos() - (*p1)->Pos()).Length(); 187 180 188 //TODO Rewrite this equation more efficiently189 181 if (length < r_cut) { 190 182 (*p1)->Pot() += (*p2)->Charge() / length * (1.0 + spl.EvaluatePotential(length)); 191 183 192 184 #ifdef DEBUG_OUTPUT 193 e_short += 0.5 * (*p1)->Charge() * (*p2)->Charge() / length;194 e_short corr -= 0.5 * (*p1)->Charge() * (*p2)->Charge() / length * spl.EvaluatePotential(length);185 e_short_peak += 0.5 * (*p1)->Charge() * (*p2)->Charge() / length; 186 e_short_spline += 0.5 * (*p1)->Charge() * (*p2)->Charge() / length * spl.EvaluatePotential(length); 195 187 #endif 196 188 } … … 205 197 vmg_float* q = factory.GetObjectStorageArray<vmg_float>("PARTICLE_CHARGE_ARRAY"); 206 198 207 for (int i=0; i<num_particles_local; ++i) 208 e += 0.5 * p[i] * q[i]; 209 199 e_long = comm.GlobalSumRoot(e_long); 200 e_short_peak = comm.GlobalSumRoot(e_short_peak); 201 e_short_spline = comm.GlobalSumRoot(e_short_spline); 202 e_self = comm.GlobalSumRoot(e_self); 203 204 for (int j=0; j<num_particles_local; ++j) 205 e += 0.5 * p[j] * q[j]; 210 206 e = comm.GlobalSumRoot(e); 211 e_long = comm.GlobalSumRoot(e_long); 212 e_self = comm.GlobalSumRoot(e_self); 213 e_short = comm.GlobalSumRoot(e_short); 214 e_shortcorr = comm.GlobalSumRoot(e_shortcorr); 215 216 comm.PrintStringOnce("E_long: %e", e_long); 217 comm.PrintStringOnce("E_short: %e", e_short); 218 comm.PrintStringOnce("E_shortcorr: %e", e_shortcorr); 219 comm.PrintStringOnce("E_short*: %e", e - e_long + e_self); 220 comm.PrintStringOnce("E_self: %e", e_self); 221 comm.PrintStringOnce("E_total: %e", e); 207 208 comm.PrintStringOnce("E_long: %e", e_long); 209 comm.PrintStringOnce("E_short_peak: %e", e_short_peak); 210 comm.PrintStringOnce("E_short_spline: %e", e_short_spline); 211 comm.PrintStringOnce("E_self: %e", e_self); 212 comm.PrintStringOnce("E_total: %e", e); 213 comm.PrintStringOnce("E_total*: %e", e_long + e_short_peak + e_short_spline - e_self); 222 214 223 215 #endif /* DEBUG_OUTPUT */ -
src/interface/interface_particles.hpp
rb2154a3 r4571da 35 35 Interface(boundary, levelMin, levelMax, box_offset, box_size, coarsening_steps, alpha), 36 36 HasRequestVec(), 37 spl( (near_field_cells+0.5)*Extent(MaxLevel()).MeshWidth().Max())37 spl(near_field_cells*Extent(MaxLevel()).MeshWidth().Max()) 38 38 {} 39 39 -
src/interface/interface_particles_cf.cpp
rb2154a3 r4571da 59 59 int max_level, max_iterations; 60 60 int pre_smoothing_steps, post_smoothing_steps; 61 int gamma, near_field_cells ;61 int gamma, near_field_cells, discretization_order; 62 62 vmg_float precision; 63 63 std::string lop_str, datafile_str; … … 109 109 gamma = Helper::ToValWithDefault<int>(xml_conf.child_value("gamma"), 1); 110 110 near_field_cells = Helper::ToValWithDefault<int>(xml_conf.child_value("near_field_cells"), 3); 111 discretization_order = Helper::ToValWithDefault<int>(xml_conf.child_value("discretization_order"), 2); 111 112 precision = Helper::ToValWithDefault<vmg_float>(xml_conf.child_value("precision"), 1.0e-7); 112 113 lop_str = xml_conf.child_value("level_operator"); … … 126 127 MG::SetInterface(interface, comm); 127 128 128 Discretization* discretization = new DiscretizationPoissonFD( );129 Discretization* discretization = new DiscretizationPoissonFD(discretization_order); 129 130 discretization->Register("DISCRETIZATION"); 130 131 … … 174 175 std::printf(" Precision: %e\n", precision); 175 176 std::printf(" Near field cells: %d\n", near_field_cells); 177 std::printf(" Discretization order: %d\n", discretization_order); 176 178 } 177 179 -
src/mg.cpp
rb2154a3 r4571da 223 223 } 224 224 225 VMG::Grid& MG::GetRhsMaxLevel() 226 { 227 return (*MG::GetRhs())(MG::GetRhs()->MaxLevel()); 228 } 229 230 VMG::Grid& MG::GetSolMaxLevel() 231 { 232 return (*MG::GetSol())(MG::GetSol()->MaxLevel()); 233 } 234 225 235 Smoother* MG::GetSmoother() 226 236 { -
src/mg.hpp
rb2154a3 r4571da 47 47 static VMG::Multigrid* GetRhs(); 48 48 static VMG::Multigrid* GetSol(); 49 static VMG::Grid& GetRhsMaxLevel(); 50 static VMG::Grid& GetSolMaxLevel(); 49 51 static VMG::Smoother* GetSmoother(); 50 52 static VMG::Solver* GetSolver(); -
src/samples/bspline.hpp
rb2154a3 r4571da 26 26 BSpline(const vmg_float& width); 27 27 28 vmg_float EvaluateSpline(const vmg_float& val) 28 vmg_float EvaluateSpline(const vmg_float& val) const 29 29 { 30 30 for (unsigned int i=0; i<intervals.size(); ++i) … … 34 34 } 35 35 36 void SetSpline(Grid& grid, const Particle::Particle p, const int& near_field_cells) 36 void SetSpline(Grid& grid, const Particle::Particle p, const int& near_field_cells) const 37 37 { 38 38 assert(p.Pos().X() >= grid.Extent().Begin().X() && p.Pos().X() < grid.Extent().End().X()); … … 83 83 } 84 84 85 vmg_float EvaluatePotential(const vmg_float& val) 85 vmg_float EvaluatePotential(const vmg_float& val) const 86 86 { 87 87 for (unsigned int i=0; i<intervals.size(); ++i) -
src/samples/discretization_poisson_fd.hpp
rb2154a3 r4571da 21 21 { 22 22 public: 23 DiscretizationPoissonFD() 24 { 25 stencil.SetDiag(6.0); 26 stencil.push_back(-1, 0, 0, -1.0); 27 stencil.push_back( 1, 0, 0, -1.0); 28 stencil.push_back( 0, -1, 0, -1.0); 29 stencil.push_back( 0, 1, 0, -1.0); 30 stencil.push_back( 0, 0, -1, -1.0); 31 stencil.push_back( 0, 0, 1, -1.0); 32 } 23 DiscretizationPoissonFD(const int& order); 33 24 34 25 vmg_float OperatorPrefactor(const Grid& grid) const … … 37 28 } 38 29 39 private: 40 void SetInnerBoundaryCompute(Grid& sol_fine, Grid& rhs_fine, Grid& sol_coarse) const {} 30 void ModifyRightHandSide(); 41 31 }; 42 32 -
src/samples/discretization_poisson_fv.hpp
rb2154a3 r4571da 23 23 { 24 24 public: 25 DiscretizationPoissonFV() 25 DiscretizationPoissonFV(const int& order) : 26 Discretization(order) 26 27 { 27 28 stencil.SetDiag(6.0); -
src/samples/techniques.hpp
rb2154a3 r4571da 108 108 AddCycleGamma(*loop, maxLevel-minLevel+1, gamma); 109 109 110 loop->AddCommand("SetAverageToZero", "SOL"); 110 111 loop->AddCommand("ComputeResidualNorm", "RESIDUAL"); 111 112 loop->AddCommand("CheckResidual", "RESIDUAL"); … … 140 141 AddCycleGammaDebug(*loop, maxLevel-minLevel+1, gamma); 141 142 143 loop->AddCommand("SetAverageToZero", "SOL"); 142 144 loop->AddCommand("ComputeResidualNorm", "RESIDUAL"); 143 145 loop->AddCommand("CheckResidual", "RESIDUAL"); … … 170 172 AddCycleGamma(*loop, maxLevel-minLevel+1, gamma); 171 173 174 loop->AddCommand("SetAverageToZero", "SOL"); 172 175 loop->AddCommand("ComputeResidualNorm", "RESIDUAL"); 173 176 loop->AddCommand("CheckResidual", "RESIDUAL"); … … 201 204 AddCycleGammaDebug(*loop, maxLevel-minLevel+1, gamma); 202 205 206 loop->AddCommand("SetAverageToZero", "SOL"); 203 207 loop->AddCommand("ComputeResidualNorm", "RESIDUAL"); 204 208 loop->AddCommand("CheckResidual", "RESIDUAL"); -
src/smoother/gs.cpp
rb2154a3 r4571da 43 43 for (grid_iter = rhs.Iterators().Local().Begin(); grid_iter != rhs.Iterators().Local().End(); ++grid_iter) { 44 44 45 temp = prefactor_inv * rhs.Get CorrectedVal(*grid_iter);45 temp = prefactor_inv * rhs.GetVal(*grid_iter); 46 46 47 47 for (stencil_iter=A.begin(); stencil_iter!=A.end(); ++stencil_iter) -
src/smoother/gsrb.cpp
rb2154a3 r4571da 12 12 #endif 13 13 14 #ifdef HAVE_MPI 14 15 #include <mpi.h> 15 16 #include <sstream> 16 #endif 17 17 18 18 #include "base/discretization.hpp" -
src/solver/solver_singular.cpp
rb2154a3 r4571da 123 123 124 124 } 125 126 // Set correction127 Grid::Correction() = this->Sol(this->Size()-1);128 125 } -
test/unit_test/library/dirichlet_cs.cpp
rb2154a3 r4571da 48 48 MG::SetInterface(interface, comm); 49 49 50 Discretization* discretization = new DiscretizationPoissonFD( );50 Discretization* discretization = new DiscretizationPoissonFD(2); 51 51 discretization->Register("DISCRETIZATION"); 52 52 -
test/unit_test/library/dirichlet_cs_mpi.cpp
rb2154a3 r4571da 56 56 MG::SetInterface(interface, comm); 57 57 58 Discretization* discretization = new DiscretizationPoissonFD( );58 Discretization* discretization = new DiscretizationPoissonFD(2); 59 59 discretization->Register("DISCRETIZATION"); 60 60 -
test/unit_test/library/dirichlet_fas.cpp
rb2154a3 r4571da 48 48 MG::SetInterface(interface, comm); 49 49 50 Discretization* discretization = new DiscretizationPoissonFD( );50 Discretization* discretization = new DiscretizationPoissonFD(2); 51 51 discretization->Register("DISCRETIZATION"); 52 52 -
test/unit_test/library/dirichlet_fas_lr.cpp
rb2154a3 r4571da 48 48 MG::SetInterface(interface, comm); 49 49 50 Discretization* discretization = new DiscretizationPoissonFV( );50 Discretization* discretization = new DiscretizationPoissonFV(2); 51 51 discretization->Register("DISCRETIZATION"); 52 52 -
test/unit_test/library/dirichlet_fas_lr_mpi.cpp
rb2154a3 r4571da 57 57 MG::SetInterface(interface, comm); 58 58 59 Discretization* discretization = new DiscretizationPoissonFV( );59 Discretization* discretization = new DiscretizationPoissonFV(2); 60 60 discretization->Register("DISCRETIZATION"); 61 61 -
test/unit_test/library/dirichlet_fas_mpi.cpp
rb2154a3 r4571da 57 57 MG::SetInterface(interface, comm); 58 58 59 Discretization* discretization = new DiscretizationPoissonFD( );59 Discretization* discretization = new DiscretizationPoissonFD(2); 60 60 discretization->Register("DISCRETIZATION"); 61 61 -
test/unit_test/library/periodic_cs.cpp
rb2154a3 r4571da 48 48 MG::SetInterface(interface, comm); 49 49 50 Discretization* discretization = new DiscretizationPoissonFD( );50 Discretization* discretization = new DiscretizationPoissonFD(2); 51 51 discretization->Register("DISCRETIZATION"); 52 52 -
test/unit_test/library/periodic_cs_mpi.cpp
rb2154a3 r4571da 56 56 MG::SetInterface(interface, comm); 57 57 58 Discretization* discretization = new DiscretizationPoissonFD( );58 Discretization* discretization = new DiscretizationPoissonFD(2); 59 59 discretization->Register("DISCRETIZATION"); 60 60 -
test/unit_test/library/periodic_fas.cpp
rb2154a3 r4571da 47 47 MG::SetInterface(interface, comm); 48 48 49 Discretization* discretization = new DiscretizationPoissonFD( );49 Discretization* discretization = new DiscretizationPoissonFD(2); 50 50 discretization->Register("DISCRETIZATION"); 51 51 -
test/unit_test/library/periodic_fas_mpi.cpp
rb2154a3 r4571da 56 56 MG::SetInterface(interface, comm); 57 57 58 Discretization* discretization = new DiscretizationPoissonFD( );58 Discretization* discretization = new DiscretizationPoissonFD(2); 59 59 discretization->Register("DISCRETIZATION"); 60 60 -
test/unit_test/unit_test/smoother_test.cpp
rb2154a3 r4571da 34 34 comm->Register("COMM"); 35 35 36 Discretization* discretization = new DiscretizationPoissonFD( );36 Discretization* discretization = new DiscretizationPoissonFD(2); 37 37 discretization->Register("DISCRETIZATION"); 38 38
Note:
See TracChangeset
for help on using the changeset viewer.
