mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-06-22 16:28:30 +00:00
code recovery regular part
This commit is contained in:
@ -90,8 +90,6 @@ bool intScattered
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
pFlow::AdamsBashforth2::AdamsBashforth2
|
||||
(
|
||||
const word& baseName,
|
||||
@ -113,15 +111,19 @@ pFlow::AdamsBashforth2::AdamsBashforth2
|
||||
pStruct,
|
||||
zero3,
|
||||
zero3
|
||||
)
|
||||
),
|
||||
boundaryList_(pStruct, method, *this)
|
||||
{}
|
||||
|
||||
bool pFlow::AdamsBashforth2::predict
|
||||
(
|
||||
real UNUSED(dt),
|
||||
realx3PointField_D& UNUSED(y),
|
||||
realx3PointField_D& UNUSED(dy)
|
||||
)
|
||||
void pFlow::AdamsBashforth2::updateBoundariesSlaveToMasterIfRequested()
|
||||
{
|
||||
realx3PointField_D::updateBoundariesSlaveToMasterIfRequested();
|
||||
}
|
||||
|
||||
bool pFlow::AdamsBashforth2::predict(
|
||||
real UNUSED(dt),
|
||||
realx3PointField_D &UNUSED(y),
|
||||
realx3PointField_D &UNUSED(dy))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -142,25 +144,46 @@ bool pFlow::AdamsBashforth2::correct
|
||||
realx3PointField_D& y,
|
||||
realx3PointField_D& dy
|
||||
)
|
||||
{
|
||||
return correct(dt, y.field(), dy);
|
||||
}
|
||||
|
||||
bool pFlow::AdamsBashforth2::correct(real dt, realx3Field_D &y, realx3PointField_D &dy)
|
||||
{
|
||||
auto& dy1l = dy1();
|
||||
|
||||
bool success = false;
|
||||
if(dy1l.isAllActive())
|
||||
{
|
||||
return intAllActive(dt, y, dy, dy1l);
|
||||
success = intAllActive(dt, y.field(), dy, dy1l);
|
||||
}
|
||||
else
|
||||
{
|
||||
return intScattered(dt, y, dy, dy1l);
|
||||
success = intScattered(dt, y.field(), dy, dy1l);
|
||||
}
|
||||
return false;
|
||||
|
||||
success = success && boundaryList_.correct(dt, y, dy);
|
||||
|
||||
return success;
|
||||
|
||||
}
|
||||
|
||||
bool pFlow::AdamsBashforth2::correctPStruct(
|
||||
real dt,
|
||||
pointStructure &pStruct,
|
||||
realx3PointField_D &vel)
|
||||
{
|
||||
auto& dy1l = dy1();
|
||||
bool success = false;
|
||||
if(dy1l.isAllActive())
|
||||
{
|
||||
success = intAllActive(dt, pStruct.pointPosition(), vel, dy1l);
|
||||
}
|
||||
else
|
||||
{
|
||||
success = intScattered(dt, pStruct.pointPosition(), vel, dy1l);
|
||||
}
|
||||
|
||||
success = success && boundaryList_.correctPStruct(dt, pStruct, vel);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
bool pFlow::AdamsBashforth2::setInitialVals(
|
||||
const int32IndexContainer& newIndices,
|
||||
const realx3Vector& y)
|
||||
|
@ -17,13 +17,13 @@ Licence:
|
||||
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
-----------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef __AdamsBashforth2_hpp__
|
||||
#define __AdamsBashforth2_hpp__
|
||||
|
||||
|
||||
#include "integration.hpp"
|
||||
#include "pointFields.hpp"
|
||||
#include "boundaryIntegrationList.hpp"
|
||||
|
||||
namespace pFlow
|
||||
{
|
||||
@ -41,6 +41,15 @@ class AdamsBashforth2
|
||||
{
|
||||
private:
|
||||
|
||||
boundaryIntegrationList boundaryList_;
|
||||
|
||||
friend class processorAB2BoundaryIntegration;
|
||||
|
||||
const auto& dy1()const
|
||||
{
|
||||
return static_cast<const realx3PointField_D&>(*this);
|
||||
}
|
||||
|
||||
auto& dy1()
|
||||
{
|
||||
return static_cast<realx3PointField_D&>(*this);
|
||||
@ -71,6 +80,9 @@ public:
|
||||
|
||||
|
||||
// - Methods
|
||||
|
||||
void updateBoundariesSlaveToMasterIfRequested()override;
|
||||
|
||||
/// return integration method
|
||||
word method()const override
|
||||
{
|
||||
@ -92,10 +104,11 @@ public:
|
||||
realx3PointField_D& y,
|
||||
realx3PointField_D& dy) final;
|
||||
|
||||
bool correct(
|
||||
bool correctPStruct(
|
||||
real dt,
|
||||
realx3Field_D& y,
|
||||
realx3PointField_D& dy) final;
|
||||
pointStructure& pStruct,
|
||||
realx3PointField_D& vel) final;
|
||||
|
||||
|
||||
/*bool hearChanges
|
||||
(
|
||||
|
@ -1,7 +1,10 @@
|
||||
|
||||
list(APPEND SourceFiles
|
||||
integration/integration.cpp
|
||||
integration/integration.cpp
|
||||
boundaries/boundaryIntegration.cpp
|
||||
boundaries/boundaryIntegrationList.cpp
|
||||
AdamsBashforth2/AdamsBashforth2.cpp
|
||||
AdamsBashforth2/processorAB2BoundaryIntegration.cpp
|
||||
#AdamsBashforth5/AdamsBashforth5.cpp
|
||||
#AdamsBashforth4/AdamsBashforth4.cpp
|
||||
#AdamsBashforth3/AdamsBashforth3.cpp
|
||||
|
@ -32,10 +32,28 @@ bool pFlow::boundaryIntegrationList::correct(real dt, realx3PointField_D &y, rea
|
||||
{
|
||||
if(!bndry->correct(dt, y, dy))
|
||||
{
|
||||
fatalErrorInFunction;
|
||||
fatalErrorInFunction<<"Error in correcting boundary "<<
|
||||
bndry->boundaryName()<<endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool pFlow::boundaryIntegrationList::correctPStruct(
|
||||
real dt,
|
||||
pointStructure &pStruct,
|
||||
const realx3PointField_D &vel)
|
||||
{
|
||||
for(auto& bndry:*this)
|
||||
{
|
||||
if(!bndry->correctPStruct(dt, vel))
|
||||
{
|
||||
fatalErrorInFunction<<"Error in correcting boundary "<<
|
||||
bndry->boundaryName()<<" in pointStructure."<<endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -35,6 +35,12 @@ public:
|
||||
real dt,
|
||||
realx3PointField_D& y,
|
||||
realx3PointField_D& dy);
|
||||
|
||||
bool correctPStruct(
|
||||
real dt,
|
||||
pointStructure& pStruct,
|
||||
const realx3PointField_D& vel);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -131,6 +131,8 @@ public:
|
||||
return owner_;
|
||||
}
|
||||
|
||||
virtual
|
||||
void updateBoundariesSlaveToMasterIfRequested() = 0;
|
||||
/// return integration method
|
||||
virtual
|
||||
word method()const = 0 ;
|
||||
@ -147,7 +149,7 @@ public:
|
||||
bool correct(real dt, realx3PointField_D& y, realx3PointField_D& dy) = 0;
|
||||
|
||||
virtual
|
||||
bool correct(real dt, realx3Field_D& y, realx3PointField_D& dy) = 0;
|
||||
bool correctPStruct(real dt, pointStructure& pStruct, realx3PointField_D& vel) = 0;
|
||||
|
||||
/// Set the initial values for new indices
|
||||
virtual
|
||||
|
Reference in New Issue
Block a user