- Timestamp:
- Feb 14, 2013, 12:26:12 PM (12 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 3d9a8d
- Parents:
- 1b01e9
- git-author:
- Frederik Heber <heber@…> (12/03/12 12:43:00)
- git-committer:
- Frederik Heber <heber@…> (02/14/13 12:26:12)
- Location:
- src/Jobs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Jobs/VMGJob.cpp
r1b01e9 re089fb 90 90 interpolation_degree(_interpolation_degree), 91 91 returndata(static_cast<const SamplingGridProperties &>(_density_grid)), 92 particles() 93 {} 94 95 VMGJob::VMGJob() : 96 FragmentJob(JobId::IllegalJob), 97 near_field_cells(3), 98 interpolation_degree(3), 99 particles() 100 {} 101 102 VMGJob::~VMGJob() 103 { 104 } 105 106 107 VMGJob::particle_arrays::particle_arrays() : 92 108 num_particles(0), 93 109 f(NULL), … … 97 113 {} 98 114 99 VMGJob::VMGJob() : 100 FragmentJob(JobId::IllegalJob), 101 near_field_cells(3), 102 interpolation_degree(3), 103 num_particles(0), 104 f(NULL), 105 x(NULL), 106 p(NULL), 107 q(NULL) 108 {} 109 110 VMGJob::~VMGJob() 115 VMGJob::particle_arrays::~particle_arrays() 111 116 { 112 117 delete[] f; … … 116 121 } 117 122 118 void VMGJob:: InitVMGArrays()119 { 120 num_particles = particle_charges.size();123 void VMGJob::particle_arrays::init(const size_t _num_particles) 124 { 125 num_particles = _num_particles; 121 126 f = new double[num_particles*3]; 122 127 x = new double[num_particles*3]; 123 128 p = new double[num_particles]; 124 129 q = new double[num_particles]; 130 } 131 132 void VMGJob::InitVMGArrays() 133 { 134 particles.init(particle_charges.size()); 125 135 126 136 { … … 130 140 for (std::vector< double >::const_iterator positer = (*iter).begin(); 131 141 positer != (*iter).end(); ++positer) { 132 f[index] = 0.;133 x[index++] = *positer;142 particles.f[index] = 0.; 143 particles.x[index++] = *positer; 134 144 } 135 145 } 136 ASSERT( index == num_particles*3,146 ASSERT( index == particles.num_particles*3, 137 147 "VMGJob::VMGJob() - too many particles or components in particle_positions."); 138 148 } … … 141 151 for (std::vector< double >::const_iterator iter = particle_charges.begin(); 142 152 iter != particle_charges.end(); ++iter) { 143 p [index] = 0.;144 q[index++] = *iter;153 particles.p[index] = 0.; 154 particles.q[index++] = *iter; 145 155 } 146 ASSERT( index == num_particles,156 ASSERT( index == particles.num_particles, 147 157 "VMGJob::VMGJob() - too many charges in particle_charges."); 148 158 } … … 226 236 InitVMGArrays(); 227 237 // then initialize as objects with VMG's storage 228 new ObjectStorage<vmg_float*>("PARTICLE_POS_ARRAY", x);229 new ObjectStorage<vmg_float*>("PARTICLE_CHARGE_ARRAY", q);230 new ObjectStorage<vmg_float*>("PARTICLE_POTENTIAL_ARRAY", p );231 new ObjectStorage<vmg_float*>("PARTICLE_FIELD_ARRAY", f);232 new ObjectStorage<vmg_int>("PARTICLE_NUM_LOCAL", num_particles);238 new ObjectStorage<vmg_float*>("PARTICLE_POS_ARRAY", particles.x); 239 new ObjectStorage<vmg_float*>("PARTICLE_CHARGE_ARRAY", particles.q); 240 new ObjectStorage<vmg_float*>("PARTICLE_POTENTIAL_ARRAY", particles.p); 241 new ObjectStorage<vmg_float*>("PARTICLE_FIELD_ARRAY", particles.f); 242 new ObjectStorage<vmg_int>("PARTICLE_NUM_LOCAL", particles.num_particles); 233 243 234 244 /* -
src/Jobs/VMGJob.hpp
r1b01e9 re089fb 75 75 VMGData returndata; 76 76 77 //!> number of particles 78 size_t num_particles; 79 //!> forces array 80 double *f; 81 //!> position array 82 double *x; 83 //!> potential array 84 double *p; 85 //!> charge array 86 double *q; 77 /** This structure stores particle values per particle. 78 * 79 * \note This structure contains temporary information needed during solving 80 * with VMG. 81 * \warning It is specifically not serialized! 82 * 83 */ 84 struct particle_arrays { 85 particle_arrays(); 86 ~particle_arrays(); 87 88 /** Initializes arrays. 89 * 90 * @param _num_particles size of array per dimension 91 */ 92 void init(const size_t _num_particles); 93 94 //!> number of particles 95 size_t num_particles; 96 //!> forces array 97 double *f; 98 //!> position array 99 double *x; 100 //!> potential array 101 double *p; 102 //!> charge array 103 double *q; 104 } particles; 87 105 88 106 private:
Note:
See TracChangeset
for help on using the changeset viewer.