BISICLES AMR ice sheet model  0.9
LevelDataBasalFriction.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3 * _______ __
4 * / ___/ / ___ __ _ / / ___
5 * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6 * \___/_//_/\___/_/_/_/_.__/\___/
7 * Please refer to Copyright.txt, in Chombo's root directory.
8 */
9 #endif
10 
11 // coefficient of basal friction stored in a LevelData
12 #ifndef _LEVELDATABASALFRICTION_H_
13 #define _LEVELDATABASALFRICTION_H_
14 
15 #include "BasalFriction.H"
16 #include "NamespaceHeader.H"
17 
19 
39 {
40 public:
42 
47  LevelDataBasalFriction(RefCountedPtr<LevelData<FArrayBox> > a_C,
48  const RealVect& a_dx)
49  :m_timeFileMap(NULL),m_startTime(-1.2345678e+300),m_endTime(1.2345678e+300),
50  m_C(a_C),m_endC(a_C),m_dx(a_dx),m_verbose(true),m_name("")
51  {
52  }
53 
55 
60  LevelDataBasalFriction(RefCountedPtr<std::map<Real, std::string> >& a_timeFileMap,
61  const std::string& a_name)
62  :m_timeFileMap(a_timeFileMap),m_startTime(1.2345678e+299),m_endTime(-1.2345678e+299),
63  m_C(new LevelData<FArrayBox>()),m_endC(new LevelData<FArrayBox>())
64  ,m_verbose(true),m_name(a_name)
65  {
66 
67  }
68 
69 
71  {;}
72 
73 
75  {
77  if (m_timeFileMap == NULL)
78  {
79  ptr = new LevelDataBasalFriction(m_C,m_dx);
80  }
81  else
82  {
83  RefCountedPtr<std::map<double, std::basic_string<char> > > r = m_timeFileMap;
84 
85  ptr = new LevelDataBasalFriction(r,m_name);
86  }
87  return static_cast<BasalFriction*>(ptr);
88  }
89 
90  virtual void setBasalFriction(LevelData<FArrayBox>& a_C,
91  LevelSigmaCS& a_coordSys,
92  Real a_time,
93  Real a_dt);
94 
95 
96 protected:
97  RefCountedPtr<std::map<Real,std::string> > m_timeFileMap;
99  RefCountedPtr< LevelData<FArrayBox> > m_C; // C at t = m_startTime
100  RefCountedPtr< LevelData<FArrayBox> > m_endC; // C at t = m_endTime
101  RealVect m_dx;
102  bool m_verbose;
103  std::string m_name;
104 
105 private:
106  void operator=(const LevelDataBasalFriction& a_input)
107  {
108  MayDay::Error("invalid operator");
109  }
110 
112  {
113  MayDay::Error("invalid operator");
114  }
115 
116 };
117 
119 
130 {
131 public:
133 
140  (const Vector<RefCountedPtr<LevelData<FArrayBox> > >&a_C,
141  const RealVect& a_dxCrse, const Vector<int> a_ratio)
142  :m_C(a_C),m_dxCrse(a_dxCrse),m_ratio(a_ratio),m_verbose(true)
143  {
144  }
145 
147  {;}
148 
149 
151  {
152  MultiLevelDataBasalFriction* ptr = new MultiLevelDataBasalFriction(m_C,m_dxCrse,m_ratio);
153  return static_cast<BasalFriction*>(ptr);
154  }
155 
157 
163  void setBasalFriction(LevelData<FArrayBox>& a_C,
164  RealVect a_dx,
165  Real a_time,
166  Real a_dt);
167 
168  virtual void setBasalFriction(LevelData<FArrayBox>& a_C,
169  LevelSigmaCS& a_coordSys,
170  Real a_time,
171  Real a_dt)
172  {
173  setBasalFriction( a_C,a_coordSys.dx(),a_time,a_dt);
174  }
175 
176 
177 protected:
178 
179  Vector<RefCountedPtr< LevelData<FArrayBox> > > m_C;
180  RealVect m_dxCrse;
181  Vector<int> m_ratio;
182  bool m_verbose;
183 
184 private:
185  void operator=(const MultiLevelDataBasalFriction& a_input)
186  {
187  MayDay::Error("invalid operator");
188  }
189 
191  {
192  MayDay::Error("invalid operator");
193  }
194 
195 };
196 
197 #include "NamespaceFooter.H"
198 
199 #endif
RefCountedPtr< std::map< Real, std::string > > m_timeFileMap
Definition: LevelDataBasalFriction.H:97
RealVect m_dx
Definition: LevelDataBasalFriction.H:101
BasalFriction that computes from data on a non-uniform grid.
Definition: LevelDataBasalFriction.H:129
virtual BasalFriction * new_basalFriction() const
factory method
Definition: LevelDataBasalFriction.H:150
bool m_verbose
Definition: LevelDataBasalFriction.H:182
RealVect m_dxCrse
Definition: LevelDataBasalFriction.H:180
std::string m_name
Definition: LevelDataBasalFriction.H:103
Real m_endTime
Definition: LevelDataBasalFriction.H:98
virtual BasalFriction * new_basalFriction() const
factory method
Definition: LevelDataBasalFriction.H:74
bool m_verbose
Definition: LevelDataBasalFriction.H:102
LevelDataBasalFriction(RefCountedPtr< std::map< Real, std::string > > &a_timeFileMap, const std::string &a_name)
construct from a sequence of files
Definition: LevelDataBasalFriction.H:60
Basic Sigma fourth-order coordinate system on an AMR level.
Definition: LevelSigmaCS.H:48
RefCountedPtr< LevelData< FArrayBox > > m_C
Definition: LevelDataBasalFriction.H:99
virtual ~LevelDataBasalFriction()
Definition: LevelDataBasalFriction.H:70
Real m_startTime
Definition: LevelDataBasalFriction.H:98
virtual void setBasalFriction(LevelData< FArrayBox > &a_C, LevelSigmaCS &a_coordSys, Real a_time, Real a_dt)
compute basal friction coefficient beta^2 and place in a_betaSqr
Definition: LevelDataBasalFriction.cpp:20
RefCountedPtr< LevelData< FArrayBox > > m_endC
Definition: LevelDataBasalFriction.H:100
Definition: BasalFriction.H:28
Vector< RefCountedPtr< LevelData< FArrayBox > > > m_C
Definition: LevelDataBasalFriction.H:179
Vector< int > m_ratio
Definition: LevelDataBasalFriction.H:181
LevelDataBasalFriction(RefCountedPtr< LevelData< FArrayBox > > a_C, const RealVect &a_dx)
construct from uniform grid data
Definition: LevelDataBasalFriction.H:47
RealVect dx() const
Definition: LevelSigmaCS.H:97
virtual void setBasalFriction(LevelData< FArrayBox > &a_C, LevelSigmaCS &a_coordSys, Real a_time, Real a_dt)
compute basal friction coefficient beta^2 and place in a_betaSqr
Definition: LevelDataBasalFriction.H:168
virtual ~MultiLevelDataBasalFriction()
Definition: LevelDataBasalFriction.H:146
BasalFriction that computes from data on a uniform grid.
Definition: LevelDataBasalFriction.H:38