TimeAveragedCG.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2023, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 #ifndef TimeAveragedCG_H
26 #define TimeAveragedCG_H
27 
28 #include <GeneralDefine.h>
29 #include "CG/CG.h"
30 #include <iostream>
31 #include <vector>
32 
33 class BaseParticle;
34 
35 class BaseInteraction;
36 
37 class DPMBase;
38 
39 class Function;
40 
55 template<class Coordinates = CGCoordinates::O,
56  template<class> class BaseFunction=CGFunctions::Lucy,
57  class Fields=CGFields::StandardFields>
58 class TimeAveragedCG : public CG<Coordinates, BaseFunction, Fields>
59 {
60 public:
61  typedef BaseFunction<Coordinates> Function;
62 
67 
72  TimeAveragedCG(const TimeAveragedCG& p) = default;
73 
77  virtual ~TimeAveragedCG() = default;
78 
83 
87  void write(std::ostream& os) const override;
88 
92  std::string getName() const override;
93 
98  void initialise() override;
99 
104  void evaluate() override;
105 
110  void finish() override;
111 
112 protected:
113 
120  unsigned int nTime_;
121 };
122 
123 
127 template<template<class> class BaseFunction, class Fields = CGFields::StandardFields>
128 //class test : public TimeAveragedCG_Lebedev<CGCoordinates::XYZ, BaseFunction, Fields>
129 class TimeAveragedCGXYZ : public TimeAveragedCG<CGCoordinates::XYZ, BaseFunction, Fields>
130 {
131 public:
136 
142 
147 
152 
153 };
154 
155 #include "TimeAveragedCG.hcc"
156 
157 #endif
@ O
Definition: StatisticsVector.h:42
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:60
Definition: BaseParticle.h:54
Contains the computed field values, like density, momentum and stress.
Definition: StandardFields.h:51
A specialisation of Polynomials for PolynomialType::Lucy. See Polynomial for details.
Definition: Lucy.h:39
Evaluates time-resolved continuum fields and writes the data into a stat file.
Definition: CG.h:76
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:77
Template argument; use a member class of CGFunctions to instantiate.
Specialisation of TimeAveragedCG with coordinates XYZ used for LebedevCG.
Definition: TimeAveragedCG.h:130
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:59
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:61
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:120
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.