Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92307986
map_2d_square.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Nov 19, 06:53
Size
3 KB
Mime Type
text/x-c++
Expires
Thu, Nov 21, 06:53 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22419024
Attached To
rTAMAAS tamaas
map_2d_square.hh
View Options
/**
*
* @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 "grid.hh"
/* -------------------------------------------------------------------------- */
__BEGIN_TAMAAS__
template <typename T>
class Map2dSquare : public Grid<T, 2> {
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public:
Map2dSquare(UInt n, Real L = 1.): Grid<T, 2>() {
UInt dims[2] = {n, n};
this->resize(dims);
this->L[0] = L;
this->L[1] = L;
}
virtual ~Map2dSquare() {}
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
public:
//! get lateral number of discretization points
inline UInt size() const{return this->n[0];};
//! set the grid size
void setGridSize(UInt n) {
UInt dims[2] = {n, n};
this->resize(dims);
}
void loadFromTextFile(std::string filename, int each);
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 this->L[0];};
//! get the lateral size of the sample
inline void setL(Real L) {
this->L[0] = L;
this->L[1] = L;
}
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
private:
};
__END_TAMAAS__
#endif /* __MAP_2D_SQUARE_HH__ */
Event Timeline
Log In to Comment