/*************************************************************************** gf.cc - Grid Function data for every element of a data hierarchy ------------------- 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/gf.cc,v 1.9 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 #include "defs.hh" #include "gf.hh" using namespace std; // Constructors template gf::gf (const string name, th& t, dh& d, const int tmin, const int tmax, const int prolongation_order_time) : generic_gf(name, t, d, tmin, tmax, prolongation_order_time) { recompose(); } // Destructors template gf::~gf () { } // Access to the data template const data* gf::operator() (int tl, int rl, int c, int ml) const { assert (tl>=tmin && tl<=tmax); assert (rl>=0 && rl=0 && c=0 && ml*)storage[tl-tmin][rl][c][ml]; } template data* gf::operator() (int tl, int rl, int c, int ml) { assert (tl>=tmin && tl<=tmax); assert (rl>=0 && rl=0 && c=0 && ml*)storage[tl-tmin][rl][c][ml]; } // Output template ostream& gf::output (ostream& os) const { os << "gf:\"" << name << "\"," << "dt=[" << tmin << ":" << tmax<< "]"; return os; } #define INSTANTIATE(T) \ template class gf; #include "instantiate" #undef INSTANTIATE