aslGlobalSpace.h
Go to the documentation of this file.
/*
* Advanced Simulation Library <http://asl.org.il>
*
* Copyright 2015 Avtech Scientific <http://avtechscientific.com>
*
*
* This file is part of Advanced Simulation Library (ASL).
*
* ASL is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, version 3 of the License.
*
* ASL 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with ASL. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef ASLGLOBALSPACE_H
#define ASLGLOBALSPACE_H
namespace asl{
//The class describes global discrete space
class GlobalSpace {
public:
typedef long int Type;
typedef AVec<long int> VType;
private:
const double dt;
const double dx;
public:
inline GlobalSpace():dx(1.),dt(1.){};
inline double discreteToGlobal(Type t){return dt*t;}
inline Type globalToDiscrete(double t){return floor(t/dt);}
inline Avec<double> discreteToGlobal(VType r){return dt*r;}
inline VType globalToDiscrete(AVec<double> t){return floor(t/dt);}
};
} //namespace acl
#endif // ASLGLOBALSPACE_H
asl::AVec
Definition: aslVectorsDynamicLength.h:40
asl::GlobalSpace::GlobalSpace
GlobalSpace()
Definition: aslGlobalSpace.h:43
asl::GlobalSpace::VType
AVec< long int > VType
Definition: aslGlobalSpace.h:38
asl::GlobalSpace::Type
long int Type
Definition: aslGlobalSpace.h:37
asl::GlobalSpace::globalToDiscrete
Type globalToDiscrete(double t)
Definition: aslGlobalSpace.h:45
asl::GlobalSpace::globalToDiscrete
VType globalToDiscrete(AVec< double > t)
Definition: aslGlobalSpace.h:47
asl::GlobalSpace::discreteToGlobal
Avec< double > discreteToGlobal(VType r)
Definition: aslGlobalSpace.h:46
asl::GlobalSpace::discreteToGlobal
double discreteToGlobal(Type t)
Definition: aslGlobalSpace.h:44
asl::dx
acl::VectorOfElements dx(const TemplateVE &a)
differential operator
asl
Advanced Simulation Library.
Definition: aslDataInc.h:31
asl::floor
const AVec< int > floor(const AVec<> &a)
Definition: aslVectorsDynamicLengthOperations.h:365