MaMiCo 1.2
Loading...
Searching...
No Matches
ThermostatConfiguration.h
1// Copyright (C) 2015 Technische Universitaet Muenchen
2// This file is part of the Mamico project. For conditions of distribution
3// and use, please see the copyright notice in Mamico's main folder, or at
4// www5.in.tum.de/mamico
5#ifndef _MOLECULARDYNAMICS_COUPLING_CONFIGURATIONS_THERMOSTATCONFIGURATION_H_
6#define _MOLECULARDYNAMICS_COUPLING_CONFIGURATIONS_THERMOSTATCONFIGURATION_H_
7
8#include "coupling/paralleltopology/ParallelTopologyFactory.h"
9#include "tarch/configuration/Configuration.h"
10#include "tarch/configuration/ParseConfiguration.h"
11#include "tarch/la/Vector.h"
12#include <iostream>
13
14namespace coupling {
15namespace configurations {
17}
18} // namespace coupling
19
24public:
25 enum ThermostatRegion { onlyOutestLayer, outerLayers, all, nowhere, none };
26 ThermostatConfiguration() : _type{none}, _isValid(true) {}
27
28 virtual ~ThermostatConfiguration() {}
29
31 std::string value;
33 if (value == "onlyOutestLayer") {
34 _type = onlyOutestLayer;
35 } else if (value == "outerLayers") {
36 _type = outerLayers;
38 if (_cells < 0) {
39 std::cout << "ERROR coupling::ThermostatConfiguration: Wrong number of cells to use!" << std::endl;
40 _isValid = false;
41 exit(EXIT_FAILURE);
42 }
43 } else if (value == "all") {
44 _type = all;
45 } else if (value == "nowhere") {
46 _type = nowhere;
47 } else {
48 std::cout << "ERROR coupling::ThermostatConfiguration: Wrong type!" << std::endl;
49 _isValid = false;
50 exit(EXIT_FAILURE);
51 }
52 }
53
57 std::string getTag() const { return "thermostat"; }
58
70 bool isValid() const { return _isValid; }
71
72 ThermostatRegion getThermostatRegionType() const { return _type; }
73
74 unsigned int getCells2Use() const { return _cells; }
75
76protected:
77 ThermostatConfiguration(ThermostatRegion type) : _type{type}, _isValid(true) {}
78
79private:
80 ThermostatRegion _type;
81 int _cells{0};
82 bool _isValid;
83};
84
85#endif // _MOLECULARDYNAMICS_COUPLING_CONFIGURATIONS_THERMOSTATCONFIGURATION_H_
Definition ThermostatConfiguration.h:23
std::string getTag() const
Definition ThermostatConfiguration.h:57
bool isValid() const
Definition ThermostatConfiguration.h:70
void parseSubtag(tinyxml2::XMLElement *node)
Definition ThermostatConfiguration.h:30
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
Definition tinyxml2.h:1268
everything necessary for coupling operations, is defined in here
Definition AdditiveMomentumInsertion.h:15