www.cemf.ir
AdamsBashforth2.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 #ifndef __AdamsBashforth2_hpp__
21 #define __AdamsBashforth2_hpp__
22 
23 
24 #include "integration.hpp"
25 #include "pointFields.hpp"
27 
28 namespace pFlow
29 {
30 
38 :
39  public integration,
40  public realx3PointField_D
41 {
42 private:
43 
45 
47 
48  const auto& dy1()const
49  {
50  return static_cast<const realx3PointField_D&>(*this);
51  }
52 
53  auto& dy1()
54  {
55  return static_cast<realx3PointField_D&>(*this);
56  }
57 
58 public:
59 
61  ClassInfo("AdamsBashforth2");
62 
63  // - Constructors
64 
67  const word& baseName,
69  const word& method,
70  const realx3Field_D& initialValField);
71 
73  ~AdamsBashforth2()final = default;
74 
76  add_vCtor(
79  word);
80 
81 
82  // - Methods
83 
85 
87  word method()const override
88  {
89  return "AdamsBashforth2";
90  }
91 
92  bool predict(
93  real UNUSED(dt),
95  realx3PointField_D& UNUSED(dy)) final;
96 
97  bool predict(
98  real dt,
99  realx3Field_D& y,
100  realx3PointField_D& dy) final;
101 
102  bool correct(
103  real dt,
104  realx3PointField_D& y,
105  realx3PointField_D& dy) final;
106 
107  bool correctPStruct(
108  real dt,
110  realx3PointField_D& vel) final;
111 
112 
113  /*bool hearChanges
114  (
115  real t,
116  real dt,
117  uint32 iter,
118  const message& msg,
119  const anyList& varList
120  ) override;*/
121 
122  bool setInitialVals(
123  const int32IndexContainer& newIndices,
124  const realx3Vector& y) final;
125 
126  bool needSetInitialVals()const final
127  {
128  return false;
129  }
130 
131 };
132 
133 
134 } // pFlow
135 
136 #endif //__integration_hpp__
pFlow::AdamsBashforth2::~AdamsBashforth2
~AdamsBashforth2() final=default
Destructor.
pFlow::AdamsBashforth2::method
word method() const override
return integration method
Definition: AdamsBashforth2.hpp:87
pFlow::AdamsBashforth2::predict
bool predict(real UNUSED(dt), realx3PointField_D &UNUSED(y), realx3PointField_D &UNUSED(dy)) final
Definition: AdamsBashforth2.cpp:123
pFlow::real
float real
Definition: builtinTypes.hpp:45
UNUSED
#define UNUSED(x)
Definition: pFlowMacros.hpp:35
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::AdamsBashforth2::AdamsBashforth2
AdamsBashforth2(const word &baseName, pointStructure &pStruct, const word &method, const realx3Field_D &initialValField)
Construct from components.
Definition: AdamsBashforth2.cpp:94
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pointFields.hpp
pFlow::AdamsBashforth2::ClassInfo
ClassInfo("AdamsBashforth2")
Class info.
pFlow::AdamsBashforth2::dy1
auto & dy1()
Definition: AdamsBashforth2.hpp:53
pFlow::Field< realx3 >
pFlow::AdamsBashforth2::needSetInitialVals
bool needSetInitialVals() const final
Check if the method requires any set initial vals.
Definition: AdamsBashforth2.hpp:126
pFlow::AdamsBashforth2::boundaryList_
boundaryIntegrationList boundaryList_
Definition: AdamsBashforth2.hpp:44
pFlow::AdamsBashforth2::correct
bool correct(real dt, realx3PointField_D &y, realx3PointField_D &dy) final
Correction/main integration step.
Definition: AdamsBashforth2.cpp:142
pFlow::integration::baseName
const word & baseName() const
Base name.
Definition: integration.hpp:122
pFlow
Definition: demGeometry.hpp:27
pFlow::pointField
Definition: pointField.hpp:33
pFlow::pointStructure
Definition: pointStructure.hpp:34
pFlow::AdamsBashforth2::correctPStruct
bool correctPStruct(real dt, pointStructure &pStruct, realx3PointField_D &vel) final
Definition: AdamsBashforth2.cpp:165
pFlow::AdamsBashforth2::dy1
const auto & dy1() const
Definition: AdamsBashforth2.hpp:48
pFlow::AdamsBashforth2::processorAB2BoundaryIntegration
friend class processorAB2BoundaryIntegration
Definition: AdamsBashforth2.hpp:46
pFlow::boundaryIntegrationList
Definition: boundaryIntegrationList.hpp:16
pFlow::AdamsBashforth2::setInitialVals
bool setInitialVals(const int32IndexContainer &newIndices, const realx3Vector &y) final
Set the initial values for new indices.
Definition: AdamsBashforth2.cpp:187
pFlow::AdamsBashforth2
Second order Adams-Bashforth integration method for solving ODE.
Definition: AdamsBashforth2.hpp:37
integration.hpp
pFlow::AdamsBashforth2::updateBoundariesSlaveToMasterIfRequested
void updateBoundariesSlaveToMasterIfRequested() override
Definition: AdamsBashforth2.cpp:118
pFlow::Vector< realx3 >
boundaryIntegrationList.hpp
pFlow::indexContainer
It holds two vectors of indecis on Host and Device.
Definition: indexContainer.hpp:39
pFlow::AdamsBashforth2::add_vCtor
add_vCtor(integration, AdamsBashforth2, word)
Add this to the virtual constructor table.