Ignore:
Timestamp:
Mar 30, 2012, 9:18:25 AM (13 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:
e9ad43
Parents:
5a4cbc
git-author:
Frederik Heber <heber@…> (03/06/12 15:20:13)
git-committer:
Frederik Heber <heber@…> (03/30/12 09:18:25)
Message:

Enhanced FillRegularGridAction to avoid tesselated surfaces.

  • selected molecules (if any) are now tesselated ans IsInsideSurface is used to only fill outside.
Location:
src/Actions/FillAction
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/FillAction/FillRegularGridAction.cpp

    r5a4cbc r345eda  
    2727#include "Filling/Filler.hpp"
    2828#include "Filling/Mesh/CubeMesh.hpp"
     29#include "Filling/Predicates/IsInsideSurface_FillPredicate.hpp"
    2930#include "Filling/Predicates/IsVoidNode_FillPredicate.hpp"
     31#include "Filling/Predicates/Ops_FillPredicate.hpp"
     32#include "LinkedCell/linkedcell.hpp"
     33#include "LinkedCell/PointCloudAdaptor.hpp"
     34#include "molecule.hpp"
    3035#include "MoleculeListClass.hpp"
    3136#include "Parser/FormatParserInterface.hpp"
    3237#include "Parser/FormatParserStorage.hpp"
    3338#include "Shapes/BaseShapes.hpp"
     39#include "Tesselation/tesselation.hpp"
     40#include "Tesselation/BoundaryLineSet.hpp"
     41#include "Tesselation/BoundaryTriangleSet.hpp"
     42#include "Tesselation/CandidateForTesselation.hpp"
    3443#include "World.hpp"
    3544
     
    111120  LOG(2, "INFO: Created cluster of size " << atomset.size() << ".");
    112121
     122  // check for selected molecules and create surfaces from them
     123  const std::vector<molecule *> molecules = World::getInstance().getSelectedMolecules();
     124  typedef std::list<FillPredicate *> predicate_list_t;
     125  typedef std::list<LinkedCell_deprecated *> LC_list_t;
     126  typedef std::list<Tesselation *> Tesselation_list_t;
     127  predicate_list_t surface_predicate_list;
     128  LC_list_t LinkedCell_deprecated_list;
     129  Tesselation_list_t Tesselation_list;
     130  if (params.SphereRadius != 0.) {
     131    if ( molecules.size() == 0) {
     132      ELOG(1, "You have given a sphere radius " << params.SphereRadius
     133          << " != 0, but have not select any molecules.");
     134    }
     135    for (std::vector<molecule *>::const_iterator iter = molecules.begin();
     136        iter != molecules.end(); ++iter) {
     137      // create adaptor for the current molecule
     138      PointCloudAdaptor< molecule > cloud(*iter, (*iter)->name);
     139      LinkedCell_deprecated_list.push_back(
     140          new LinkedCell_deprecated(cloud, 2.*params.SphereRadius)
     141      );
     142
     143      // create tesselation
     144      Tesselation_list.push_back(
     145          new Tesselation
     146      );
     147      (*Tesselation_list.back())(cloud, params.SphereRadius);
     148
     149      // and create predicate
     150      surface_predicate_list.push_back(
     151          new FillPredicate( IsInsideSurface_FillPredicate(
     152              *Tesselation_list.back(),
     153              *LinkedCell_deprecated_list.back()) )
     154      );
     155    }
     156  }
     157
    113158  // create predicate, mesh, and filler
    114159  {
    115     FillPredicate *predicate = new FillPredicate( IsVoidNode_FillPredicate(*s) );
     160    FillPredicate *voidnode_predicate = new FillPredicate( IsVoidNode_FillPredicate(*s) );
     161    FillPredicate Andpredicate = (*voidnode_predicate);
     162    for (predicate_list_t::iterator iter = surface_predicate_list.begin();
     163        iter != surface_predicate_list.end(); ++iter)
     164      Andpredicate = (Andpredicate) && !(**iter);
    116165    Mesh *mesh = new CubeMesh(params.counts, params.offset, World::getInstance().getDomain().getM());
    117     Filler *fillerFunction = new Filler(*mesh, *predicate);
     166    Filler *fillerFunction = new Filler(*mesh, Andpredicate);
    118167
    119168    // fill
     
    124173    delete fillerFunction;
    125174    delete mesh;
    126     delete predicate;
     175    delete voidnode_predicate;
     176    for (LC_list_t::iterator iter = LinkedCell_deprecated_list.begin();
     177            iter != LinkedCell_deprecated_list.end(); ++iter)
     178      delete (*iter);
     179    LinkedCell_deprecated_list.clear();
     180    for (Tesselation_list_t::iterator iter = Tesselation_list.begin();
     181            iter != Tesselation_list.end(); ++iter)
     182      delete (*iter);
     183    Tesselation_list.clear();
    127184    delete s;
    128185  }
  • src/Actions/FillAction/FillRegularGridAction.def

    r5a4cbc r345eda  
    1212// ValueStorage by the token "Z" -> first column: int, Z, "Z"
    1313// "undefine" if no parameters are required, use (NODEFAULT) for each (undefined) default value
    14 #define paramtypes (Vector)(Vector)(double)
    15 #define paramtokens ("mesh-size")("mesh-offset")("min-distance")
    16 #define paramdescriptions ("number of points per axis")("offset to start of partition, must be in [0,1)")("Minimum distance to other atoms")
    17 #define paramdefaults (NODEFAULT)("0.,0.,0.")("1.")
    18 #define paramreferences (counts)(offset)(mindistance)
     14#define paramtypes (Vector)(Vector)(double)(double)
     15#define paramtokens ("mesh-size")("mesh-offset")("min-distance")("tesselation-radius")
     16#define paramdescriptions ("number of points per axis")("offset to start of partition, must be in [0,1)")("Minimum distance to other atoms")("radius of rolling sphere in tesselating selected molecule's surfaces")
     17#define paramdefaults (NODEFAULT)("0.,0.,0.")("1.")("0.")
     18#define paramreferences (counts)(offset)(mindistance)(SphereRadius)
    1919
    2020#define statetypes (std::vector<atom *>)
Note: See TracChangeset for help on using the changeset viewer.