keepHistory for integration to automatically remove the fields related to integration. The default is no save on the disk

This commit is contained in:
Hamidreza
2025-04-17 02:41:36 +03:30
parent 077f25842a
commit 98a30bc98c
16 changed files with 69 additions and 33 deletions

View File

@ -97,10 +97,11 @@ pFlow::AdamsBashforth2::AdamsBashforth2
const word& baseName,
pointStructure& pStruct,
const word& method,
const realx3Field_D& initialValField
const realx3Field_D& initialValField,
bool keepHistory
)
:
integration(baseName, pStruct, method, initialValField),
integration(baseName, pStruct, method, initialValField, keepHistory),
realx3PointField_D
(
objectFile
@ -108,7 +109,7 @@ pFlow::AdamsBashforth2::AdamsBashforth2
groupNames(baseName,"dy1"),
pStruct.time().integrationFolder(),
objectFile::READ_IF_PRESENT,
objectFile::WRITE_ALWAYS
keepHistory?objectFile::WRITE_ALWAYS:objectFile::WRITE_NEVER
),
pStruct,
zero3,

View File

@ -81,7 +81,8 @@ public:
const word& baseName,
pointStructure& pStruct,
const word& method,
const realx3Field_D& initialValField);
const realx3Field_D& initialValField,
bool keepHistory);
/// Destructor
~AdamsBashforth2()override = default;

View File

@ -109,10 +109,11 @@ pFlow::AdamsBashforth3::AdamsBashforth3
const word& baseName,
pointStructure& pStruct,
const word& method,
const realx3Field_D& initialValField
const realx3Field_D& initialValField,
bool keepHistory
)
:
AdamsBashforth2(baseName, pStruct, method, initialValField),
AdamsBashforth2(baseName, pStruct, method, initialValField, keepHistory),
dy2_
(
objectFile
@ -120,7 +121,7 @@ pFlow::AdamsBashforth3::AdamsBashforth3
groupNames(baseName,"dy2"),
pStruct.time().integrationFolder(),
objectFile::READ_IF_PRESENT,
objectFile::WRITE_ALWAYS
keepHistory ? objectFile::WRITE_ALWAYS : objectFile::WRITE_NEVER
),
pStruct,
zero3,

View File

@ -71,7 +71,8 @@ public:
const word& baseName,
pointStructure& pStruct,
const word& method,
const realx3Field_D& initialValField);
const realx3Field_D& initialValField,
bool keepHistory);
/// Destructor

View File

@ -115,10 +115,11 @@ pFlow::AdamsBashforth4::AdamsBashforth4
const word& baseName,
pointStructure& pStruct,
const word& method,
const realx3Field_D& initialValField
const realx3Field_D& initialValField,
bool keepHistory
)
:
AdamsBashforth3(baseName, pStruct, method, initialValField),
AdamsBashforth3(baseName, pStruct, method, initialValField, keepHistory),
dy3_
(
objectFile
@ -126,7 +127,7 @@ pFlow::AdamsBashforth4::AdamsBashforth4
groupNames(baseName,"dy3"),
pStruct.time().integrationFolder(),
objectFile::READ_IF_PRESENT,
objectFile::WRITE_ALWAYS
keepHistory?objectFile::WRITE_ALWAYS:objectFile::WRITE_NEVER
),
pStruct,
zero3,

View File

@ -69,7 +69,8 @@ public:
const word& baseName,
pointStructure& pStruct,
const word& method,
const realx3Field_D& initialValField);
const realx3Field_D& initialValField,
bool keepHistory);

View File

@ -123,10 +123,11 @@ pFlow::AdamsBashforth5::AdamsBashforth5
const word &baseName,
pointStructure &pStruct,
const word &method,
const realx3Field_D &initialValField
const realx3Field_D &initialValField,
bool keepHistory
)
:
AdamsBashforth4(baseName, pStruct, method, initialValField),
AdamsBashforth4(baseName, pStruct, method, initialValField, keepHistory),
dy4_
(
objectFile
@ -134,7 +135,7 @@ pFlow::AdamsBashforth5::AdamsBashforth5
groupNames(baseName,"dy4"),
pStruct.time().integrationFolder(),
objectFile::READ_IF_PRESENT,
objectFile::WRITE_ALWAYS
keepHistory?objectFile::WRITE_ALWAYS:objectFile::WRITE_NEVER
),
pStruct,
zero3,

View File

@ -68,7 +68,8 @@ public:
const word& baseName,
pointStructure& pStruct,
const word& method,
const realx3Field_D& initialValField);
const realx3Field_D& initialValField,
bool keepHistory);

View File

@ -51,10 +51,12 @@ pFlow::integration::integration(
const word &baseName,
pointStructure &pStruct,
const word &,
const realx3Field_D &)
const realx3Field_D &,
bool keepHistory)
: owner_(*pStruct.owner()),
pStruct_(pStruct),
baseName_(baseName)
baseName_(baseName),
keepHistory_(keepHistory)
{}
@ -64,12 +66,13 @@ pFlow::uniquePtr<pFlow::integration>
const word& baseName,
pointStructure& pStruct,
const word& method,
const realx3Field_D& initialValField
const realx3Field_D& initialValField,
bool keepHistory
)
{
if( wordvCtorSelector_.search(method) )
{
return wordvCtorSelector_[method] (baseName, pStruct, method, initialValField);
return wordvCtorSelector_[method] (baseName, pStruct, method, initialValField, keepHistory);
}
else
{

View File

@ -24,6 +24,7 @@ Licence:
#include "virtualConstructor.hpp"
#include "pointFields.hpp"
#include "Logical.hpp"
namespace pFlow
@ -63,6 +64,8 @@ private:
/// The base name for integration
const word baseName_;
bool keepHistory_;
protected:
bool insertValues(
@ -83,7 +86,8 @@ public:
const word& baseName,
pointStructure& pStruct,
const word& method,
const realx3Field_D& initialValField);
const realx3Field_D& initialValField,
bool keepHistory);
/// Copy constructor
integration(const integration&) = default;
@ -109,9 +113,10 @@ public:
const word& baseName,
pointStructure& pStruct,
const word& method,
const realx3Field_D& initialValField
const realx3Field_D& initialValField,
bool keepHistory
),
(baseName, pStruct, method, initialValField)
(baseName, pStruct, method, initialValField, keepHistory)
);
@ -138,6 +143,11 @@ public:
return owner_;
}
bool keepHistory()const
{
return keepHistory_;
}
virtual
void updateBoundariesSlaveToMasterIfRequested() = 0;
/// return integration method
@ -164,7 +174,8 @@ public:
const word& baseName,
pointStructure& pStruct,
const word& method,
const realx3Field_D& initialValField);
const realx3Field_D& initialValField,
bool keepHistory);
}; // integration