JDFTx  1.2.0
TranslationOperator.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------
2 Copyright 2011 Ravishankar Sundararaman
3 
4 This file is part of JDFTx.
5 
6 JDFTx is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10 
11 JDFTx is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with JDFTx. If not, see <http://www.gnu.org/licenses/>.
18 -------------------------------------------------------------------*/
19 
20 #ifndef JDFTX_FLUID_TRANSLATIONOPERATOR_H
21 #define JDFTX_FLUID_TRANSLATIONOPERATOR_H
22 
25 
26 #include <core/GridInfo.h>
27 #include <core/ScalarField.h>
28 
31 {
32 public:
33  const GridInfo& gInfo;
34 
35  TranslationOperator(const GridInfo& gInfo);
36  virtual ~TranslationOperator() {}
37 
42  virtual void taxpy(const vector3<>& t, double alpha, const ScalarField& x, ScalarField& y) const=0;
43 };
44 
47 {
48 public:
50  const enum SplineType
52  Linear
53  } splineType;
54 
55  TranslationOperatorSpline(const GridInfo& gInfo, SplineType splineType);
56  void taxpy(const vector3<>& t, double alpha, const ScalarField& x, ScalarField& y) const;
57 };
58 
61 {
62 public:
64  void taxpy(const vector3<>& t, double alpha, const ScalarField& x, ScalarField& y) const;
65 };
66 
67 #endif // JDFTX_FLUID_TRANSLATIONOPERATOR_H
SplineType
Types of interpolating spline available for translation.
Definition: TranslationOperator.h:50
Simulation grid descriptor.
Definition: GridInfo.h:45
Real and complex scalar fields in real and reciprocal space.
The exact translation operator in PW basis, although much slower and with potential ringing issues...
Definition: TranslationOperator.h:60
Abstract base class for translation operators.
Definition: TranslationOperator.h:30
Geometry of the simulation grid.
virtual void taxpy(const vector3<> &t, double alpha, const ScalarField &x, ScalarField &y) const =0
Translation operator which works in real space using interpolating splines.
Definition: TranslationOperator.h:46
std::shared_ptr< ScalarFieldData > ScalarField
A smart reference-counting pointer to ScalarFieldData.
Definition: ScalarField.h:41
0th order spline i.e. nearest neighbour interpolation
Definition: TranslationOperator.h:51