/* * SamplingGridProperties.hpp * * Created on: 25.07.2012 * Author: heber */ #ifndef SAMPLINGGRIDPROPERTIES_HPP_ #define SAMPLINGGRIDPROPERTIES_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "boost/serialization/export.hpp" #include "boost/serialization/array.hpp" /** This class stores a sample function on a three-dimensional grid. * */ class SamplingGridProperties { public: /** Constructor for class SamplingGridProperties. * * \param _begin offset of grid * \param _size edge length of cubic(!) domain * \param _level number of gridpoints as \f$2^{\text{level}}\f$ */ SamplingGridProperties( const double _begin[3], const double _size, const int _level); /** Copy constructor for class SamplingGridProperties. * * \param _props instance to copy from */ SamplingGridProperties(const SamplingGridProperties &_props); /** Default constructor. */ SamplingGridProperties(); virtual ~SamplingGridProperties(); /** Checks whether another instance is compatible with this one. * * \param _props other properties to check against * \return true - are compatible, false - else */ bool isCompatible(const SamplingGridProperties &_props) const { return *this == _props; } /** Equality operator for class SamplingGridProperties. * * \param _props other object to compare to */ bool operator==(const SamplingGridProperties &_props) const; /** Inequality operator for class SamplingGridProperties. * * \param _props other object to compare to */ bool operator!=(const SamplingGridProperties &_props) const { return (!(*this == _props)); } public: //!> offset of grid double begin[3]; //!> size of grid, i.e. edge length of cubic(!) domain double size; //!> level, i.e. \f$2^{\text{level}}\f$ grid points per axis int level; private: friend class boost::serialization::access; // serialization template void serialize(Archive& ar, const unsigned int version) { int i; for (i=0; i<3; ++i) ar & begin[i]; ar & size; ar & level; } }; // we need to give this class a unique key for serialization // its is only serialized through its base class FragmentJob BOOST_CLASS_EXPORT_KEY(SamplingGridProperties) #endif /* SAMPLINGGRIDPROPERTIES_HPP_ */