Changeset a82602 for src/Jobs/VMGJob.cpp
- Timestamp:
- Dec 10, 2012, 10:10:59 AM (13 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, Candidate_v1.7.0, Candidate_v1.7.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:
- 82cbe4
- Parents:
- 5a5196
- git-author:
- Frederik Heber <heber@…> (09/12/12 15:23:13)
- git-committer:
- Frederik Heber <heber@…> (12/10/12 10:10:59)
- File:
-
- 1 edited
-
src/Jobs/VMGJob.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Jobs/VMGJob.cpp
r5a5196 ra82602 63 63 //#include "solver/solver_regular.hpp" 64 64 #include "solver/solver_singular.hpp" 65 //#include "units/particle/comm_mpi_particle.hpp"65 #include "units/particle/comm_mpi_particle.hpp" 66 66 67 67 #include "CodePatterns/MemDebug.hpp" … … 71 71 #include "LinearAlgebra/defs.hpp" 72 72 #include "Jobs/InterfaceVMGJob.hpp" 73 74 #include "CodePatterns/Assert.hpp" 73 75 74 76 using namespace VMG; … … 85 87 particle_charges(_particle_charges), 86 88 near_field_cells(_near_field_cells), 87 returndata(static_cast<const SamplingGridProperties &>(_density_grid)) 89 returndata(static_cast<const SamplingGridProperties &>(_density_grid)), 90 num_particles(0), 91 f(NULL), 92 x(NULL), 93 p(NULL), 94 q(NULL) 88 95 {} 89 96 90 97 VMGJob::VMGJob() : 91 98 FragmentJob(JobId::IllegalJob), 92 near_field_cells(5) 99 near_field_cells(5), 100 num_particles(0), 101 f(NULL), 102 x(NULL), 103 p(NULL), 104 q(NULL) 93 105 {} 94 106 95 107 VMGJob::~VMGJob() 96 {} 108 { 109 delete[] f; 110 delete[] x; 111 delete[] p; 112 delete[] q; 113 } 114 115 void VMGJob::InitVMGArrays() 116 { 117 num_particles = particle_charges.size(); 118 f = new double[num_particles*3]; 119 x = new double[num_particles*3]; 120 p = new double[num_particles]; 121 q = new double[num_particles]; 122 123 { 124 size_t index=0; 125 for (std::vector< std::vector< double > >::const_iterator iter = particle_positions.begin(); 126 iter != particle_positions.end(); ++iter) { 127 for (std::vector< double >::const_iterator positer = (*iter).begin(); 128 positer != (*iter).end(); ++positer) { 129 f[index] = 0.; 130 x[index++] = *positer; 131 } 132 } 133 ASSERT( index == num_particles*3, 134 "VMGJob::VMGJob() - too many particles or components in particle_positions."); 135 } 136 { 137 size_t index = 0; 138 for (std::vector< double >::const_iterator iter = particle_charges.begin(); 139 iter != particle_charges.end(); ++iter) { 140 p[index] = 0.; 141 q[index++] = *iter; 142 } 143 ASSERT( index == num_particles, 144 "VMGJob::VMGJob() - too many charges in particle_charges."); 145 } 146 } 147 97 148 98 149 FragmentResult::ptr VMGJob::Work() … … 137 188 */ 138 189 #ifdef HAVE_MPI 139 new CommMPI(boundary, new DomainDecompositionMPI());190 new Particle::CommMPI(boundary, new DomainDecompositionMPI()); 140 191 #else 141 192 new CommSerial(boundary); … … 169 220 new ObjectStorage<int>("PARTICLE_INTERPOLATION_DEGREE", 3); 170 221 222 // first initialize f,x,p,q,... from STL vectors 223 InitVMGArrays(); 224 // then initialize as objects with VMG's storage 225 new ObjectStorage<vmg_float*>("PARTICLE_POS_ARRAY", x); 226 new ObjectStorage<vmg_float*>("PARTICLE_CHARGE_ARRAY", q); 227 new ObjectStorage<vmg_float*>("PARTICLE_POTENTIAL_ARRAY", p); 228 new ObjectStorage<vmg_float*>("PARTICLE_FIELD_ARRAY", f); 229 new ObjectStorage<vmg_int>("PARTICLE_NUM_LOCAL", num_particles); 230 171 231 /* 172 232 * Post init
Note:
See TracChangeset
for help on using the changeset viewer.
