Page MenuHomec4science

map_2d_square.hh
No OneTemporary

File Metadata

Created
Tue, May 28, 13:22

map_2d_square.hh

/**
*
* @author Guillaume Anciaux <guillaume.anciaux@epfl.ch>
*
* @section LICENSE
*
* Copyright (©) 2016 EPFL (Ecole Polytechnique Fédérale de
* Lausanne) Laboratory (LSMS - Laboratoire de Simulation en Mécanique des
* Solides)
*
* Tamaas is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* Tamaas is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Tamaas. If not, see <http://www.gnu.org/licenses/>.
*
*/
/* -------------------------------------------------------------------------- */
#ifndef __MAP_2D_SQUARE_HH__
#define __MAP_2D_SQUARE_HH__
/* -------------------------------------------------------------------------- */
#include "map_2d.hh"
/* -------------------------------------------------------------------------- */
__BEGIN_TAMAAS__
template <typename T>
class Map2dSquare : public Map2d<T> {
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public:
Map2dSquare(UInt n, Real L = 1.): Map2d<T>(n,n,L,L){};
virtual ~Map2dSquare(){};
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
public:
//! get lateral number of discretization points
inline UInt size() const{return Map2d<T>::size(0);};
//! load all n-th point of heights array from text file usable with plot programs
void loadFromTextFile(std::string filename, int each=1);
//! set the grid size
void setGridSize(UInt n){Map2d<T>::setGridSize(n,n);};
private:
//! read an entry from a stringstream
T readValue(std::stringstream & sstr);
/* ------------------------------------------------------------------------ */
/* Accessors */
/* ------------------------------------------------------------------------ */
public:
//! get the lateral size of the sample
inline Real getL()const {return Map2d<T>::getL(0);};
//! get the lateral size of the sample
inline void setL(Real L){Map2d<T>::setL(L,L);};
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
private:
};
__END_TAMAAS__
#endif /* __MAP_2D_SQUARE_HH__ */

Event Timeline