diff options
Diffstat (limited to 'Carpet/CarpetLib')
-rw-r--r-- | Carpet/CarpetLib/src/dgdata.cc | 35 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/dgdata.hh | 100 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/dgdh.cc | 50 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/dgdh.hh | 78 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/dggf.cc | 52 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/dggf.hh | 147 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/dggh.cc | 59 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/dggh.hh | 95 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/io.cc | 42 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/io.hh | 57 |
10 files changed, 0 insertions, 715 deletions
diff --git a/Carpet/CarpetLib/src/dgdata.cc b/Carpet/CarpetLib/src/dgdata.cc deleted file mode 100644 index e2be0a86e..000000000 --- a/Carpet/CarpetLib/src/dgdata.cc +++ /dev/null @@ -1,35 +0,0 @@ -/*************************************************************************** - dgdata.cc - description - ------------------- - begin : Wed Jul 19 2000 - copyright : (C) 2000 by Erik Schnetter - email : schnetter@astro.psu.edu - - $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/Attic/dgdata.cc,v 1.2 2002/05/05 22:17:00 schnetter Exp $ - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include <assert.h> - -#include "dgdata.hh" - -using namespace std; - - - -// Constructors -dimgeneric_data::dimgeneric_data () - : _has_storage(false) -{ } - -// Destructors -dimgeneric_data::~dimgeneric_data () { } diff --git a/Carpet/CarpetLib/src/dgdata.hh b/Carpet/CarpetLib/src/dgdata.hh deleted file mode 100644 index 89a1aa26f..000000000 --- a/Carpet/CarpetLib/src/dgdata.hh +++ /dev/null @@ -1,100 +0,0 @@ -/*************************************************************************** - dgdata.hh - description - ------------------- - begin : Wed Jul 19 2000 - copyright : (C) 2000 by Erik Schnetter - email : schnetter@astro.psu.edu - - $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/Attic/dgdata.hh,v 1.2 2002/05/05 22:17:00 schnetter Exp $ - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef DGDATA_HH -#define DGDATA_HH - -#include <assert.h> - -#include <iostream> - -#include "defs.hh" - -using namespace std; - - - -// Forward declaration -class dimgeneric_data; - -// Output -ostream& operator<< (ostream& os, const dimgeneric_data& d); - - - -// A generic data storage without type information -class dimgeneric_data { - -protected: // should be readonly - - // Fields - bool _has_storage; // has storage associated (on some processor) - bool _owns_storage; // owns the storage - int _size; // size - - int _proc; // stored on processor - -public: - - // Constructors - dimgeneric_data (); - - // Destructors - virtual ~dimgeneric_data (); - - // Processor management - virtual void change_processor (const int newproc, void* const mem=0) = 0; - - // Accessors - bool has_storage () const { - return _has_storage; - } - bool owns_storage () const { - assert (_has_storage); - return _owns_storage; - } - - virtual const void* storage () const = 0; - - virtual void* storage () = 0; - - int size () const { - assert (_has_storage); - return _size; - } - - int proc () const { - assert (_has_storage); - return _proc; - } - - // Output - virtual ostream& output (ostream& os) const = 0; -}; - - - -inline ostream& operator<< (ostream& os, const dimgeneric_data& d) { - return d.output(os); -} - - - -#endif // DGDATA_HH diff --git a/Carpet/CarpetLib/src/dgdh.cc b/Carpet/CarpetLib/src/dgdh.cc deleted file mode 100644 index 79dca23a2..000000000 --- a/Carpet/CarpetLib/src/dgdh.cc +++ /dev/null @@ -1,50 +0,0 @@ -/*************************************************************************** - dgdh.cc - Dimension Generic Data Hierarchy - A grid hierarchy plus ghost zones - ------------------- - begin : Sun Jun 11 2000 - copyright : (C) 2000 by Erik Schnetter - email : schnetter@astro.psu.edu - - $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/Attic/dgdh.cc,v 1.4 2002/10/24 11:36:34 schnetter Exp $ - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include <assert.h> - -#include "defs.hh" -#include "dist.hh" -#include "ggf.hh" - -#include "dgdh.hh" - -using namespace std; - - - -// Constructors -dimgeneric_dh::dimgeneric_dh (int prolongation_order_space) - : prolongation_order_space(prolongation_order_space) -{ - assert (prolongation_order_space>=0); -} - -// Destructors -dimgeneric_dh::~dimgeneric_dh () -{ -} - -// Helpers -int dimgeneric_dh::prolongation_stencil_size () const { - assert (prolongation_order_space>=0); - return prolongation_order_space/2; -} diff --git a/Carpet/CarpetLib/src/dgdh.hh b/Carpet/CarpetLib/src/dgdh.hh deleted file mode 100644 index 736e41225..000000000 --- a/Carpet/CarpetLib/src/dgdh.hh +++ /dev/null @@ -1,78 +0,0 @@ -/*************************************************************************** - dgdh.hh - Dimension Generic Data Hierarchy - A grid hierarchy plus ghost zones - ------------------- - begin : Sun Jun 11 2000 - copyright : (C) 2000 by Erik Schnetter - email : schnetter@astro.psu.edu - - $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/Attic/dgdh.hh,v 1.3 2002/05/05 22:17:00 schnetter Exp $ - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef DGDH_HH -#define DGDH_HH - -#include <assert.h> - -#include <iostream> -#include <list> - -#include "defs.hh" - -using namespace std; - - - -// Forward declaration -class dimgeneric_dh; -class dimgeneric_gf; - -// Output -ostream& operator<< (ostream& os, const dimgeneric_dh& d); - - - -// A data hierarchy (grid hierarchy plus ghost zones) -class dimgeneric_dh { - -public: // should be readonly - - // Fields - int prolongation_order_space; // order of spatial prolongation operator - -public: - - // Constructors - dimgeneric_dh (int prolongation_order_space); - - // Destructors - virtual ~dimgeneric_dh (); - - // Helpers - int prolongation_stencil_size () const; - - // Modifiers - virtual void recompose () = 0; - - // Output - virtual void output (ostream& os) const = 0; -}; - -inline ostream& operator<< (ostream& os, const dimgeneric_dh& d) { - d.output(os); - return os; -} - - - -#endif // DGDH_HH diff --git a/Carpet/CarpetLib/src/dggf.cc b/Carpet/CarpetLib/src/dggf.cc deleted file mode 100644 index c41e6a61a..000000000 --- a/Carpet/CarpetLib/src/dggf.cc +++ /dev/null @@ -1,52 +0,0 @@ -/*************************************************************************** - dggf.cc - Dimension Generic Grid Function - grid function without type information - ------------------- - begin : Sun Jun 11 2000 - copyright : (C) 2000 by Erik Schnetter - email : schnetter@astro.psu.edu - - $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/Attic/dggf.cc,v 1.4 2002/09/25 15:49:15 schnetter Exp $ - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include <assert.h> -#include <stdlib.h> - -#include "defs.hh" -#include "th.hh" - -#include "dggf.hh" - -using namespace std; - - - -// Constructors -dimgeneric_gf::dimgeneric_gf (const string name, th& t, - const int tmin, const int tmax, - const int prolongation_order_time) - : name(name), t(t), - tmin(tmin), tmax(tmax), prolongation_order_time(prolongation_order_time) -{ - assert (tmin<=tmax+1); -} - -// Destructors -dimgeneric_gf::~dimgeneric_gf () -{ -} - -// Comparison -bool dimgeneric_gf::operator== (const dimgeneric_gf& f) const { - return this == &f; -} diff --git a/Carpet/CarpetLib/src/dggf.hh b/Carpet/CarpetLib/src/dggf.hh deleted file mode 100644 index 193903f70..000000000 --- a/Carpet/CarpetLib/src/dggf.hh +++ /dev/null @@ -1,147 +0,0 @@ -/*************************************************************************** - dggf.hh - Dimension Generic Grid Function - grid function without type information - ------------------- - begin : Sun Jun 11 2000 - copyright : (C) 2000 by Erik Schnetter - email : schnetter@astro.psu.edu - - $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/Attic/dggf.hh,v 1.5 2002/09/25 15:49:15 schnetter Exp $ - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef DGGF_HH -#define DGGF_HH - -#include <assert.h> - -#include <iostream> -#include <string> - -#include "cctk.h" - -#include "defs.hh" -#include "dgdata.hh" -#include "th.hh" - -using namespace std; - - - -// Forward declaration -class dimgeneric_gf; - -// Output -ostream& operator<< (ostream& os, const dimgeneric_gf& f); - - - -// A generic grid function without type information -class dimgeneric_gf { - -public: // should be readonly - - // Fields - string name; - - th &t; // time hierarchy - int tmin, tmax; // timelevels - int prolongation_order_time; // order of temporal prolongation operator - -public: - - // Constructors - dimgeneric_gf (const string name, th& t, - const int tmin, const int tmax, - const int prolongation_order_time); - - // Destructors - virtual ~dimgeneric_gf (); - - // Comparison - bool operator== (const dimgeneric_gf& f) const; - - - - // Modifiers - virtual void recompose () = 0; - - // Cycle the time levels by rotating the data sets - virtual void cycle (int rl, int c, int ml) = 0; - - - - // TODO: - - // are these necessary in dimgeneric_gf, or is it sufficient to have - // them in generic_gf<D>? - - // do i really want all dims, or do i just want to disregard the z - // dim in carpet? - - // i likely also have to make a dimgeneric_data class. - - // The grid boundaries have to be updated after calling mg_restrict, - // mg_prolongate, ref_restrict, or ref_prolongate. - - // "Updating" means here that the boundaries have to be - // synchronised. They don't need to be prolongated. - - // Copy a component from the next time level - virtual void copy (int tl, int rl, int c, int ml) = 0; - - // Synchronise the boundaries of a component - virtual void sync (int tl, int rl, int c, int ml) = 0; - - // Prolongate the boundaries of a component - virtual void ref_bnd_prolongate (int tl, int rl, int c, int ml, - CCTK_REAL time) = 0; - - // Restrict a multigrid level - virtual void mg_restrict (int tl, int rl, int c, int ml, - CCTK_REAL time) = 0; - - // Prolongate a multigrid level - virtual void mg_prolongate (int tl, int rl, int c, int ml, - CCTK_REAL time) = 0; - - // Restrict a refinement level - virtual void ref_restrict (int tl, int rl, int c, int ml, - CCTK_REAL time) = 0; - - // Prolongate a refinement level - virtual void ref_prolongate (int tl, int rl, int c, int ml, - CCTK_REAL time) = 0; - - - - // Access to the data - virtual const dimgeneric_data* operator() (int tl, int rl, int c, int ml) - const = 0; - - virtual dimgeneric_data* operator() (int tl, int rl, int c, int ml) = 0; - - - - // Output - virtual ostream& output (ostream& os) const = 0; -}; - - - -inline ostream& operator<< (ostream& os, const dimgeneric_gf& f) { - return f.output(os); -} - - - -#endif // DGGF_HH diff --git a/Carpet/CarpetLib/src/dggh.cc b/Carpet/CarpetLib/src/dggh.cc deleted file mode 100644 index f5302a740..000000000 --- a/Carpet/CarpetLib/src/dggh.cc +++ /dev/null @@ -1,59 +0,0 @@ -/*************************************************************************** - dggh.cc - Dimension Generic Grid Hierarchy - bounding boxes for each multigrid level of each - component of each refinement level - ------------------- - begin : Sun Jun 11 2000 - copyright : (C) 2000 by Erik Schnetter - email : schnetter@astro.psu.edu - - $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/Attic/dggh.cc,v 1.2 2002/05/05 22:17:01 schnetter Exp $ - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include <assert.h> -#include <stdlib.h> -#include <iostream> - -#include "defs.hh" -#include "dh.hh" -#include "th.hh" - -#include "dggh.hh" - -using namespace std; - - - - // Constructors -dimgeneric_gh::dimgeneric_gh (const int reffact, const centering refcent, - const int mgfact, const centering mgcent) - : reffact(reffact), refcent(refcent), - mgfact(mgfact), mgcent(mgcent) -{ - assert (reffact>=1); - assert (mgfact>=1); - assert (refcent==vertex_centered || refcent==cell_centered); - assert (mgcent==vertex_centered || mgcent==cell_centered); -} - -// Destructors -dimgeneric_gh::~dimgeneric_gh () { } - -// Time hierarchy management -void dimgeneric_gh::add (th* t) { - ths.push_back(t); -} - -void dimgeneric_gh::remove (th* t) { - ths.remove(t); -} diff --git a/Carpet/CarpetLib/src/dggh.hh b/Carpet/CarpetLib/src/dggh.hh deleted file mode 100644 index 13cf95f48..000000000 --- a/Carpet/CarpetLib/src/dggh.hh +++ /dev/null @@ -1,95 +0,0 @@ -/*************************************************************************** - dggh.hh - Dimension Generic Grid Hierarchy - bounding boxes for each multigrid level of each - component of each refinement level - ------------------- - begin : Sun Jun 10 2001 - copyright : (C) 2001 by Erik Schnetter - email : schnetter@astro.psu.edu - - $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/Attic/dggh.hh,v 1.2 2002/05/05 22:17:01 schnetter Exp $ - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef DGGH_HH -#define DGGH_HH - -#include <assert.h> - -#include <iostream> -#include <list> - -#include "defs.hh" -#include "dist.hh" - -using namespace std; - - - -// Forward declaration -class dimgeneric_dh; -class dimgeneric_gh; -class th; - -// Output -ostream& operator<< (ostream& os, const dimgeneric_gh& h); - - - -// A refinement hierarchy, where higher levels are finer than the base -// level. The extents do not include ghost zones. -class dimgeneric_gh { - -public: // should be readonly - - // Fields - int reffact; // refinement factor - centering refcent; // vertex or cell centered - - int mgfact; // default multigrid factor - centering mgcent; // default (vertex or cell centered) - - list<th*> ths; // list of all time hierarchies - -public: - - // Constructors - dimgeneric_gh (const int reffact, const centering refcent, - const int mgfact, const centering mgcent); - - // Destructors - virtual ~dimgeneric_gh (); - - // Accessors - virtual int reflevels () const = 0; - virtual int components (const int rl) const = 0; - virtual int mglevels (const int rl, const int c) const = 0; - virtual int proc (const int rl, const int c) const = 0; - virtual bool is_local (const int rl, const int c) const = 0; - - // Time hierarchy management - void add (th* t); - void remove (th* t); - - // Output - virtual ostream& output (ostream& os) const = 0; -}; - - - -inline ostream& operator<< (ostream& os, const dimgeneric_gh& h) { - return h.output(os); -} - - - -#endif // DGGH_HH diff --git a/Carpet/CarpetLib/src/io.cc b/Carpet/CarpetLib/src/io.cc deleted file mode 100644 index f72b9e7a6..000000000 --- a/Carpet/CarpetLib/src/io.cc +++ /dev/null @@ -1,42 +0,0 @@ -/*************************************************************************** - io.cc - I/O routines - ------------------- - begin : Sun Jun 11 2000 - copyright : (C) 2000 by Erik Schnetter - email : schnetter@astro.psu.edu - - $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/Attic/io.cc,v 1.2 2002/05/05 22:17:02 schnetter Exp $ - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include "io.hh" - -#include "io.hh" - -template<class TT> -IObase::DataType datatype(TT dummy) -{ assert(false); return IObase::DataType(); } - -template <> -IObase::DataType datatype(char* dummy) { return IObase::uInt8; } -template <> -IObase::DataType datatype(short* dummy) { return IObase::Int16; } -template <> -IObase::DataType datatype(int* dummy) { return IObase::Int32; } -template <> -IObase::DataType datatype(long long* dummy) { return IObase::Int64; } -template <> -IObase::DataType datatype(float* dummy) { return IObase::Float32; } -template <> -IObase::DataType datatype(double* dummy) { return IObase::Float64; } -template <> -IObase::DataType datatype(long double* dummy) { return IObase::Float64; } diff --git a/Carpet/CarpetLib/src/io.hh b/Carpet/CarpetLib/src/io.hh deleted file mode 100644 index 97b8376a4..000000000 --- a/Carpet/CarpetLib/src/io.hh +++ /dev/null @@ -1,57 +0,0 @@ -/*************************************************************************** - io.hh - I/O routines - ------------------- - begin : Sun Jun 11 2000 - copyright : (C) 2000 by Erik Schnetter - email : schnetter@astro.psu.edu - - $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/Attic/io.hh,v 1.2 2002/05/05 22:17:03 schnetter Exp $ - - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef IO_HH -#define IO_HH - -#include <cassert> -#include <string> - -#include <AMRwriter.hh> -#include <H5IO.hh> -#include <HDFIO.hh> -#include <IEEEIO.hh> -#include <IO.hh> - -#include "data.hh" -#include "defs.hh" - -template<class T, int D> -class io { - - enum iotype { ieee, hdf, h5 }; - -// template<int DD> -// void write_ascii (const data<T,D>& d, const string name, -// const vect<int,DD>& dirs); - -// static void write_ASCII_1D (const data<T,D>& d, const string name, -// const int dir); -// static void write_ASCII_2D (const data<T,D>& d, const string name, -// const int dir1, const int dir2); -// static void write_ASCII_3D (const data<T,D>& d, const string name); - -// static void write_FlexIO (const data<T,D>& d, const string name, -// const iotype iot); -}; - - - -#endif // IO_HH |