TimeAveragedCG.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 TimeAveragedCG_H
6 #define TimeAveragedCG_H
7 
8 #include <GeneralDefine.h>
9 #include "CG/CG.h"
10 #include <iostream>
11 #include <vector>
12 
13 class BaseParticle;
14 
15 class BaseInteraction;
16 
17 class DPMBase;
18 
19 class Function;
20 
35 template<class Coordinates = CGCoordinates::O,
36  template<class> class BaseFunction=CGFunctions::Lucy,
37  class Fields=CGFields::StandardFields>
38 class TimeAveragedCG : public CG<Coordinates, BaseFunction, Fields>
39 {
40 public:
41  typedef BaseFunction<Coordinates> Function;
42 
47 
52  TimeAveragedCG(const TimeAveragedCG& p) = default;
53 
57  virtual ~TimeAveragedCG() = default;
58 
63 
67  void write(std::ostream& os) const override;
68 
72  std::string getName() const override;
73 
78  void initialise() override;
79 
84  void evaluate() override;
85 
90  void finish() override;
91 
92 protected:
93 
100  unsigned int nTime_;
101 };
102 
103 
107 template<template<class> class BaseFunction, class Fields = CGFields::StandardFields>
108 //class test : public TimeAveragedCG_Lebedev<CGCoordinates::XYZ, BaseFunction, Fields>
109 class TimeAveragedCGXYZ : public TimeAveragedCG<CGCoordinates::XYZ, BaseFunction, Fields>
110 {
111 public:
116 
122 
127 
132 
133 };
134 
135 #include "TimeAveragedCG.hcc"
136 
137 #endif
@ O
Definition: StatisticsVector.h:21
float * p
Definition: Tutorial_Map_using.cpp:9
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:39
Definition: BaseParticle.h:33
Contains the computed field values, like density, momentum and stress.
Definition: StandardFields.h:33
A specialisation of Polynomials for PolynomialType::Lucy. See Polynomial for details.
Definition: Lucy.h:19
Evaluates time-resolved continuum fields and writes the data into a stat file.
Definition: CG.h:55
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
Template argument; use a member class of CGFunctions to instantiate.
Specialisation of TimeAveragedCG with coordinates XYZ used for LebedevCG.
Definition: TimeAveragedCG.h:110
TimeAveragedCGXYZ< BaseFunction, Fields > * copy() const override
Copy.
virtual ~TimeAveragedCGXYZ()
Destructor, it simply destructs the TimeAveragedCGFunction and all the objects it contains.
TimeAveragedCGXYZ(const TimeAveragedCGXYZ &p)
Copy constructor. It copies the TimeAveragedCGFunction and all objects it contains.
TimeAveragedCGXYZ()
Default constructor.
Evaluates time-averaged continuum fields and writes the data into a stat file.
Definition: TimeAveragedCG.h:39
void evaluate() override
Called after a given number of time steps (statFile::saveCount_) to evaluate the CG fields.
void initialise() override
Called at the beginning of the DPM simulation to initialise the cg evaluation and to open the statFil...
BaseFunction< Coordinates > Function
Definition: TimeAveragedCG.h:41
TimeAveragedCG< Coordinates, BaseFunction, Fields > * copy() const override
Copy operator. Required for BaseHandler::copyAndAddObject.
void finish() override
Called at the end of the DPM simulation to finish the cg evaluation and to close the statFile.
TimeAveragedCG()
Default constructor.
std::string getName() const override
A purely virtual function.
void write(std::ostream &os) const override
Writes class content into an output stream, usually a stat file.
unsigned int nTime_
Definition: TimeAveragedCG.h:100
virtual ~TimeAveragedCG()=default
Destructor, it simply destructs the TimeAveragedCGFunction and all the objects it contains.
TimeAveragedCG(const TimeAveragedCG &p)=default
Copy constructor. It copies the TimeAveragedCGFunction and all objects it contains.
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286