BISICLES AMR ice sheet model  0.9
ComplexSurfaceFlux.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 
12 
13 #ifndef _COMPLEXSURFACEFLUX_H_
14 #define _COMPLEXSURFACEFLUX_H_
15 
16 #include "LevelData.H"
17 #include "FArrayBox.H"
18 #include "SurfaceFlux.H"
19 #include "NamespaceHeader.H"
20 
21 
23 
26 {
27 public:
28 
30 
31  virtual ~fortranInterfaceFlux() {}
32 
33  virtual SurfaceFlux* new_surfaceFlux();
34 
35  virtual void surfaceThicknessFlux(LevelData<FArrayBox>& a_flux,
36  const AmrIceBase& a_amrIce,
37  int a_level, Real a_dt);
38 
40  void setFluxVal(Real* a_data_ptr,
41  const int* a_dimInfo,
42  const int* a_boxlo, const int* a_boxhi,
43  const Real* a_dew, const Real* a_dns,
44  const IntVect& a_offset,
45  const IntVect& a_nGhost,
46  const ProblemDomain& a_domain,
47  const bool a_nodal);
48 
49 
51  bool gridsSet() const {return m_gridsSet;}
52 
53 
54 protected:
55  IntVect m_fluxGhost;
56  bool m_verbose;
57 
58  ProblemDomain m_domain;
59  DisjointBoxLayout m_grids;
60  bool m_gridsSet;
61 
62  // input flux from CISM
63  // alias to data array passed in from CISM
64  FArrayBox m_inputFlux;
67 
69 
74  FArrayBox m_ccInputFlux;
75 
76  RealVect m_inputFluxDx;
77 
79  RefCountedPtr<LevelData<FArrayBox> > m_inputFluxLDF;
80 
81  bool m_isValSet;
82 
83 private:
84  // Disallowed for all the usual reasons
85  void operator=(const fortranInterfaceFlux& a_input)
86  {
87  MayDay::Error("invalid operator");
88  }
89 
90  // Disallowed for all the usual reasons
92  {
93  MayDay::Error("invalid operator");
94  }
95 };
96 
98 
109 {
110 
111 public:
112 
113  ProductSurfaceFlux(SurfaceFlux* a_Flux1, SurfaceFlux* a_flux2);
114 
115  virtual ~ProductSurfaceFlux();
116 
117  virtual SurfaceFlux* new_surfaceFlux();
118 
119  virtual void surfaceThicknessFlux(LevelData<FArrayBox>& a_flux,
120  const AmrIceBase& a_amrIce,
121  int a_level, Real a_dt);
122 
123 
124 protected:
127 
128 
129 private:
130  // Disallowed for all the usual reasons
131  void operator=(const ProductSurfaceFlux& a_input)
132  {
133  MayDay::Error("invalid operator");
134  }
135 
136  // Disallowed for all the usual reasons
137  ProductSurfaceFlux(const ProductSurfaceFlux& a_input)
138  {
139  MayDay::Error("invalid operator");
140  }
141 
143  {
144  MayDay::Error("invalid operator");
145  }
146 
147 };
148 
150 
163 class MaskedFlux : public SurfaceFlux
164 {
165 
166 public:
168 
174  MaskedFlux(SurfaceFlux* a_groundedIceFlux, SurfaceFlux* a_floatingIceFlux,
175  SurfaceFlux* a_openSeaFlux, SurfaceFlux* a_openLandFlux);
176 
177  virtual ~MaskedFlux(){};
178 
179  virtual SurfaceFlux* new_surfaceFlux();
180 
181  virtual void surfaceThicknessFlux(LevelData<FArrayBox>& a_flux,
182  const AmrIceBase& a_amrIce,
183  int a_level, Real a_dt);
184 
185 
186 protected:
191 
192 private:
193  // Disallowed for all the usual reasons
194  void operator=(const MaskedFlux& a_input)
195  {
196  MayDay::Error("invalid operator");
197  }
198 
199  // Disallowed for all the usual reasons
200  MaskedFlux(const MaskedFlux& a_input)
201  {
202  MayDay::Error("invalid operator");
203  }
204 
205  MaskedFlux()
206  {
207  MayDay::Error("invalid operator");
208  }
209 
210 };
211 
212 
214 
226 {
227  RealVect m_lo,m_hi;
228  Real m_startTime, m_endTime;
229  SurfaceFlux* m_fluxPtr;
230 public:
232 (const RealVect& a_lo,
233  const RealVect& a_hi,
234  const Real& a_startTime,
235  const Real& a_endTime,
236  SurfaceFlux* a_fluxPtr)
237  : m_lo(a_lo),m_hi(a_hi),m_startTime(a_startTime),m_endTime(a_endTime)
238  {
239  m_fluxPtr = a_fluxPtr->new_surfaceFlux();
240  if (!(m_hi > m_lo))
241  {
242  pout() << "!(m_hi > m_lo), m_lo = " << m_lo << " m_hi = " << m_hi << endl;
243  CH_assert( (m_hi > m_lo) );
244  MayDay::Error("BoxBoundedFlux:: !(m_hi > m_lo)");
245  }
246  }
247 
248 
250  virtual ~BoxBoundedFlux(){};
251 
252  virtual SurfaceFlux* new_surfaceFlux();
253 
254  virtual void surfaceThicknessFlux(LevelData<FArrayBox>& a_flux,
255  const AmrIceBase& a_amrIce,
256  int a_level, Real a_dt);
257 
258 private:
259  // Disallowed for all the usual reasons
260  void operator=(const BoxBoundedFlux& a_input)
261  {
262  MayDay::Error("invalid operator");
263  }
264 
265  // Disallowed for all the usual reasons
266  BoxBoundedFlux(const BoxBoundedFlux& a_input)
267  {
268  MayDay::Error("invalid operator");
269  }
270 
272  {
273  MayDay::Error("invalid operator");
274  }
275 
276 };
277 
279 
290 class AxbyFlux : public SurfaceFlux
291 {
292  SurfaceFlux* m_x;
293  SurfaceFlux* m_y;
294  Real m_a,m_b;
295 
296 public:
298 
304  AxbyFlux(const Real& a_a, SurfaceFlux* a_x,
305  const Real& a_b, SurfaceFlux* a_y);
306 
307  virtual ~AxbyFlux();
308 
309  virtual SurfaceFlux* new_surfaceFlux();
310 
311  virtual void surfaceThicknessFlux(LevelData<FArrayBox>& a_flux,
312  const AmrIceBase& a_amrIce,
313  int a_level, Real a_dt);
314 
315 private:
316 
317  // Disallowed for all the usual reasons
318  void operator=(const AxbyFlux& a_input)
319  {
320  MayDay::Error("invalid operator");
321  }
322 
323  // Disallowed for all the usual reasons
324  AxbyFlux(const AxbyFlux& a_input)
325  {
326  MayDay::Error("invalid operator");
327  }
328 
329  AxbyFlux()
330  {
331  MayDay::Error("invalid operator");
332  }
333 
334 };
335 
336 
338 
349 {
350 
351  Vector<SurfaceFlux*> m_fluxes;
352 
353 public:
354  CompositeFlux(const Vector<SurfaceFlux*>& a_fluxes);
355 
356  virtual ~CompositeFlux();
357 
358  virtual SurfaceFlux* new_surfaceFlux();
359 
360  virtual void surfaceThicknessFlux(LevelData<FArrayBox>& a_flux,
361  const AmrIceBase& a_amrIce,
362  int a_level, Real a_dt);
363 
364 private:
365  // Disallowed for all the usual reasons
366  void operator=(const CompositeFlux& a_input)
367  {
368  MayDay::Error("invalid operator");
369  }
370 
371  // Disallowed for all the usual reasons
372  CompositeFlux(const CompositeFlux& a_input)
373  {
374  MayDay::Error("invalid operator");
375  }
376 
377  CompositeFlux()
378  {
379  MayDay::Error("invalid operator");
380  }
381 
382 
383 };
384 
386 
409 {
410 public:
412 
417  PiecewiseLinearFlux(const Vector<Real>& a_abscissae,
418  const Vector<Real>& a_ordinates,
419  const Real a_minWaterDepth = -1.0);
420 
422 
423  virtual SurfaceFlux* new_surfaceFlux();
424 
425  virtual void surfaceThicknessFlux(LevelData<FArrayBox>& a_flux,
426  const AmrIceBase& a_amrIce,
427  int a_level, Real a_dt);
428 
429 
430 protected:
431  Vector<Real> m_abscissae;
432  Vector<Real> m_ordinates;
434 
435 private:
436  // Disallowed for all the usual reasons
437  void operator=(const PiecewiseLinearFlux& a_input)
438  {
439  MayDay::Error("invalid operator");
440  }
441 
442  // Disallowed for all the usual reasons
444  {
445  MayDay::Error("invalid operator");
446  }
447 
449  {
450  MayDay::Error("invalid operator");
451  }
452 
453 };
454 
455 
457 
470 {
471 
472  SurfaceFlux* m_direction;
473  Real m_amplitude;
474 
475 public:
477 
481  NormalizedFlux(SurfaceFlux* a_direction, const Real& a_amplitude);
482 
483  virtual ~NormalizedFlux();
484 
485  virtual SurfaceFlux* new_surfaceFlux();
486 
487  virtual void surfaceThicknessFlux(LevelData<FArrayBox>& a_flux,
488  const AmrIceBase& a_amrIce,
489  int a_level, Real a_dt);
490 
491 
492 private:
493  // Disallowed for all the usual reasons
494  void operator=(const NormalizedFlux& a_input)
495  {
496  MayDay::Error("invalid operator");
497  }
498 
499  // Disallowed for all the usual reasons
500  NormalizedFlux(const NormalizedFlux& a_input)
501  {
502  MayDay::Error("invalid operator");
503  }
504 
506  {
507  MayDay::Error("invalid operator");
508  }
509 
510 
511 };
512 
514 
515 
517 
551 class FloatingDivUHLocalizedFlux : public SurfaceFlux
552 {
553 
554  SurfaceFlux* m_flux;
555  Real m_mesh_spacing;
556 
557 public:
559 
563  FloatingDivUHLocalizedFlux(SurfaceFlux* a_flux, const Real& a_mesh_spacing);
564 
565  virtual ~FloatingDivUHLocalizedFlux();
566 
567  virtual SurfaceFlux* new_surfaceFlux();
568 
569  virtual void surfaceThicknessFlux(LevelData<FArrayBox>& a_flux,
570  const AmrIceBase& a_amrIce,
571  int a_level, Real a_dt);
572 
573 
574 private:
575  // Disallowed for all the usual reasons
576  void operator=(const FloatingDivUHLocalizedFlux& a_input)
577  {
578  MayDay::Error("invalid operator");
579  }
580 
581  // Disallowed for all the usual reasons
582  FloatingDivUHLocalizedFlux(const FloatingDivUHLocalizedFlux& a_input)
583  {
584  MayDay::Error("invalid operator");
585  }
586 
587  FloatingDivUHLocalizedFlux()
588  {
589  MayDay::Error("invalid operator");
590  }
591 
592 
593 };
594 
595 
596 
598 
610 class TargetThicknessFlux : public SurfaceFlux
611 {
612 
613  SurfaceFlux* m_target;
614  Real m_timescale;
615 
616 public:
618 
622  TargetThicknessFlux(SurfaceFlux* a_target, const Real& a_timescale);
623 
624  virtual ~TargetThicknessFlux();
625 
626  virtual SurfaceFlux* new_surfaceFlux();
627 
628  virtual void surfaceThicknessFlux(LevelData<FArrayBox>& a_flux,
629  const AmrIceBase& a_amrIce,
630  int a_level, Real a_dt);
631 
632 
633 private:
634  // Disallowed for all the usual reasons
635  void operator=(const TargetThicknessFlux& a_input)
636  {
637  MayDay::Error("invalid operator");
638  }
639 
640  // Disallowed for all the usual reasons
641  TargetThicknessFlux(const TargetThicknessFlux& a_input)
642  {
643  MayDay::Error("invalid operator");
644  }
645 
646  TargetThicknessFlux()
647  {
648  MayDay::Error("invalid operator");
649  }
650 
651 
652 };
653 
654 
655 #include "NamespaceFooter.H"
656 #endif // multiple-include preventer
657 
RefCountedPtr< LevelData< FArrayBox > > m_inputFluxLDF
distributed version of flux
Definition: ComplexSurfaceFlux.H:79
Applies a flux inside a box and (optionally inside a time interval) and zero outside.
Definition: ComplexSurfaceFlux.H:225
class which multiplies two surface fluxes together
Definition: ComplexSurfaceFlux.H:108
FArrayBox m_inputFlux
Definition: ComplexSurfaceFlux.H:64
Provide the flux a*x + b*y, where x,y are fluxes and a,b are scalars.
Definition: ComplexSurfaceFlux.H:290
IntVect m_fluxGhost
Definition: ComplexSurfaceFlux.H:55
~PiecewiseLinearFlux()
Definition: ComplexSurfaceFlux.H:421
virtual ~fortranInterfaceFlux()
Definition: ComplexSurfaceFlux.H:31
virtual SurfaceFlux * new_surfaceFlux()
factory method
Definition: ComplexSurfaceFlux.cpp:311
virtual ~MaskedFlux()
Definition: ComplexSurfaceFlux.H:177
class which takes an input fortran array
Definition: ComplexSurfaceFlux.H:25
fortranInterfaceFlux()
class which takes an input fortran array
Definition: ComplexSurfaceFlux.cpp:302
ProblemDomain m_domain
Definition: ComplexSurfaceFlux.H:58
Applies a different surface flux depending on the mask.
Definition: ComplexSurfaceFlux.H:163
SurfaceFlux * m_groundedIceFlux
Definition: ComplexSurfaceFlux.H:187
virtual void surfaceThicknessFlux(LevelData< FArrayBox > &a_flux, const AmrIceBase &a_amrIce, int a_level, Real a_dt)
define source term for thickness evolution and place it in flux
Definition: ComplexSurfaceFlux.cpp:356
DisjointBoxLayout m_grids
Definition: ComplexSurfaceFlux.H:59
SurfaceFlux * m_floatingIceFlux
Definition: ComplexSurfaceFlux.H:188
SurfaceFlux * m_openSeaFlux
Definition: ComplexSurfaceFlux.H:189
Adds together a list of fluxes.
Definition: ComplexSurfaceFlux.H:348
abstract class defining the surface flux interface
Definition: SurfaceFlux.H:39
SurfaceFlux * m_openLandFlux
Definition: ComplexSurfaceFlux.H:190
Real m_minWaterDepth
Definition: ComplexSurfaceFlux.H:433
virtual SurfaceFlux * new_surfaceFlux()=0
factory method: return a pointer to a new SurfaceFlux object
bool m_verbose
Definition: ComplexSurfaceFlux.H:56
SurfaceFlux * m_flux1
Definition: ComplexSurfaceFlux.H:125
RealVect m_inputFluxDx
Definition: ComplexSurfaceFlux.H:76
SurfaceFlux * m_flux2
Definition: ComplexSurfaceFlux.H:126
FArrayBox m_ccInputFlux
cell-centered input flux
Definition: ComplexSurfaceFlux.H:74
NormalizedFlux NormalizedData
Definition: ComplexSurfaceFlux.H:513
Vector< Real > m_abscissae
Definition: ComplexSurfaceFlux.H:431
bool m_gridsSet
Definition: ComplexSurfaceFlux.H:60
abstract base class for amr ice sheet models (AmrIce, AMRIceControl)
Definition: AmrIceBase.H:21
SurfaceFlux which has a piecewise linear dependence on ice thickness.
Definition: ComplexSurfaceFlux.H:408
virtual ~BoxBoundedFlux()
destructor
Definition: ComplexSurfaceFlux.H:250
Normalizes any flux so that the integrated flux has a specified value.
Definition: ComplexSurfaceFlux.H:469
Vector< Real > m_ordinates
Definition: ComplexSurfaceFlux.H:432
bool m_isValSet
Definition: ComplexSurfaceFlux.H:81
bool m_nodalFlux
true if inputFlux is nodeal
Definition: ComplexSurfaceFlux.H:66
bool gridsSet() const
has setGrids been called?
Definition: ComplexSurfaceFlux.H:51
void setFluxVal(Real *a_data_ptr, const int *a_dimInfo, const int *a_boxlo, const int *a_boxhi, const Real *a_dew, const Real *a_dns, const IntVect &a_offset, const IntVect &a_nGhost, const ProblemDomain &a_domain, const bool a_nodal)
set fortran array-valued surface flux
Definition: ComplexSurfaceFlux.cpp:400