- Timestamp:
- Nov 16, 2012, 2:13:47 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:
- 36bb2d
- Parents:
- 17fcbe7
- git-author:
- Frederik Heber <heber@…> (08/10/12 08:24:09)
- git-committer:
- Frederik Heber <heber@…> (11/16/12 14:13:47)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Jobs/InterfaceVMGJob.cpp
r17fcbe7 ra1436b 99 99 //grid.ClearBoundary(); // we don't have a boundary under periodic boundary conditions 100 100 101 // print debugging info on grid size 102 LOG(1, "INFO: Mesh has extent " << grid.Extent().MeshWidth() << "."); 103 const int gridpoints = pow(2, level); 104 LOG(1, "INFO: gridpoints on finest level are " << gridpoints << "."); 105 LOG(1, "INFO: " 106 << "X in [" << grid.Local().Begin().X() << "," << grid.Local().End().X() << "]," 107 << "Y in [" << grid.Local().Begin().Y() << "," << grid.Local().End().Y() << "]," 108 << "Z in [" << grid.Local().Begin().Z() << "," << grid.Local().End().Z() << "]."); 109 101 110 /// 1. assign nuclei as smeared-out charges to the grid 102 111 … … 124 133 comm.CommFromGhosts(particle_grid); 125 134 126 // // for normlization sum up charges 127 // double particle_charges = 0.0; 128 // for (std::list<Particle::Particle>::iterator iter=particles.begin(); iter!=particles.end(); ++iter) 129 // particle_charges += iter->Charge(); 130 // particle_charges = MG::GetComm()->GlobalSumRoot(particle_charges); 131 // LOG(1, "INFO: Total charge is " << particle_charges << "."); 135 // print nuclei grid to vtk 136 comm.PrintGrid(particle_grid, "Sampled Nuclei Density"); 132 137 133 138 // add sampled electron charge density onto grid 134 139 std::vector<double>::const_iterator sample_iter = sampled_input.begin(); 135 for (Grid::iterator iter = particle_grid.Iterators().Local().Begin();136 iter != particle_grid.Iterators().Local().End();140 for (Grid::iterator iter = grid.Iterators().Local().Begin(); 141 iter != grid.Iterators().Local().End(); 137 142 ++iter) 138 particle_grid(*iter) -= (*sample_iter++); 139 /* 140 for (i.X()=grid.Local().Begin().X(); i.X()<grid.Local().End().X(); ++i.X()) 141 for (i.Y()=grid.Local().Begin().Y(); i.Y()<grid.Local().End().Y(); ++i.Y()) 142 for (i.Z()=grid.Local().Begin().Z(); i.Z()<grid.Local().End().Z(); ++i.Z()) 143 particle_grid(i) -= (*sample_iter++); //temp_grid(i); 144 */ 143 grid(*iter) = -1. * (*sample_iter++); 145 144 assert( sample_iter == sampled_input.end() ); 145 146 // print electron grid to vtk 147 comm.PrintGrid(grid, "Sampled Electron Density"); 146 148 147 149 // add particle_grid onto grid … … 151 153 grid(grid.Local().Begin().X() + i, 152 154 grid.Local().Begin().Y() + j, 153 grid.Local().Begin().Z() + k) = 4.0 * VMG::Math::pi * 155 grid.Local().Begin().Z() + k) = 4.0 * VMG::Math::pi * ( 156 grid(grid.Local().Begin().X() + i, 157 grid.Local().Begin().Y() + j, 158 grid.Local().Begin().Z() + k) + 154 159 particle_grid.GetVal(particle_grid.Local().Begin().X() + i, 155 160 particle_grid.Local().Begin().Y() + j, 156 particle_grid.Local().Begin().Z() + k); 157 158 /// 2. add sampled electron density to the grid 159 160 const Index begin_local = grid.Global().LocalBegin() - grid.Local().HaloSize1(); 161 162 // print debugging info on grid size 163 LOG(1, "INFO: Mesh has extent " << grid.Extent().MeshWidth() << "."); 164 const int gridpoints = pow(2, level); 165 LOG(1, "INFO: gridpoints on finest level are " << gridpoints << "."); 166 LOG(1, "INFO: " 167 << "X in [" << grid.Local().Begin().X() << "," << grid.Local().End().X() << "]," 168 << "Y in [" << grid.Local().Begin().Y() << "," << grid.Local().End().Y() << "]," 169 << "Z in [" << grid.Local().Begin().Z() << "," << grid.Local().End().Z() << "]."); 161 particle_grid.Local().Begin().Z() + k)); 170 162 171 163 // calculate sum over grid times h^3 as check, should be roughly zero … … 179 171 comm.PrintStringOnce("Grid charge integral: %e", charge_sum/(4.0 * VMG::Math::pi)); 180 172 181 // print inputgrid to vtk182 comm.PrintGrid(grid, " grid after ImportRightHandSide");173 // print total grid to vtk 174 comm.PrintGrid(grid, "Total Charge Density"); 183 175 184 176 // delete temp_grid; … … 188 180 { 189 181 // grid now contains the sough-for potential 190 VMG::Comm& comm = *VMG::MG::GetComm();182 Comm& comm = *MG::GetComm(); 191 183 192 184 const Index begin_local = grid.Global().LocalBegin() - grid.Local().HaloSize1(); … … 194 186 195 187 // print output grid to vtk 196 comm.PrintGrid(grid, " grid after ExportSolution");188 comm.PrintGrid(grid, "Potential Solution"); 197 189 198 190 // obtain sampled potential from grid
Note:
See TracChangeset
for help on using the changeset viewer.