OpenMEEG
Loading...
Searching...
No Matches
PropertiesSpecialized.h
Go to the documentation of this file.
1// Project Name: OpenMEEG (http://openmeeg.github.io)
2// © INRIA and ENPC under the French open source license CeCILL-B.
3// See full copyright notice in the file LICENSE.txt
4// If you make a copy of this file, you must either:
5// - provide also LICENSE.txt and modify this header to refer to it.
6// - replace this header by the LICENSE.txt content.
7
8#pragma once
9
10#include "Properties.H"
11#include "DataTag.H"
12
13namespace OpenMEEG {
14
15 template <typename REP=double>
16 class OPENMEEG_EXPORT Conductivity {
17 public:
18
19 Conductivity(): conductivity(1.0) { }
20
21 REP& sigma() { return conductivity; }
22 REP sigma() const { return conductivity; }
23 private:
24 REP conductivity; // The conductivity of the layer (constant per layer).
25 };
26
27 template <typename REP>
28 inline std::istream& operator>>(std::istream& is,Conductivity<REP>& m) { return is >> m.sigma(); }
29
30 template <typename REP>
31 inline std::ostream& operator<<(std::ostream& os,const Conductivity<REP>& m) { return os << m.sigma(); }
32}
33
34namespace Types {
35 template<>
36 struct DataTrait<Utils::Properties::Named<std::string,OpenMEEG::Conductivity<double> > >{
37 static const char TAG[];
38 };
39 const char DataTrait<Utils::Properties::Named<std::string,OpenMEEG::Conductivity<double> > >::TAG[]= "Conductivities";
40}
std::istream & operator>>(std::istream &is, Conductivity< REP > &m)
std::ostream & operator<<(std::ostream &os, const Conductivity< REP > &m)