MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TimeAveragedCG.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2020, 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 
146  virtual ~TimeAveragedCGXYZ();
147 
152 
153 };
154 
155 #include "TimeAveragedCG.hcc"
156 
157 #endif
BaseFunction< Coordinates > Function
Specialisation of TimeAveragedCG with coordinates XYZ used for LebedevCG.
Template argument; use a member class of CGFunctions to instantiate.
The DPMBase header includes quite a few header files, defining all the handlers, which are essential...
Definition: DPMBase.h:72
void finish() override
Called at the end of the DPM simulation to finish the cg evaluation and to close the statFile...
unsigned int nTime_
A specialisation of Polynomials for PolynomialType::Lucy. See Polynomial for details.
Definition: Lucy.h:38
Evaluates time-averaged continuum fields and writes the data into a stat file.
Stores information about interactions between two interactable objects; often particles but could be ...
void initialise() override
Called at the beginning of the DPM simulation to initialise the cg evaluation and to open the statFil...
TimeAveragedCGXYZ< BaseFunction, Fields > * copy() const override
Copy.
TimeAveragedCG< Coordinates, BaseFunction, Fields > * copy() const override
Copy operator; creates a new'ed CG object.
TimeAveragedCGXYZ()
Default constructor.
void evaluate() override
Called after a given number of time steps (statFile::saveCount_) to evaluate the CG fields...
void write(std::ostream &os) const override
Writes class content, except for the points, into an output stream.
Evaluates time-resolved continuum fields and writes the data into a stat file.
Definition: CG.h:75
virtual ~TimeAveragedCG()=default
Destructor, it simply destructs the TimeAveragedCGFunction and all the objects it contains...
std::string getName() const override
returns the name of the class, which is required by write.
Contains the computed field values, like density, momentum and stress.
TimeAveragedCG()
Default constructor.
virtual ~TimeAveragedCGXYZ()
Destructor, it simply destructs the TimeAveragedCGFunction and all the objects it contains...
Template argument; use a member class of CGCoordinates to instantiate.