Gauss.h
Go to the documentation of this file.
1 // This file is part of the MercuryDPM project (https://www.mercurydpm.org).
2 // Copyright (c), The MercuryDPM Developers Team. All rights reserved.
3 // License: BSD 3-Clause License; see the LICENSE file in the root directory.
4 
5 #ifndef Gauss_H
6 #define Gauss_H
7 
8 #include <GeneralDefine.h>
9 #include <iostream>
10 #include "IntegralType.h"
11 #include "CG/Coordinates/R.h"
12 #include "CG/Coordinates/X.h"
13 #include "CG/Coordinates/Y.h"
14 #include "CG/Coordinates/Z.h"
15 #include "CG/Coordinates/RZ.h"
16 #include "CG/Coordinates/XY.h"
17 #include "CG/Coordinates/XZ.h"
18 #include "CG/Coordinates/YZ.h"
19 #include "CG/Coordinates/XYZ.h"
20 #include "CG/Coordinates/O.h"
21 
22 class BaseParticle;
23 
24 class BaseInteraction;
25 
26 class DPMBase;
27 
28 class Coordinates;
29 
37 namespace CGFunctions
38 {
39 
58 template<class Coordinates>
59 class Gauss
60 {
61 public:
62 
64 
68  Gauss();
69 
73  Gauss(const Gauss& c) = default;
74 
78  ~Gauss() = default;
79 
83  void write(std::ostream& os) const;
84 
88  //void setStandardDeviation(Mdouble standardDeviation);
89 
93  void setWidth(Mdouble width);
94 
99 
103  void setWidthAndCutoff(Mdouble width, Mdouble cutoff);
104 
108  Mdouble getWidth() const;
109 
114 
118  inline Vec3D getCutoffVector(Mdouble radius, Vec3D cellSize) const { return Vec3D(getCutoff(), getCutoff(), getCutoff()); }
119 
124  Mdouble getEps() const;
125 
131 
135  Mdouble evaluateCGFunction(const Vec3D& position, const Coordinates r);
136 
140  Mdouble evaluateCGFunction(const Vec3D& position, const Mdouble rad, const Coordinates r)
141  {
142  return evaluateCGFunction(position, r);
143  }
144 
146 
147  Mdouble evaluateCGFunctionDerivativeWithFD(const Vec3D& position, const Coordinates& r, const int i);
148 
150  { return constants::NaN; }
151 
155  Mdouble
157 
160  { return constants::NaN; }
161 
166  Mdouble
168 
169 protected:
170 
182 
188 
194 
201 
203 
205 
212 
217 
218 };
219 
238 
239 } //namespace CGFunctions
240 #include "Gauss.hcc"
241 
242 #endif
int i
Definition: BiCGSTAB_step_by_step.cpp:9
IntegralType
Specifies the two points between which a line integral is computed.
Definition: IntegralType.h:14
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:39
Definition: BaseParticle.h:33
Defines the non-averaged directions on which spatial coarse-graining is applied (the x-direction for ...
Definition: R.h:32
Defines the position of the CGPoint (e.g. x, y, z) and the parameters of the Gauss coarse-graining fu...
Definition: Gauss.h:60
Mdouble evaluateCylindricalCGFunction(const Vec3D &position, const CGCoordinates::R r)
Definition: Gauss.h:149
Mdouble evaluateCGFunctionDerivativeWithFD(const Vec3D &position, const Coordinates &r, const int i)
Vec3D getCutoffVector(Mdouble radius, Vec3D cellSize) const
Returns the cutoff of the coarse-graining function along each direction.
Definition: Gauss.h:118
~Gauss()=default
Destructor, does nothing, as no new'ed objects are used.
void setWidth(Mdouble width)
Sets the width of the coarse-graining function.
Mdouble getCutoff() const
Returns the cutoff of the coarse-graining function.
unsigned currentInteraction_
Definition: Gauss.h:211
Mdouble evaluateCGIntegral1D(const BaseInteraction &i, const Coordinates r, IntegralType type=IntegralType::I_TO_P)
Evaluates the line integral needed for the calculation of stresses for 1D CGCoordinates.
Mdouble getEps() const
Returns the finite difference step size used to evaluate derivatives of the CG function.
Mdouble evaluateCylindricalCGIntegral(const BaseInteraction &c, const CGCoordinates::R r, IntegralType type=IntegralType::I_TO_P)
Definition: Gauss.h:158
Coordinates CoordinatesType
Definition: Gauss.h:63
Mdouble getWidth() const
Returns the width of the coarse-graining function.
Gauss(const Gauss &c)=default
Copy constructor. It copies the GaussCoordinates and all objects it contains.
Mdouble integralPrefactor_
Definition: Gauss.h:200
Mdouble prefactor_
Definition: Gauss.h:193
Mdouble width_
Definition: Gauss.h:181
void setStandardDeviation(Mdouble std)
Sets the standard deviation of the coarse-graining function.
Mdouble evaluateCGFunction(const Vec3D &position, const Coordinates r)
Evaluates the coarse-graining function.
Mdouble evaluateCGFunction(const Vec3D &position, const Mdouble rad, const Coordinates r)
Evaluates the coarse-graining function.
Definition: Gauss.h:140
Vec3D normal_
Definition: Gauss.h:204
void setEps(Mdouble eps)
Sets the finite difference step size used to evaluate derivatives of the CG function.
Vec3D evaluateCGFunctionDerivatives(const Vec3D &position, const Coordinates &r)
Mdouble cutoff_
Definition: Gauss.h:187
Mdouble evaluateCGIntegral(const BaseInteraction &i, const Coordinates r, IntegralType type=IntegralType::I_TO_P)
Evaluates the line integral needed for the calculation of stresses.
void setWidthAndCutoff(Mdouble width, Mdouble cutoff)
Sets the width and cutoff of the coarse-graining function.
Mdouble eps_
Definition: Gauss.h:216
Gauss()
Default constructor, it simply creates an empty GaussCoordinates.
void write(std::ostream &os) const
Writes class content into an output stream, usually a stat file.
Mdouble normalLength_
Definition: Gauss.h:202
Template argument; use a member class of CGCoordinates to instantiate.
The DPMBase header includes quite a few header files, defining all the handlers, which are essential....
Definition: DPMBase.h:56
Definition: Kernel/Math/Vector.h:30
Contains base classes of CGPoint; CGPoint is always templated with one of these classes; these classe...
Definition: ExactOverlap.h:28
CGFunctions::Gauss< CGCoordinates::X > GaussX
Defines a short notation for the Gaussian CGFunction templated with a certain CGCoordinate.
Definition: Gauss.h:223
CGFunctions::Gauss< CGCoordinates::XYZ > GaussXYZ
Defines a short notation for the Gaussian CGFunction templated with a certain CGCoordinate.
Definition: Gauss.h:235
CGFunctions::Gauss< CGCoordinates::R > GaussR
Defines a short notation for the Gaussian CGFunction templated with a certain CGCoordinate.
Definition: Gauss.h:237
CGFunctions::Gauss< CGCoordinates::XY > GaussXY
Defines a short notation for the Gaussian CGFunction templated with a certain CGCoordinate.
Definition: Gauss.h:233
CGFunctions::Gauss< CGCoordinates::Z > GaussZ
Defines a short notation for the Gaussian CGFunction templated with a certain CGCoordinate.
Definition: Gauss.h:227
CGFunctions::Gauss< CGCoordinates::YZ > GaussYZ
Defines a short notation for the Gaussian CGFunction templated with a certain CGCoordinate.
Definition: Gauss.h:229
CGFunctions::Gauss< CGCoordinates::XZ > GaussXZ
Defines a short notation for the Gaussian CGFunction templated with a certain CGCoordinate.
Definition: Gauss.h:231
CGFunctions::Gauss< CGCoordinates::O > GaussO
Defines a short notation for the Gaussian CGFunction templated with a certain CGCoordinate.
Definition: Gauss.h:221
CGFunctions::Gauss< CGCoordinates::Y > GaussY
Defines a short notation for the Gaussian CGFunction templated with a certain CGCoordinate.
Definition: Gauss.h:225
double eps
Definition: crbond_bessel.cc:24
r
Definition: UniformPSDSelfTest.py:20
radius
Definition: UniformPSDSelfTest.py:15
int c
Definition: calibrate.py:100
type
Definition: compute_granudrum_aor.py:141
const Mdouble NaN
Definition: GeneralDefine.h:22