Changeset f6c19d for src


Ignore:
Timestamp:
Sep 19, 2013, 8:10:24 PM (11 years ago)
Author:
Frederik Heber <heber@…>
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:
1e5f84
Parents:
ee9018
git-author:
Frederik Heber <heber@…> (05/01/13 14:37:54)
git-committer:
Frederik Heber <heber@…> (09/19/13 20:10:24)
Message:

InterfaceVMGDebugJob now also uses optionally open boundary (FAS instead of CS).

  • VMGDebugGridJob has parameter OpenBoundaryConditions.
  • VMGDebugGridFragmentController uses parameter when instantiating VMGDebugGridJobs.
Location:
src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/Automation/VMGDebugGridFragmentController.cpp

    ree9018 rf6c19d  
    4444
    4545bool VMGDebugGridFragmentController::createDebugJobs(
    46     const std::vector<SamplingGrid> &full_sampled_grid)
     46    const std::vector<SamplingGrid> &full_sampled_grid,
     47    const bool _OpenBoundaryConditions)
    4748{
    4849  std::vector<FragmentJob::ptr> jobs;
     
    5556        << " gridpoints.");
    5657    FragmentJob::ptr testJob(
    57         new VMGDebugGridJob(next_id, *iter) );
     58        new VMGDebugGridJob(next_id, *iter, _OpenBoundaryConditions) );
    5859    jobs.push_back(testJob);
    5960  }
  • src/Fragmentation/Automation/VMGDebugGridFragmentController.hpp

    ree9018 rf6c19d  
    4141
    4242  bool createDebugJobs(
    43       const std::vector<SamplingGrid> &full_sampled_grid);
     43      const std::vector<SamplingGrid> &full_sampled_grid,
     44      const bool _OpenBoundaryConditions = false);
    4445
    4546  // there are no results but server has empty string nonetheless
  • src/Jobs/InterfaceVMGDebugGridJob.hpp

    ree9018 rf6c19d  
    4343      vmg_float box_end,
    4444      const int& near_field_cells,
    45       int coarseningSteps=0,
     45      int coarseningSteps=9,
    4646      double alpha=1.6);
    4747
  • src/Jobs/VMGDebugGridJob.cpp

    ree9018 rf6c19d  
    5050#include "comm/comm_mpi.hpp"
    5151#include "comm/domain_decomposition_mpi.hpp"
     52#include "units/particle/comm_mpi_particle.hpp"
    5253#else
    5354#include "comm/comm_serial.hpp"
    5455#endif
     56#include "grid/multigrid.hpp"
     57//#include "grid/tempgrid.hpp"
     58#include "level/stencils.hpp"
     59#include "solver/givens.hpp"
     60
     61// periodic boundary conditions
    5562#include "cycles/cycle_cs_periodic.hpp"
    5663#include "discretization/discretization_poisson_fd.hpp"
    57 #include "grid/multigrid.hpp"
    58 //#include "grid/tempgrid.hpp"
    5964#include "level/level_operator_cs.hpp"
    60 #include "level/stencils.hpp"
    6165#include "smoother/gsrb_poisson_4.hpp"
    62 #include "solver/givens.hpp"
    63 //#include "solver/solver_regular.hpp"
    6466#include "solver/solver_singular.hpp"
    65 //#include "units/particle/comm_mpi_particle.hpp"
     67// open boundary conditions
     68#ifndef NDEBUG
     69#include "cycles/cycle_fas_dirichlet_debug.hpp"
     70#else
     71#include "cycles/cycle_fas_dirichlet.hpp"
     72#endif
     73#include "discretization/discretization_poisson_fv.hpp"
     74#include "level/level_operator_fas.hpp"
     75#include "smoother/gsrb_poisson_2.hpp"
     76#include "solver/solver_regular.hpp"
    6677
    6778#include "CodePatterns/MemDebug.hpp"
     
    7687VMGDebugGridJob::VMGDebugGridJob(
    7788    const JobId_t _JobId,
    78     const SamplingGrid &_density_grid) :
     89    const SamplingGrid &_density_grid,
     90    const bool _OpenBoundaryConditions) :
    7991  FragmentJob(_JobId),
    80   density_grid(_density_grid)
     92  density_grid(_density_grid),
     93  OpenBoundaryConditions(_OpenBoundaryConditions)
    8194{}
    8295
    8396VMGDebugGridJob::VMGDebugGridJob() :
    84   FragmentJob(JobId::IllegalJob)
     97  FragmentJob(JobId::IllegalJob),
     98  OpenBoundaryConditions(false)
    8599{}
    86100
     
    120134void VMGDebugGridJob::InitVMG()
    121135{
    122   // TODO: As a matter of fact should use open boundary conditions
    123   const Boundary boundary(Periodic, Periodic, Periodic);
    124 
    125   /*
    126    * Choose multigrid components
    127    */
     136  Boundary *boundary= NULL;
     137  if (OpenBoundaryConditions)
     138    boundary = new Boundary(Open, Open, Open);
     139  else
     140    boundary = new Boundary(Periodic, Periodic, Periodic);
     141
    128142#ifdef HAVE_MPI
    129   new CommMPI(boundary, new DomainDecompositionMPI());
    130 #else
    131   new CommSerial(boundary);
    132 #endif
    133   new DiscretizationPoissonFD(4);
     143  new Particle::CommMPI(*boundary, new DomainDecompositionMPI());
     144#else
     145  new CommSerial(*boundary);
     146#endif
     147  if (OpenBoundaryConditions)
     148    new DiscretizationPoissonFV(2);
     149  else
     150    new DiscretizationPoissonFD(4);
    134151  new VMGInterfaces::InterfaceVMGDebugGridJob(
    135152      density_grid,
    136       boundary,
     153      *boundary,
    137154      2,
    138155      density_grid.level,
     
    140157      density_grid.end[0]-density_grid.begin[0],
    141158      5);
    142   new LevelOperatorCS(Stencils::RestrictionFullWeight, Stencils::InterpolationTrilinear);
    143   new Givens<SolverSingular>();
    144159  const int cycle_type = 1; // V-type
    145   new CycleCSPeriodic(cycle_type);
    146   new GaussSeidelRBPoisson4();
    147 
    148   /*
    149    * Register required parameters.
    150    * We don't actually want solve anything here
    151    */
    152   new ObjectStorage<int>("PRESMOOTHSTEPS", 1);
    153   new ObjectStorage<int>("POSTSMOOTHSTEPS", 1);
    154   new ObjectStorage<vmg_float>("PRECISION", 1.0e-0);
    155   new ObjectStorage<int>("MAX_ITERATION", 1);
    156   new ObjectStorage<int>("PARTICLE_NEAR_FIELD_CELLS", 3);
     160  if (OpenBoundaryConditions) {
     161    new LevelOperatorFAS(Stencils::RestrictionFullWeight, Stencils::Injection, Stencils::InterpolationTrilinear);
     162    new Givens<SolverRegular>();
     163#ifndef NDEBUG
     164    new CycleFASDirichletDebug(cycle_type);
     165#else
     166    new CycleFASDirichlet(cycle_type);
     167#endif
     168    new GaussSeidelRBPoisson2();
     169  } else {
     170    new LevelOperatorCS(Stencils::RestrictionFullWeight, Stencils::InterpolationTrilinear);
     171    new Givens<SolverSingular>();
     172    new CycleCSPeriodic(cycle_type);
     173    new GaussSeidelRBPoisson4();
     174  }
     175  delete boundary;
     176
     177  /*
     178   * Register required parameters
     179   */
     180  new ObjectStorage<int>("PRESMOOTHSTEPS", 3);
     181  new ObjectStorage<int>("POSTSMOOTHSTEPS", 3);
     182  new ObjectStorage<vmg_float>("PRECISION", 1.0e-10);
     183  new ObjectStorage<int>("MAX_ITERATION", 15);
     184  new ObjectStorage<int>("PARTICLE_NEAR_FIELD_CELLS", 5);
    157185  new ObjectStorage<int>("PARTICLE_INTERPOLATION_DEGREE", 3);
    158186
  • src/Jobs/VMGDebugGridJob.hpp

    ree9018 rf6c19d  
    3737   * @param _JobId id of the job
    3838   * @param _density_grid sampled electron charge density from short-range solutions
     39   * @param OpenBoundaryConditions states whether we have open (true) or periodic
     40   *        (false) boundary conditions
    3941   */
    4042  VMGDebugGridJob(const JobId_t _JobId,
    41       const SamplingGrid &density_grid);
     43      const SamplingGrid &density_grid,
     44      const bool _OpenBoundaryConditions = false);
    4245  virtual ~VMGDebugGridJob();
    4346
     
    5053  //!> sampled density required as input
    5154  const SamplingGrid density_grid;
     55  //!> states whether we have open (true) or periodic (false) boundary conditions
     56  const bool OpenBoundaryConditions;
    5257
    5358private:
  • src/Jobs/VMGJob.hpp

    ree9018 rf6c19d  
    133133    ar & const_cast< bool &>(DoImportParticles);
    134134    ar & const_cast< bool &>(DoPrintDebug);
     135    ar & const_cast< bool &>(OpenBoundaryConditions);
    135136    ar & returndata;
    136137  }
Note: See TracChangeset for help on using the changeset viewer.