MaMiCo
1.2
Toggle main menu visibility
Loading...
Searching...
No Matches
coupling
configurations
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
14
namespace
coupling
{
15
namespace
configurations {
16
class
ThermostatConfiguration
;
17
}
18
}
// namespace coupling
19
23
class
coupling::configurations::ThermostatConfiguration
:
public
tarch::configuration::Configuration
{
24
public
:
25
enum
ThermostatRegion { onlyOutestLayer, outerLayers, all, nowhere, none };
26
ThermostatConfiguration() : _type{none}, _isValid(
true
) {}
27
28
virtual
~ThermostatConfiguration() {}
29
30
void
parseSubtag
(
tinyxml2::XMLElement
* node) {
31
std::string value;
32
tarch::configuration::ParseConfiguration::readStringMandatory
(value, node,
"type"
);
33
if
(value ==
"onlyOutestLayer"
) {
34
_type = onlyOutestLayer;
35
}
else
if
(value ==
"outerLayers"
) {
36
_type = outerLayers;
37
tarch::configuration::ParseConfiguration::readIntMandatory
(_cells, node,
"number-layers"
);
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
76
protected
:
77
ThermostatConfiguration(ThermostatRegion type) : _type{type}, _isValid(true) {}
78
79
private
:
80
ThermostatRegion _type;
81
int
_cells{0};
82
bool
_isValid;
83
};
84
85
#endif
// _MOLECULARDYNAMICS_COUPLING_CONFIGURATIONS_THERMOSTATCONFIGURATION_H_
coupling::configurations::ThermostatConfiguration
Definition
ThermostatConfiguration.h:23
coupling::configurations::ThermostatConfiguration::getTag
std::string getTag() const
Definition
ThermostatConfiguration.h:57
coupling::configurations::ThermostatConfiguration::isValid
bool isValid() const
Definition
ThermostatConfiguration.h:70
coupling::configurations::ThermostatConfiguration::parseSubtag
void parseSubtag(tinyxml2::XMLElement *node)
Definition
ThermostatConfiguration.h:30
tarch::configuration::Configuration
Definition
Configuration.h:22
tarch::configuration::ParseConfiguration::readStringMandatory
static void readStringMandatory(std::string &storage, tinyxml2::XMLElement *node, std::string tag)
Definition
ParseConfiguration.h:201
tarch::configuration::ParseConfiguration::readIntMandatory
static void readIntMandatory(int &storage, tinyxml2::XMLElement *node, std::string tag)
Definition
ParseConfiguration.h:115
tinyxml2::XMLElement
Definition
tinyxml2.h:1124
coupling
everything necessary for coupling operations, is defined in here
Definition
AdditiveMomentumInsertion.h:15
Generated by
1.17.0