Changeset cd0fed for src/units/particle
- Timestamp:
- May 10, 2012, 12:22:46 PM (14 years ago)
- Children:
- 06e153
- Parents:
- ae05b4
- Location:
- src/units/particle
- Files:
-
- 5 edited
-
bspline.hpp (modified) (1 diff)
-
comm_mpi_particle.cpp (modified) (2 diffs)
-
interface_particles.cpp (modified) (2 diffs)
-
interpolation.cpp (modified) (4 diffs)
-
interpolation.hpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/units/particle/bspline.hpp
rae05b4 rcd0fed 43 43 assert(p.Pos().Z() >= grid.Extent().Begin().Z() && p.Pos().Z() < grid.Extent().End().Z()); 44 44 45 vmg_float vals[Helper::intpow(2*near_field_cells+1,3)];45 std::vector<vmg_float> vals(Helper::intpow(2*near_field_cells+1,3)); 46 46 vmg_float temp_val; 47 47 vmg_float int_val = 0.0; -
src/units/particle/comm_mpi_particle.cpp
rae05b4 rcd0fed 57 57 std::vector< std::vector<vmg_float> > recv_buffer_q(size); 58 58 std::vector< std::vector<vmg_int> > recv_buffer_ind(size); 59 MPI_Datatype dt_temp;60 59 61 60 std::memcpy(&global_extent[6*rank], grid.Global().LocalBegin().vec(), 3*sizeof(int)); … … 199 198 // Add potential values 200 199 for (int i=0; i<size; ++i) 201 for ( unsignedint j=0; j<size_receive[i]; ++j) {200 for (vmg_int j=0; j<size_receive[i]; ++j) { 202 201 p[recv_buffer_index[i][j]] = recv_buffer_float[i][4*j]; 203 202 std::memcpy(&f[recv_buffer_index[i][j]], &recv_buffer_float[i][4*j+1], 3*sizeof(vmg_float)); -
src/units/particle/interface_particles.cpp
rae05b4 rcd0fed 117 117 * Get parameters and arrays 118 118 */ 119 const vmg_int& num_particles_local = factory.GetObjectStorageVal<vmg_int>("PARTICLE_NUM_LOCAL");120 119 const vmg_int& near_field_cells = factory.GetObjectStorageVal<int>("PARTICLE_NEAR_FIELD_CELLS"); 121 120 const vmg_int& interpolation_degree = factory.GetObjectStorageVal<int>("PARTICLE_INTERPOLATION_DEGREE"); 122 vmg_float* p = factory.GetObjectStorageArray<vmg_float>("PARTICLE_POTENTIAL_ARRAY");123 vmg_float* f = factory.GetObjectStorageArray<vmg_float>("PARTICLE_FIELD_ARRAY");124 121 125 122 Particle::Interpolation ip(interpolation_degree); … … 198 195 #ifdef DEBUG_OUTPUT 199 196 vmg_float* q = factory.GetObjectStorageArray<vmg_float>("PARTICLE_CHARGE_ARRAY"); 197 const vmg_int& num_particles_local = factory.GetObjectStorageVal<vmg_int>("PARTICLE_NUM_LOCAL"); 198 const vmg_float* p = factory.GetObjectStorageArray<vmg_float>("PARTICLE_POTENTIAL_ARRAY"); 199 const vmg_float* f = factory.GetObjectStorageArray<vmg_float>("PARTICLE_FIELD_ARRAY"); 200 200 201 201 202 e_long = comm.GlobalSumRoot(e_long); -
src/units/particle/interpolation.cpp
rae05b4 rcd0fed 14 14 using namespace VMG; 15 15 16 Particle::Interpolation::Interpolation(const unsignedint& degree) :16 Particle::Interpolation::Interpolation(const int& degree) : 17 17 deg(degree), 18 18 deg_1(degree+1), … … 36 36 Index i; 37 37 38 const Index begin = index - (static_cast<int>(deg_1)-1)/2 - 1;38 const Index begin = index - deg/2 - 1; 39 39 40 40 h = grid.Extent().MeshWidth(); … … 68 68 vmg_float power = 1.0; 69 69 unsigned long faculty = 1; 70 unsignedint c;70 int c; 71 71 Index i; 72 72 … … 77 77 ++i[direction]; 78 78 for (c=1; c<deg_1; ++i[direction], ++c) { 79 for ( unsignedint j=0; j<deg_1-c; ++j)79 for (int j=0; j<deg_1-c; ++j) 80 80 coeff_buffer[j] = coeff_buffer[j+1] - coeff_buffer[j]; 81 81 faculty *= c; -
src/units/particle/interpolation.hpp
rae05b4 rcd0fed 20 20 { 21 21 public: 22 Interpolation(const unsignedint& degree);22 Interpolation(const int& degree); 23 23 ~Interpolation(); 24 24 … … 43 43 vmg_float* coeff; 44 44 vmg_float* coeff_buffer; 45 unsignedint deg, deg_1;45 int deg, deg_1; 46 46 Vector pos_begin; 47 47 Vector h;
Note:
See TracChangeset
for help on using the changeset viewer.
