www.cemf.ir
integration.hpp
Go to the documentation of this file.
1 /*------------------------------- phasicFlow ---------------------------------
2  O C enter of
3  O O E ngineering and
4  O O M ultiscale modeling of
5  OOOOOOO F luid flow
6 ------------------------------------------------------------------------------
7  Copyright (C): www.cemf.ir
8  email: hamid.r.norouzi AT gmail.com
9 ------------------------------------------------------------------------------
10 Licence:
11  This file is part of phasicFlow code. It is a free software for simulating
12  granular and multiphase flows. You can redistribute it and/or modify it under
13  the terms of GNU General Public License v3 or any other later versions.
14 
15  phasicFlow is distributed to help others in their research in the field of
16  granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
17  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 -----------------------------------------------------------------------------*/
20 
21 #ifndef __integration_hpp__
22 #define __integration_hpp__
23 
24 
25 #include "virtualConstructor.hpp"
26 #include "Vectors.hpp"
27 #include "pointStructure.hpp"
28 #include "repository.hpp"
29 
30 
31 namespace pFlow
32 {
33 
50 {
51 protected:
52 
53  // - Protected data members
54 
57 
59  const word baseName_;
60 
63 
64 public:
65 
67  TypeInfo("integration");
68 
69 
70  // - Constructors
71 
74  const word& baseName,
76  const pointStructure& pStruct,
77  const word& method);
78 
80  integration(const integration&) = default;
81 
83  integration(integration&&) = default;
84 
86  integration& operator = (const integration&) = default;
87 
89  integration& operator = (integration&&) = default;
90 
92  virtual
94 
96  virtual ~integration()=default;
97 
100  integration,
101  word,
102  (const word& baseName,
103  repository& owner,
104  const pointStructure& pStruct,
105  const word& method),
106  (baseName, owner, pStruct, method) );
107 
108 
109  // - Methods
110 
112  inline
113  const auto& pStruct()const
114  {
115  return pStruct_;
116  }
117 
119  inline
120  const word& baseName()const
121  {
122  return baseName_;
123  }
124 
126  inline
128  {
129  return owner_;
130  }
131 
133  virtual
134  bool predict(real dt, realx3Vector_D& y, realx3Vector_D& dy) = 0;
135 
137  virtual
138  bool correct(real dt, realx3Vector_D& y, realx3Vector_D& dy) = 0;
139 
141  virtual
142  bool setInitialVals(
143  const int32IndexContainer& newIndices,
144  const realx3Vector& y) = 0;
145 
147  virtual
148  bool needSetInitialVals()const = 0;
149 
150 
152  static
154  const word& baseName,
155  repository& owner,
156  const pointStructure& pStruct,
157  const word& method);
158 
159 }; // integration
160 
161 } // pFlow
162 
163 
164 #endif //__integration_hpp__
pFlow::integration::owner_
repository & owner_
The owner repository that all fields are storred in.
Definition: integration.hpp:56
pFlow::real
float real
Definition: builtinTypes.hpp:46
pFlow::integration::baseName_
const word baseName_
The base name for integration.
Definition: integration.hpp:59
pFlow::integration::operator=
integration & operator=(const integration &)=default
Copy assignment.
pFlow::integration
Base class for integrating the first order ODE (IVP)
Definition: integration.hpp:49
pFlow::integration::pStruct
const auto & pStruct() const
Const ref to pointStructure.
Definition: integration.hpp:113
pFlow::integration::predict
virtual bool predict(real dt, realx3Vector_D &y, realx3Vector_D &dy)=0
Prediction step in integration.
pFlow::integration::setInitialVals
virtual bool setInitialVals(const int32IndexContainer &newIndices, const realx3Vector &y)=0
Set the initial values for new indices.
pFlow::integration::correct
virtual bool correct(real dt, realx3Vector_D &y, realx3Vector_D &dy)=0
Correction/main integration step.
pFlow::word
std::string word
Definition: builtinTypes.hpp:63
Vectors.hpp
pFlow::integration::baseName
const word & baseName() const
Base name.
Definition: integration.hpp:120
pFlow::integration::clone
virtual uniquePtr< integration > clone() const =0
Polymorphic copy/cloning.
pFlow
Definition: demComponent.hpp:28
pFlow::integration::TypeInfo
TypeInfo("integration")
Type info.
repository.hpp
pFlow::pointStructure
Definition: pointStructure.hpp:44
pFlow::integration::create_vCtor
create_vCtor(integration, word,(const word &baseName, repository &owner, const pointStructure &pStruct, const word &method),(baseName, owner, pStruct, method))
Add a virtual constructor.
virtualConstructor.hpp
pFlow::VectorSingle
Definition: VectorSingle.hpp:47
pFlow::integration::create
static uniquePtr< integration > create(const word &baseName, repository &owner, const pointStructure &pStruct, const word &method)
Create the polymorphic object based on inputs.
Definition: integration.cpp:40
pFlow::integration::owner
repository & owner()
Ref to the owner repository.
Definition: integration.hpp:127
pFlow::integration::~integration
virtual ~integration()=default
Destructor.
pFlow::uniquePtr
Definition: uniquePtr.hpp:44
pFlow::integration::integration
integration(const word &baseName, repository &owner, const pointStructure &pStruct, const word &method)
Construct from components.
Definition: integration.cpp:24
pFlow::integration::pStruct_
const pointStructure & pStruct_
A reference to pointStructure.
Definition: integration.hpp:62
pFlow::integration::needSetInitialVals
virtual bool needSetInitialVals() const =0
Check if the method requires any set initial vals.
pFlow::repository
Definition: repository.hpp:34
pFlow::Vector< realx3 >
pointStructure.hpp
pFlow::indexContainer< int32 >