00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef FIELD_SPEC_H
00012 #define FIELD_SPEC_H
00013
00014
00015 template< unsigned Dim, class T > class UniformCartesian;
00016 template< class T, unsigned Dim , class M, class C > class BConds;
00017 template< unsigned Dim > class GuardCellSizes;
00018 template< unsigned Dim > class FieldLayout;
00019
00020
00021
00022
00023
00024
00025 template<class T, unsigned Dim,
00026 class M=UniformCartesian<Dim,double>,class C= typename M::DefaultCentering>
00027 class FieldSpec
00028 {
00029 public:
00030
00031
00032
00033
00034 FieldSpec(const FieldLayout<Dim>& layout) : Layout(layout) { };
00035
00036 FieldSpec(const FieldLayout<Dim>& layout,
00037 const BConds<T,Dim,M,C>& bc,
00038 const GuardCellSizes<Dim>& gc) :
00039 Layout(layout), BC(bc), GC(gc) { };
00040
00041 FieldSpec(const FieldLayout<Dim>& layout,
00042 const GuardCellSizes<Dim>& gc,
00043 const BConds<T,Dim,M,C>& bc) :
00044 Layout(layout), BC(bc), GC(gc) { };
00045
00046 FieldSpec(const FieldSpec<T,Dim,M,C>& rhs ) :
00047 Layout(rhs.get_Layout()), BC(rhs.get_BC()), GC(rhs.get_GC() ) { };
00048
00049 ~FieldSpec(void) { };
00050
00051 const FieldLayout<Dim>& get_Layout(void) const { return Layout; }
00052 BConds<T,Dim,M,C> get_BC(void) const { return BC; }
00053 GuardCellSizes<Dim> get_GC(void) const { return GC; }
00054 void set_BC(const BConds<T,Dim,M,C>& bc) { BC = bc; }
00055 void set_GC(const GuardCellSizes<Dim>& gc) { GC = gc; }
00056
00057 FieldSpec<T,Dim,M,C>& operator=(const FieldSpec<T,Dim,M,C>& rhs) {
00058 BC = rhs.get_BC();
00059 GC = rhs.get_GC();
00060 if( &Layout != &(rhs.get_Layout()) ) {
00061 ERRORMSG("FieldSpec::op= - FieldLayouts must be the same"<<endl);
00062 }
00063 return *this;
00064 }
00065
00066 private:
00067
00068 const FieldLayout<Dim>& Layout;
00069 BConds<T,Dim,M,C> BC;
00070 GuardCellSizes<Dim> GC;
00071
00072 };
00073
00074 #endif // FIELD_SPEC_H
00075
00076
00077
00078
00079
00080