5#ifndef _MOLECULARDYNAMICS_COUPLING_CONFIGURATIONS_MOMENTUMINSERTIONCONFIGURATION_H_
6#define _MOLECULARDYNAMICS_COUPLING_CONFIGURATIONS_MOMENTUMINSERTIONCONFIGURATION_H_
8#include "coupling/AdditiveMomentumInsertion.h"
9#include "coupling/NieVelocityImposition.h"
10#include "coupling/NoMomentumInsertion.h"
11#include "coupling/SetGivenVelocity4MomentumInsertion.h"
12#include "coupling/VelocityGradientRelaxation.h"
13#include "tarch/configuration/Configuration.h"
14#include "tarch/configuration/ParseConfiguration.h"
15#include "tarch/la/Vector.h"
19namespace configurations {
34 friend class ::NieTest;
60 if (value ==
"additive-momentum-insertion") {
62 }
else if (value ==
"direct-velocity-insertion") {
64 }
else if (value ==
"velocity-gradient-relaxation") {
66 }
else if (value ==
"none") {
68 }
else if (value ==
"velocity-gradient-relaxation-top-only") {
70 }
else if (value ==
"nie-velocity-imposition") {
73 std::cout <<
"ERROR coupling::MomentumInsertionConfiguration: Wrong "
82 if ((_velocityRelaxationFactor <= 0.0) || (_velocityRelaxationFactor > 1.0)) {
83 std::cout <<
"ERROR coupling::MomentumInsertionConfiguration: "
84 "velocity-relaxation-factor="
85 << _velocityRelaxationFactor <<
"!";
86 std::cout <<
" It must be in the range (0.0,1.0]!" << std::endl;
92 if ((_velocityRelaxationFactor <= 0.0) || (_velocityRelaxationFactor > 1.0)) {
93 std::cout <<
"ERROR coupling::MomentumInsertionConfiguration: "
94 "velocity-relaxation-factor="
95 << _velocityRelaxationFactor <<
"!";
96 std::cout <<
" It must be in the range (0.0,1.0]!" << std::endl;
104 std::cout <<
"ERROR coupling::MomentumInsertionConfiguration: "
105 "innermost-overlap-layer="
106 << buf <<
"!" << std::endl;
110 _innerOverlap = (
unsigned int)buf;
112 if (((
unsigned int)buf > _innerOverlap) || (buf <= 0)) {
113 std::cout <<
"ERROR coupling::MomentumInsertionConfiguration: "
114 "outermost-overlap-layer="
115 << buf <<
"!" << std::endl;
119 _outerOverlap = (
unsigned int)buf;
126 std::string
getTag()
const {
return "momentum-insertion"; }
156 template <
class LinkedCell,
unsigned int dim>
159 unsigned int numberMDTimestepsPerCouplingCycle)
const {
181 double _velocityRelaxationFactor;
182 unsigned int _innerOverlap;
184 unsigned int _outerOverlap;
used to manipulate the momentum/velocity of the molecules contained in a coupling cell.
Definition AdditiveMomentumInsertion.h:30
used to manipulate the momentum/ velocity of the molecules contained in a coupling cell.
Definition MomentumInsertion.h:23
Velocity imposition scheme following the respective paper by Nie et al., J. Fluid....
Definition NieVelocityImposition.h:25
dummy class. Empty momentum insertion mechanism. Doesn't change anything.
Definition NoMomentumInsertion.h:21
Definition SetGivenVelocity4MomentumInsertion.h:25
carries out velocity relaxation (similar to the SetMomentumMapping procedure).
Definition VelocityGradientRelaxation.h:106
carries out velocity relaxation (similar to the SetMomentumMapping procedure).
Definition VelocityGradientRelaxation.h:37
momentum insertion configuration. friend class: NieTest
Definition MomentumInsertionConfiguration.h:31
bool isValid() const
Definition MomentumInsertionConfiguration.h:136
unsigned int getInnerOverlap() const
Definition MomentumInsertionConfiguration.h:146
void parseSubtag(tinyxml2::XMLElement *node)
Definition MomentumInsertionConfiguration.h:57
std::string getTag() const
Definition MomentumInsertionConfiguration.h:126
virtual ~MomentumInsertionConfiguration()
Definition MomentumInsertionConfiguration.h:52
MomentumInsertionType
Definition MomentumInsertionConfiguration.h:39
@ DIRECT_VELOCITY_INSERTION
Definition MomentumInsertionConfiguration.h:41
@ VELOCITY_GRADIENT_RELAXATION_TOPONLY
Definition MomentumInsertionConfiguration.h:44
@ VELOCITY_GRADIENT_RELAXATION
Definition MomentumInsertionConfiguration.h:42
@ ADDITIVE_MOMENTUM_INSERTION
Definition MomentumInsertionConfiguration.h:40
@ NIE_VELOCITY_IMPOSITION
Definition MomentumInsertionConfiguration.h:45
@ NO_INSERTION
Definition MomentumInsertionConfiguration.h:43
const MomentumInsertionType & getMomentumInsertionType() const
Definition MomentumInsertionConfiguration.h:141
MomentumInsertionConfiguration()
Definition MomentumInsertionConfiguration.h:49
MomentumInsertion< LinkedCell, dim > * interpreteConfiguration(coupling::interface::MDSolverInterface< LinkedCell, dim > *const mdSolverInterface, const coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > *const couplingCells, unsigned int numberMDTimestepsPerCouplingCycle) const
Definition MomentumInsertionConfiguration.h:157
defines the cell type with cell-averaged quantities. Derived from the class coupling::datastructures:...
Definition CouplingCellWithLinkedCells.h:26
interface to the MD simulation
Definition MDSolverInterface.h:25
Definition Configuration.h:22
static void readStringMandatory(std::string &storage, tinyxml2::XMLElement *node, std::string tag)
Definition ParseConfiguration.h:201
static void readIntMandatory(int &storage, tinyxml2::XMLElement *node, std::string tag)
Definition ParseConfiguration.h:115
static void readDoubleMandatory(double &storage, tinyxml2::XMLElement *node, std::string tag)
Definition ParseConfiguration.h:79
Definition tinyxml2.h:1268
everything necessary for coupling operations, is defined in here
Definition AdditiveMomentumInsertion.h:15