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 "pointFields.hpp"
27 
28 
29 namespace pFlow
30 {
31 
32 // - Forward
33 class repository;
34 class pointStructure;
35 
52 {
53 private:
54 
55  // - Protected data members
56 
59 
62 
64  const word baseName_;
65 
66 public:
67 
69  TypeInfo("integration");
70 
71 
72  // - Constructors
73 
76  const word& baseName,
78  const word& method,
79  const realx3Field_D& initialValField);
80 
82  integration(const integration&) = default;
83 
85  integration(integration&&) = default;
86 
88  integration& operator = (const integration&) = default;
89 
91  integration& operator = (integration&&) = default;
92 
94  virtual ~integration()=default;
95 
98  (
100  word,
101  (
102  const word& baseName,
104  const word& method,
105  const realx3Field_D& initialValField
106  ),
107  (baseName, pStruct, method, initialValField)
108  );
109 
110 
111  // - Methods
112 
114  inline
115  const auto& pStruct()const
116  {
117  return pStruct_;
118  }
119 
121  inline
122  const word& baseName()const
123  {
124  return baseName_;
125  }
126 
128  inline
130  {
131  return owner_;
132  }
133 
134  virtual
137  virtual
138  word method()const = 0 ;
139 
141  virtual
142  bool predict(real dt, realx3PointField_D& y, realx3PointField_D& dy) = 0;
143 
144  virtual
145  bool predict(real dt, realx3Field_D& y, realx3PointField_D& dy) = 0;
146 
148  virtual
149  bool correct(real dt, realx3PointField_D& y, realx3PointField_D& dy) = 0;
150 
151  virtual
153 
155  virtual
156  bool setInitialVals(
157  const int32IndexContainer& newIndices,
158  const realx3Vector& y) = 0;
159 
161  virtual
162  bool needSetInitialVals()const = 0;
163 
164 
166  static
168  const word& baseName,
170  const word& method,
171  const realx3Field_D& initialValField);
172 
173 }; // integration
174 
175 } // pFlow
176 
177 
178 #endif //__integration_hpp__
pFlow::integration::owner_
repository & owner_
The owner repository that all fields are storred in.
Definition: integration.hpp:58
pFlow::integration::correct
virtual bool correct(real dt, realx3PointField_D &y, realx3PointField_D &dy)=0
Correction/main integration step.
pFlow::real
float real
Definition: builtinTypes.hpp:45
pFlow::integration::baseName_
const word baseName_
The base name for integration.
Definition: integration.hpp:64
pFlow::integration::operator=
integration & operator=(const integration &)=default
Copy assignment.
pFlow::integration
Base class for integrating the first order ODE (IVP)
Definition: integration.hpp:51
pFlow::integration::pStruct
const auto & pStruct() const
Const ref to pointStructure.
Definition: integration.hpp:115
pFlow::integration::setInitialVals
virtual bool setInitialVals(const int32IndexContainer &newIndices, const realx3Vector &y)=0
Set the initial values for new indices.
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pointFields.hpp
pFlow::integration::predict
virtual bool predict(real dt, realx3PointField_D &y, realx3PointField_D &dy)=0
Prediction step in integration.
pFlow::Field< realx3 >
pFlow::integration::baseName
const word & baseName() const
Base name.
Definition: integration.hpp:122
pFlow
Definition: demGeometry.hpp:27
pFlow::integration::TypeInfo
TypeInfo("integration")
Type info.
pFlow::pointField
Definition: pointField.hpp:33
pFlow::pointStructure
Definition: pointStructure.hpp:34
pFlow::integration::correctPStruct
virtual bool correctPStruct(real dt, pointStructure &pStruct, realx3PointField_D &vel)=0
virtualConstructor.hpp
pFlow::integration::integration
integration(const word &baseName, pointStructure &pStruct, const word &method, const realx3Field_D &initialValField)
Construct from components.
Definition: integration.cpp:26
pFlow::integration::owner
repository & owner()
Ref to the owner repository.
Definition: integration.hpp:129
pFlow::integration::~integration
virtual ~integration()=default
Destructor.
pFlow::uniquePtr
Definition: uniquePtr.hpp:42
pFlow::integration::updateBoundariesSlaveToMasterIfRequested
virtual void updateBoundariesSlaveToMasterIfRequested()=0
pFlow::integration::pStruct_
const pointStructure & pStruct_
A reference to pointStructure.
Definition: integration.hpp:61
pFlow::integration::needSetInitialVals
virtual bool needSetInitialVals() const =0
Check if the method requires any set initial vals.
pFlow::integration::method
virtual word method() const =0
return integration method
pFlow::repository
Definition: repository.hpp:34
pFlow::Vector< realx3 >
pFlow::integration::create
static uniquePtr< integration > create(const word &baseName, pointStructure &pStruct, const word &method, const realx3Field_D &initialValField)
Create the polymorphic object based on inputs.
Definition: integration.cpp:41
pFlow::indexContainer
It holds two vectors of indecis on Host and Device.
Definition: indexContainer.hpp:39
pFlow::integration::create_vCtor
create_vCtor(integration, word,(const word &baseName, pointStructure &pStruct, const word &method, const realx3Field_D &initialValField),(baseName, pStruct, method, initialValField))
Add a virtual constructor.