FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
base.hpp
1// FEAT3: Finite Element Analysis Toolbox, Version 3
2// Copyright (C) 2010 by Stefan Turek & the FEAT group
3// FEAT3 is released under the GNU General Public License version 3,
4// see the file 'copyright.txt' in the top level directory for details.
5
6#pragma once
8#include <kernel/util/string.hpp>
9#include <iostream>
10
11namespace FEAT
12{
13 namespace Control
14 {
18 namespace Time
19 {
23 enum class TermHandling
24 {
25 off = 0,
26 expl,
27 impl
28 };
29
31 inline std::ostream& operator<<(std::ostream& os, TermHandling term_handling)
32 {
33 switch(term_handling)
34 {
35 case TermHandling::off:
36 return os << "off";
37 case TermHandling::expl:
38 return os << "expl";
39 case TermHandling::impl:
40 return os << "impl";
41 default:
42 return os << "-unknown-";
43 }
44 }
45
46 inline std::istream& operator>>(std::istream& is, TermHandling& term_handling)
47 {
48 String term_handling_name;
49
50
51 if( (is >> term_handling_name).fail() )
52 {
53 return is;
54 }
55
56 if(term_handling_name == "off")
57 {
58 term_handling = TermHandling::off;
59 }
60 else if(term_handling_name == "expl")
61 {
62 term_handling = TermHandling::expl;
63 }
64 else if(term_handling_name == "impl")
65 {
66 term_handling = TermHandling::impl;
67 }
68 else
69 {
70 is.setstate(std::ios_base::failbit);
71 }
72
73 return is;
74
75 }
76
78 } // namespace Time
79 } // namespace Control
80} // namespace FEAT
FEAT Kernel base header.
TermHandling
For determining if a term is handled explicitly or implicitly.
Definition: base.hpp:24
FEAT namespace.
Definition: adjactor.hpp:12