Changeset 26062f


Ignore:
Timestamp:
Apr 23, 2021, 8:31:23 PM (5 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.0, Candidate_v1.7.1, stable
Children:
cbbb6a
Parents:
b56827
git-author:
Frederik Heber <frederik.heber@…> (04/22/19 23:01:18)
git-committer:
Frederik Heber <frederik.heber@…> (04/23/21 20:31:23)
Message:

StoreSaturatedFragmentAction may now export to FragmentQueue as well.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • doc/userguide/userguide.xml

    rb56827 r26062f  
    20832083          where all dangling bonds (by atoms that are connected in the bond
    20842084          graph but have not been selected as well) are saturated with
    2085           additional hydrogen atoms. The output formats are set to just xyz.
    2086           </para>
     2085          additional hydrogen atoms.</para>
     2086          <para>This can work two ways: Either the saturated fragment is
     2087          written to file. If not "output-types" is given, then the fragment
     2088          will instead be written to the FragmentQueue. In other words, its
     2089          energy is calculated when <link linkend="fragmentation.fragment-automation">fragment automation</link> is used.</para>
    20872090          <programlisting>
    20882091  ... --store-saturated-fragment \
    20892092      --DoSaturate 1 \
    20902093      --output-types xyz
     2094          </programlisting>
     2095          <para>Alternatively, use the following to store in fragment job
     2096          queue.</para>
     2097          <programlisting>
     2098  ... --store-saturated-fragment \
     2099      --DoSaturate 1 \
     2100      --grid-level 6
     2101      --max_meshwidth 0.3
    20912102       </programlisting>
    20922103        </section>
  • src/Actions/FragmentationAction/StoreSaturatedFragmentAction.cpp

    rb56827 r26062f  
    33 * Description: creates and alters molecular systems
    44 * Copyright (C)  2013 University of Bonn. All rights reserved.
    5  * Copyright (C)  2013 Frederik Heber. All rights reserved.
     5 * Copyright (C)  2013-2019 Frederik Heber. All rights reserved.
    66 *
    77 *
     
    3939#include "CodePatterns/Log.hpp"
    4040#include "Fragmentation/Exporters/ExportGraph_ToFiles.hpp"
     41#include "Fragmentation/Exporters/ExportGraph_ToJobs.hpp"
    4142#include "Fragmentation/Exporters/SaturatedFragment.hpp"
    4243#include "Fragmentation/Graph.hpp"
     
    8283
    8384    const enum HydrogenSaturation saturation =  params.DoSaturation.get() ? DoSaturate : DontSaturate;
    84     ExportGraph_ToFiles exporter(TotalGraph, IncludeHydrogen, saturation, globalsaturationpositions);
    85     exporter.setPrefix(params.prefix.get());
    86     exporter.setOutputTypes(params.types.get());
    87     exporter();
     85    if (params.types.get().size() != 0) {
     86      // store molecule's fragment to file
     87      ExportGraph_ToFiles exporter(TotalGraph, IncludeHydrogen, saturation, globalsaturationpositions);
     88      exporter.setPrefix(params.prefix.get());
     89      exporter.setOutputTypes(params.types.get());
     90      if (!exporter())
     91        return Action::failure;
     92    } else {
     93      // store molecule's fragment in FragmentJobQueue
     94      ExportGraph_ToJobs exporter(TotalGraph, IncludeHydrogen, saturation, globalsaturationpositions);
     95      exporter.setLevel(params.level.get());
     96      exporter.setMaximumMeshWidth(params.max_meshwidth.get());
     97      if (!exporter())
     98        return Action::failure;
     99    }
    88100  }
    89101
  • src/Actions/FragmentationAction/StoreSaturatedFragmentAction.def

    rb56827 r26062f  
    1111
    1212#include "Parameters/Validators/DummyValidator.hpp"
     13#include "Parameters/Validators/RangeValidator.hpp"
    1314#include "Parameters/Validators/STLVectorValidator.hpp"
     15#include "Parameters/Validators/Specific/BoxLengthValidator.hpp"
    1416#include "Parameters/Validators/Specific/ParserTypeValidator.hpp"
    1517
     
    1719// ValueStorage by the token "Z" -> first column: int, Z, "Z"
    1820// "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
    19 #define paramtypes (std::string)(bool)(std::vector<std::string>)
    20 #define paramtokens ("store-saturated-fragment")("DoSaturate")("output-types")
    21 #define paramdescriptions ("name of fragment file")("do saturate dangling bonds with hydrogen")("type(s) of parsers that output fragment config files")
    22 #define paramdefaults (NOPARAM_DEFAULT)(PARAM_DEFAULT(true))(PARAM_DEFAULT(std::vector<std::string>()))
    23 #define paramreferences (prefix)(DoSaturation)(types)
     21#define paramtypes (std::string)(bool)(std::vector<std::string>)(double)(unsigned int)
     22#define paramtokens ("store-saturated-fragment")("DoSaturate")("output-types")("max-meshwidth")("grid-level")
     23#define paramdescriptions ("name of fragment file")("do saturate dangling bonds with hydrogen")("type(s) of parsers that output fragment config files")("maximum allowed mesh width, i.e. discrete points may be at most that far apart on the fragment grids")("resolution of density sampling multigrid")
     24#define paramdefaults (NOPARAM_DEFAULT)(PARAM_DEFAULT(true))(PARAM_DEFAULT(std::vector<std::string>()))(PARAM_DEFAULT(0.))(PARAM_DEFAULT(5))
     25#define paramreferences (prefix)(DoSaturation)(types)(max_meshwidth)(level)
    2426#define paramvalids \
    2527(DummyValidator< std::string >()) \
    2628(DummyValidator< bool >()) \
    27 (STLVectorValidator< std::vector<std::string> >(1, 10, ParserTypeValidator()))
     29(STLVectorValidator< std::vector<std::string> >(0, 10, ParserTypeValidator())) \
     30(BoxLengthValidator()) \
     31(RangeValidator< unsigned int >(1, 10))
    2832
    2933#undef statetypes
Note: See TracChangeset for help on using the changeset viewer.