mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-07-08 03:07:03 +00:00
Merge branch 'develop' into MPIdev after first commit after code loss
This commit is contained in:
63
src/Integration/AdamsBashforth2/AB2Kernels.hpp
Normal file
63
src/Integration/AdamsBashforth2/AB2Kernels.hpp
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#ifndef __AB2Kernels_hpp__
|
||||||
|
#define __AB2Kernels_hpp__
|
||||||
|
|
||||||
|
#include "KokkosTypes.hpp"
|
||||||
|
#include "types.hpp"
|
||||||
|
|
||||||
|
namespace pFlow::AB2Kernels
|
||||||
|
{
|
||||||
|
inline
|
||||||
|
bool intAllActive(
|
||||||
|
const word& name,
|
||||||
|
real dt,
|
||||||
|
rangeU32 activeRng,
|
||||||
|
const deviceViewType1D<realx3>& y,
|
||||||
|
const deviceViewType1D<realx3>& dy,
|
||||||
|
const deviceViewType1D<realx3>& dy1
|
||||||
|
)
|
||||||
|
{
|
||||||
|
Kokkos::parallel_for(
|
||||||
|
name,
|
||||||
|
deviceRPolicyStatic (activeRng.start(), activeRng.end()),
|
||||||
|
LAMBDA_HD(uint32 i){
|
||||||
|
y[i] += dt*(static_cast<real>(1.5) * dy[i] - static_cast<real>(0.5) * dy1[i]);
|
||||||
|
dy1[i] = dy[i];
|
||||||
|
});
|
||||||
|
Kokkos::fence();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
bool intScattered
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
real dt,
|
||||||
|
const pFlagTypeDevice& activePoints,
|
||||||
|
const deviceViewType1D<realx3>& y,
|
||||||
|
const deviceViewType1D<realx3>& dy,
|
||||||
|
const deviceViewType1D<realx3>& dy1
|
||||||
|
)
|
||||||
|
{
|
||||||
|
|
||||||
|
Kokkos::parallel_for(
|
||||||
|
name,
|
||||||
|
deviceRPolicyStatic (activePoints.activeRange().start(), activePoints.activeRange().end()),
|
||||||
|
LAMBDA_HD(uint32 i){
|
||||||
|
if( activePoints(i))
|
||||||
|
{
|
||||||
|
y[i] += dt*(static_cast<real>(1.5) * dy[i] - static_cast<real>(0.5) * dy1[i]);
|
||||||
|
dy1[i] = dy[i];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Kokkos::fence();
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
55
src/Integration/boundaries/boundaryIntegration.cpp
Normal file
55
src/Integration/boundaries/boundaryIntegration.cpp
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
#include "boundaryIntegration.hpp"
|
||||||
|
#include "pointStructure.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
pFlow::boundaryIntegration::boundaryIntegration(
|
||||||
|
const boundaryBase &boundary,
|
||||||
|
const pointStructure &pStruct,
|
||||||
|
const word &method,
|
||||||
|
integration& intgrtn
|
||||||
|
)
|
||||||
|
:
|
||||||
|
generalBoundary(boundary, pStruct, "", method),
|
||||||
|
integration_(intgrtn)
|
||||||
|
{}
|
||||||
|
|
||||||
|
pFlow::uniquePtr<pFlow::boundaryIntegration> pFlow::boundaryIntegration::create(
|
||||||
|
const boundaryBase &boundary,
|
||||||
|
const pointStructure &pStruct,
|
||||||
|
const word &method,
|
||||||
|
integration& intgrtn
|
||||||
|
)
|
||||||
|
{
|
||||||
|
|
||||||
|
word bType = angleBracketsNames2(
|
||||||
|
"boundaryIntegration",
|
||||||
|
boundary.type(),
|
||||||
|
method);
|
||||||
|
|
||||||
|
word altBType{"boundaryIntegration<none>"};
|
||||||
|
|
||||||
|
if( boundaryBasevCtorSelector_.search(bType) )
|
||||||
|
{
|
||||||
|
pOutput.space(4)<<"Creating boundary "<< Green_Text(bType)<<
|
||||||
|
" for "<<boundary.name()<<endl;
|
||||||
|
return boundaryBasevCtorSelector_[bType](boundary, pStruct, method, intgrtn);
|
||||||
|
}
|
||||||
|
else if(boundaryBasevCtorSelector_.search(altBType))
|
||||||
|
{
|
||||||
|
pOutput.space(4)<<"Creating boundary "<< Green_Text(altBType)<<
|
||||||
|
" for "<<boundary.name()<<endl;
|
||||||
|
return boundaryBasevCtorSelector_[altBType](boundary, pStruct, method, intgrtn);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printKeys(
|
||||||
|
fatalError << "Ctor Selector "<< bType<<
|
||||||
|
" and "<< altBType << " do not exist. \n"
|
||||||
|
<<"Avaiable ones are: \n",
|
||||||
|
boundaryBasevCtorSelector_
|
||||||
|
);
|
||||||
|
fatalExit;
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
91
src/Integration/boundaries/boundaryIntegration.hpp
Normal file
91
src/Integration/boundaries/boundaryIntegration.hpp
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
|
||||||
|
#ifndef __boundaryIntegration_hpp__
|
||||||
|
#define __boundaryIntegration_hpp__
|
||||||
|
|
||||||
|
|
||||||
|
#include "generalBoundary.hpp"
|
||||||
|
#include "virtualConstructor.hpp"
|
||||||
|
#include "pointFields.hpp"
|
||||||
|
|
||||||
|
namespace pFlow
|
||||||
|
{
|
||||||
|
|
||||||
|
class integration;
|
||||||
|
|
||||||
|
class boundaryIntegration
|
||||||
|
:
|
||||||
|
public generalBoundary
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
const integration& integration_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
TypeInfo("boundaryIntegration<none>");
|
||||||
|
|
||||||
|
boundaryIntegration(
|
||||||
|
const boundaryBase& boundary,
|
||||||
|
const pointStructure& pStruct,
|
||||||
|
const word& method,
|
||||||
|
integration& intgrtn);
|
||||||
|
|
||||||
|
~boundaryIntegration()override = default;
|
||||||
|
|
||||||
|
create_vCtor(
|
||||||
|
boundaryIntegration,
|
||||||
|
boundaryBase,
|
||||||
|
(
|
||||||
|
const boundaryBase& boundary,
|
||||||
|
const pointStructure& pStruct,
|
||||||
|
const word& method,
|
||||||
|
integration& intgrtn
|
||||||
|
),
|
||||||
|
(boundary, pStruct, method, intgrtn)
|
||||||
|
);
|
||||||
|
|
||||||
|
add_vCtor(
|
||||||
|
boundaryIntegration,
|
||||||
|
boundaryIntegration,
|
||||||
|
boundaryBase
|
||||||
|
);
|
||||||
|
|
||||||
|
bool hearChanges(
|
||||||
|
real t,
|
||||||
|
real dt,
|
||||||
|
uint32 iter,
|
||||||
|
const message &msg,
|
||||||
|
const anyList &varList) override
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const integration& Integration()const
|
||||||
|
{
|
||||||
|
return integration_;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual
|
||||||
|
bool correct(real dt, const realx3PointField_D& y, const realx3PointField_D& dy)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual
|
||||||
|
bool correctPStruct(real dt, const realx3PointField_D& vel)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
uniquePtr<boundaryIntegration> create(
|
||||||
|
const boundaryBase& boundary,
|
||||||
|
const pointStructure& pStruct,
|
||||||
|
const word& method,
|
||||||
|
integration& intgrtn);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
41
src/Integration/boundaries/boundaryIntegrationList.cpp
Normal file
41
src/Integration/boundaries/boundaryIntegrationList.cpp
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
#include "boundaryIntegrationList.hpp"
|
||||||
|
#include "integration.hpp"
|
||||||
|
|
||||||
|
pFlow::boundaryIntegrationList::boundaryIntegrationList(
|
||||||
|
const pointStructure &pStruct,
|
||||||
|
const word &method,
|
||||||
|
integration &intgrtn
|
||||||
|
)
|
||||||
|
:
|
||||||
|
ListPtr<boundaryIntegration>(6),
|
||||||
|
boundaries_(pStruct.boundaries())
|
||||||
|
{
|
||||||
|
|
||||||
|
for(uint32 i=0; i<6; i++)
|
||||||
|
{
|
||||||
|
this->set(
|
||||||
|
i,
|
||||||
|
boundaryIntegration::create(
|
||||||
|
boundaries_[i],
|
||||||
|
pStruct,
|
||||||
|
method,
|
||||||
|
intgrtn
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool pFlow::boundaryIntegrationList::correct(real dt, realx3PointField_D &y, realx3PointField_D &dy)
|
||||||
|
{
|
||||||
|
for(auto& bndry:*this)
|
||||||
|
{
|
||||||
|
if(!bndry->correct(dt, y, dy))
|
||||||
|
{
|
||||||
|
fatalErrorInFunction;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
45
src/Integration/boundaries/boundaryIntegrationList.hpp
Normal file
45
src/Integration/boundaries/boundaryIntegrationList.hpp
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
|
||||||
|
#ifndef __boundaryIntegrationList_hpp__
|
||||||
|
#define __boundaryIntegrationList_hpp__
|
||||||
|
|
||||||
|
|
||||||
|
#include "boundaryList.hpp"
|
||||||
|
#include "ListPtr.hpp"
|
||||||
|
#include "boundaryIntegration.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace pFlow
|
||||||
|
{
|
||||||
|
|
||||||
|
class integration;
|
||||||
|
|
||||||
|
class boundaryIntegrationList
|
||||||
|
:
|
||||||
|
public ListPtr<boundaryIntegration>
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
const boundaryList& boundaries_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
boundaryIntegrationList(
|
||||||
|
const pointStructure& pStruct,
|
||||||
|
const word& method,
|
||||||
|
integration& intgrtn
|
||||||
|
);
|
||||||
|
|
||||||
|
~boundaryIntegrationList()=default;
|
||||||
|
|
||||||
|
bool correct(
|
||||||
|
real dt,
|
||||||
|
realx3PointField_D& y,
|
||||||
|
realx3PointField_D& dy);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif //__boundaryIntegrationList_hpp__
|
@ -7,8 +7,7 @@ contactSearch/methods/cellBased/NBS/NBS.cpp
|
|||||||
contactSearch/methods/cellBased/NBS/cellsWallLevel0.cpp
|
contactSearch/methods/cellBased/NBS/cellsWallLevel0.cpp
|
||||||
|
|
||||||
contactSearch/boundaries/boundaryContactSearch/boundaryContactSearch.cpp
|
contactSearch/boundaries/boundaryContactSearch/boundaryContactSearch.cpp
|
||||||
contactSearch/boundaries/twoPartContactSearch/twoPartContactSearchKernels.cpp
|
|
||||||
contactSearch/boundaries/twoPartContactSearch/twoPartContactSearch.cpp
|
|
||||||
contactSearch/boundaries/periodicBoundaryContactSearch/ppwBndryContactSearchKernels.cpp
|
contactSearch/boundaries/periodicBoundaryContactSearch/ppwBndryContactSearchKernels.cpp
|
||||||
contactSearch/boundaries/periodicBoundaryContactSearch/ppwBndryContactSearch.cpp
|
contactSearch/boundaries/periodicBoundaryContactSearch/ppwBndryContactSearch.cpp
|
||||||
contactSearch/boundaries/periodicBoundaryContactSearch/wallBoundaryContactSearch.cpp
|
contactSearch/boundaries/periodicBoundaryContactSearch/wallBoundaryContactSearch.cpp
|
||||||
@ -28,6 +27,8 @@ if(pFlow_Build_MPI)
|
|||||||
list(APPEND SourceFiles
|
list(APPEND SourceFiles
|
||||||
contactSearch/boundaries/processorBoundaryContactSearch/processorBoundaryContactSearch.cpp
|
contactSearch/boundaries/processorBoundaryContactSearch/processorBoundaryContactSearch.cpp
|
||||||
sphereInteraction/boundaries/processorBoundarySphereInteraction/processorBoundarySphereInteractions.cpp
|
sphereInteraction/boundaries/processorBoundarySphereInteraction/processorBoundarySphereInteractions.cpp
|
||||||
|
contactSearch/boundaries/twoPartContactSearch/twoPartContactSearchKernels.cpp
|
||||||
|
contactSearch/boundaries/twoPartContactSearch/twoPartContactSearch.cpp
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
64
src/Particles/SphereParticles/boundarySphereParticles.cpp
Normal file
64
src/Particles/SphereParticles/boundarySphereParticles.cpp
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
#include "boundarySphereParticles.hpp"
|
||||||
|
#include "boundaryBase.hpp"
|
||||||
|
#include "sphereParticles.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
pFlow::boundarySphereParticles::boundarySphereParticles(
|
||||||
|
const boundaryBase &boundary,
|
||||||
|
sphereParticles &prtcls
|
||||||
|
)
|
||||||
|
:
|
||||||
|
generalBoundary(boundary, prtcls.pStruct(), "", ""),
|
||||||
|
particles_(prtcls)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
pFlow::sphereParticles &pFlow::boundarySphereParticles::Particles()
|
||||||
|
{
|
||||||
|
return particles_;
|
||||||
|
}
|
||||||
|
|
||||||
|
const pFlow::sphereParticles &pFlow::boundarySphereParticles::Particles() const
|
||||||
|
{
|
||||||
|
return particles_;
|
||||||
|
}
|
||||||
|
|
||||||
|
pFlow::uniquePtr<pFlow::boundarySphereParticles> pFlow::boundarySphereParticles::create(
|
||||||
|
const boundaryBase &boundary,
|
||||||
|
sphereParticles &prtcls
|
||||||
|
)
|
||||||
|
{
|
||||||
|
|
||||||
|
word bType = angleBracketsNames2(
|
||||||
|
"boundarySphereParticles",
|
||||||
|
pFlowProcessors().localRunTypeName(),
|
||||||
|
boundary.type());
|
||||||
|
|
||||||
|
word altBType{"boundarySphereParticles<none>"};
|
||||||
|
|
||||||
|
if( boundaryBasevCtorSelector_.search(bType) )
|
||||||
|
{
|
||||||
|
pOutput.space(4)<<"Creating boundary "<< Green_Text(bType)<<
|
||||||
|
" for "<<boundary.name()<<endl;
|
||||||
|
return boundaryBasevCtorSelector_[bType](boundary, prtcls);
|
||||||
|
}
|
||||||
|
else if(boundaryBasevCtorSelector_.search(altBType))
|
||||||
|
{
|
||||||
|
pOutput.space(4)<<"Creating boundary "<< Green_Text(altBType)<<
|
||||||
|
" for "<<boundary.name()<<endl;
|
||||||
|
return boundaryBasevCtorSelector_[altBType](boundary, prtcls);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printKeys(
|
||||||
|
fatalError << "Ctor Selector "<< bType<<
|
||||||
|
" and "<< altBType << " do not exist. \n"
|
||||||
|
<<"Avaiable ones are: \n",
|
||||||
|
boundaryBasevCtorSelector_
|
||||||
|
);
|
||||||
|
fatalExit;
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
80
src/Particles/SphereParticles/boundarySphereParticles.hpp
Normal file
80
src/Particles/SphereParticles/boundarySphereParticles.hpp
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#ifndef __boundarySphereParticles_hpp__
|
||||||
|
#define __boundarySphereParticles_hpp__
|
||||||
|
|
||||||
|
#include "generalBoundary.hpp"
|
||||||
|
#include "virtualConstructor.hpp"
|
||||||
|
#include "timeInfo.hpp"
|
||||||
|
|
||||||
|
namespace pFlow
|
||||||
|
{
|
||||||
|
|
||||||
|
class sphereParticles;
|
||||||
|
|
||||||
|
class boundarySphereParticles
|
||||||
|
: public generalBoundary
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
sphereParticles& particles_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
/// type info
|
||||||
|
TypeInfo("boundarySphereParticles<none>");
|
||||||
|
|
||||||
|
boundarySphereParticles(
|
||||||
|
const boundaryBase &boundary,
|
||||||
|
sphereParticles& prtcls
|
||||||
|
);
|
||||||
|
|
||||||
|
create_vCtor(
|
||||||
|
boundarySphereParticles,
|
||||||
|
boundaryBase,
|
||||||
|
(
|
||||||
|
const boundaryBase &boundary,
|
||||||
|
sphereParticles& prtcls
|
||||||
|
),
|
||||||
|
(boundary, prtcls)
|
||||||
|
);
|
||||||
|
|
||||||
|
add_vCtor(
|
||||||
|
boundarySphereParticles,
|
||||||
|
boundarySphereParticles,
|
||||||
|
boundaryBase
|
||||||
|
);
|
||||||
|
|
||||||
|
sphereParticles& Particles();
|
||||||
|
|
||||||
|
const sphereParticles& Particles()const;
|
||||||
|
|
||||||
|
bool hearChanges(
|
||||||
|
real t,
|
||||||
|
real dt,
|
||||||
|
uint32 iter,
|
||||||
|
const message &msg,
|
||||||
|
const anyList &varList) override
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual
|
||||||
|
bool acceleration(const timeInfo& ti, const realx3& g)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
uniquePtr<boundarySphereParticles> create(
|
||||||
|
const boundaryBase &boundary,
|
||||||
|
sphereParticles& prtcls);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,19 @@
|
|||||||
|
#include "boundarySphereParticlesList.hpp"
|
||||||
|
|
||||||
|
pFlow::boundarySphereParticlesList::boundarySphereParticlesList(
|
||||||
|
const boundaryList &bndrs,
|
||||||
|
sphereParticles &prtcls
|
||||||
|
)
|
||||||
|
:
|
||||||
|
ListPtr(bndrs.size()),
|
||||||
|
boundaries_(bndrs)
|
||||||
|
{
|
||||||
|
for(auto i=0; i<boundaries_.size(); i++)
|
||||||
|
{
|
||||||
|
this->set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
boundarySphereParticles::create(boundaries_[i], prtcls)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#ifndef __boundarySphereParticlesList_hpp__
|
||||||
|
#define __boundarySphereParticlesList_hpp__
|
||||||
|
|
||||||
|
#include "ListPtr.hpp"
|
||||||
|
#include "boundaryList.hpp"
|
||||||
|
#include "boundarySphereParticles.hpp"
|
||||||
|
|
||||||
|
namespace pFlow
|
||||||
|
{
|
||||||
|
|
||||||
|
class boundarySphereParticlesList
|
||||||
|
:
|
||||||
|
public ListPtr<boundarySphereParticles>
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
const boundaryList& boundaries_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
boundarySphereParticlesList(
|
||||||
|
const boundaryList& bndrs,
|
||||||
|
sphereParticles& prtcls
|
||||||
|
);
|
||||||
|
|
||||||
|
~boundarySphereParticlesList()=default;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@ -21,12 +21,16 @@ Licence:
|
|||||||
template<class T, class MemorySpace>
|
template<class T, class MemorySpace>
|
||||||
bool pFlow::Field<T, MemorySpace>::read
|
bool pFlow::Field<T, MemorySpace>::read
|
||||||
(
|
(
|
||||||
iIstream& is
|
iIstream& is,
|
||||||
|
bool resume
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
||||||
bool tokenFound = true;
|
bool tokenFound = true;
|
||||||
|
|
||||||
|
if(resume)
|
||||||
|
tokenFound = is.findTokenResume(fieldKey_);
|
||||||
|
else
|
||||||
tokenFound = is.findToken(fieldKey_);
|
tokenFound = is.findToken(fieldKey_);
|
||||||
|
|
||||||
if( !tokenFound )
|
if( !tokenFound )
|
||||||
@ -53,14 +57,21 @@ template<class T, class MemorySpace>
|
|||||||
bool pFlow::Field<T, MemorySpace>::read
|
bool pFlow::Field<T, MemorySpace>::read
|
||||||
(
|
(
|
||||||
iIstream& is,
|
iIstream& is,
|
||||||
const IOPattern& iop
|
const IOPattern& iop,
|
||||||
|
bool resume
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
||||||
bool tokenFound = true;
|
bool tokenFound = true;
|
||||||
|
|
||||||
if(iop.thisProcReadData())
|
if(iop.thisProcReadData())
|
||||||
|
{
|
||||||
|
if(resume)
|
||||||
|
tokenFound = is.findTokenResume(fieldKey_);
|
||||||
|
else
|
||||||
tokenFound = is.findToken(fieldKey_);
|
tokenFound = is.findToken(fieldKey_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if( !tokenFound )
|
if( !tokenFound )
|
||||||
{
|
{
|
||||||
|
@ -197,12 +197,12 @@ public:
|
|||||||
|
|
||||||
//// - IO operations
|
//// - IO operations
|
||||||
|
|
||||||
bool read(iIstream& is);
|
bool read(iIstream& is, bool resume = false);
|
||||||
|
|
||||||
bool write(iOstream& os)const;
|
bool write(iOstream& os)const;
|
||||||
|
|
||||||
|
|
||||||
bool read(iIstream& is, const IOPattern& iop);
|
bool read(iIstream& is, const IOPattern& iop, bool resume = false);
|
||||||
|
|
||||||
|
|
||||||
bool write(iOstream& os, const IOPattern& iop )const;
|
bool write(iOstream& os, const IOPattern& iop )const;
|
||||||
|
10
src/phasicFlow/globals/boundaryConfigs.hpp
Normal file
10
src/phasicFlow/globals/boundaryConfigs.hpp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#ifndef __boundaryConfigs_hpp__
|
||||||
|
#define __boundaryConfigs_hpp__
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BoundaryModel1
|
||||||
|
//#define BoundaryModel1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif //__boundaryConfigs_hpp__
|
88
src/phasicFlow/processors/MPITimer.cpp
Normal file
88
src/phasicFlow/processors/MPITimer.cpp
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
#include "MPITimer.hpp"
|
||||||
|
|
||||||
|
#ifdef pFlow_Build_MPI
|
||||||
|
#include "pFlowProcessors.hpp"
|
||||||
|
#include "procCommunication.hpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
pFlow::real pFlow::MPITimer::totalTimeMax() const
|
||||||
|
{
|
||||||
|
return accTimersTotalMax();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<pFlow::real> pFlow::MPITimer::totalTimeAllToAll() const
|
||||||
|
{
|
||||||
|
#ifdef pFlow_Build_MPI
|
||||||
|
MPI::procCommunication comm(pFlowProcessors());
|
||||||
|
auto [totTime, succs] = comm.collectAllToAll(totalTime());
|
||||||
|
return totTime;
|
||||||
|
#else
|
||||||
|
return std::vector<real>(1, totalTime());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<pFlow::real> pFlow::MPITimer::totalTimeAllToMaster() const
|
||||||
|
{
|
||||||
|
#ifdef pFlow_Build_MPI
|
||||||
|
MPI::procCommunication comm(pFlowProcessors());
|
||||||
|
auto [totTime, succs] = comm.collectAllToMaster(totalTime());
|
||||||
|
return totTime;
|
||||||
|
#else
|
||||||
|
return std::vector<real>(1, totalTime());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
pFlow::real pFlow::MPITimer::averageTimeMax() const
|
||||||
|
{
|
||||||
|
return Timer::averageTimeMax();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<pFlow::real> pFlow::MPITimer::averageTimeAllToAll() const
|
||||||
|
{
|
||||||
|
#ifdef pFlow_Build_MPI
|
||||||
|
MPI::procCommunication comm(pFlowProcessors());
|
||||||
|
auto [totTime, succs] = comm.collectAllToAll(averageTime());
|
||||||
|
return totTime;
|
||||||
|
#else
|
||||||
|
return std::vector<real>(1, averageTime());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<pFlow::real> pFlow::MPITimer::averageTimeAllAtoMaster() const
|
||||||
|
{
|
||||||
|
#ifdef pFlow_Build_MPI
|
||||||
|
MPI::procCommunication comm(pFlowProcessors());
|
||||||
|
auto [totTime, succs] = comm.collectAllToMaster(averageTime());
|
||||||
|
return totTime;
|
||||||
|
#else
|
||||||
|
return std::vector<real>(1, averageTime());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
bool pFlow::MPITimer::write(iOstream &os) const
|
||||||
|
{
|
||||||
|
const auto ts = totalTimeAllToAll();
|
||||||
|
auto maxloc = std::distance(ts.begin(), std::max_element(ts.begin(), ts.end()));
|
||||||
|
os<<'(';
|
||||||
|
for(auto i=0; i<ts.size(); i++)
|
||||||
|
{
|
||||||
|
if(maxloc == i)
|
||||||
|
os<<Red_Text(ts[i]);
|
||||||
|
else
|
||||||
|
os<<ts[i];
|
||||||
|
|
||||||
|
if(i != ts.size()-1)
|
||||||
|
os<<' ';
|
||||||
|
else
|
||||||
|
os<<')'<<endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static pFlow::MPITimer ComputationTimer__{"ComputationTimer"};
|
||||||
|
|
||||||
|
pFlow::MPITimer &pFlow::ComputationTimer()
|
||||||
|
{
|
||||||
|
return ComputationTimer__;
|
||||||
|
}
|
55
src/phasicFlow/processors/MPITimer.hpp
Normal file
55
src/phasicFlow/processors/MPITimer.hpp
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#ifndef __MPITimer_hpp__
|
||||||
|
#define __MPITimer_hpp__
|
||||||
|
|
||||||
|
#include "Timer.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace pFlow
|
||||||
|
{
|
||||||
|
|
||||||
|
class MPITimer
|
||||||
|
:
|
||||||
|
public Timer
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
// hiding methods
|
||||||
|
using Timer::accTimersTotal;
|
||||||
|
using Timer::averageTime;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
TypeInfo("MPITimer");
|
||||||
|
|
||||||
|
explicit MPITimer(const word& name)
|
||||||
|
:
|
||||||
|
Timer(name)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
real totalTimeMax()const;
|
||||||
|
|
||||||
|
std::vector<real> totalTimeAllToAll()const;
|
||||||
|
|
||||||
|
std::vector<real> totalTimeAllToMaster()const;
|
||||||
|
|
||||||
|
real averageTimeMax()const;
|
||||||
|
|
||||||
|
std::vector<real> averageTimeAllToAll()const;
|
||||||
|
|
||||||
|
std::vector<real> averageTimeAllAtoMaster()const;
|
||||||
|
|
||||||
|
// call this from all processors in pFlowProcessors
|
||||||
|
bool write(iOstream& os)const;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
MPITimer& ComputationTimer();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@ -126,7 +126,6 @@ bool pFlow::IOobject::writeObject() const
|
|||||||
{
|
{
|
||||||
if(auto ptrOS = outStream(); ptrOS )
|
if(auto ptrOS = outStream(); ptrOS )
|
||||||
{
|
{
|
||||||
pOutput<<"Should write field "<<name() <<" file "<<ptrOS->name()<<endl;
|
|
||||||
return writeObject(ptrOS());
|
return writeObject(ptrOS());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -141,7 +140,6 @@ bool pFlow::IOobject::writeObject() const
|
|||||||
|
|
||||||
if(auto ptrOS = dummyOutStream(); ptrOS )
|
if(auto ptrOS = dummyOutStream(); ptrOS )
|
||||||
{
|
{
|
||||||
pOutput<<"Should write field "<< name()<< " file " <<ptrOS->name()<<endl;
|
|
||||||
return writeObject(ptrOS());
|
return writeObject(ptrOS());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
50
src/phasicFlow/structuredData/boundaries/boundariesMask.hpp
Normal file
50
src/phasicFlow/structuredData/boundaries/boundariesMask.hpp
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
|
||||||
|
#ifndef __boundariesMask_hpp__
|
||||||
|
#define __boundariesMask_hpp__
|
||||||
|
|
||||||
|
#include <array>
|
||||||
|
|
||||||
|
namespace pFlow
|
||||||
|
{
|
||||||
|
|
||||||
|
template<size_t N>
|
||||||
|
class boundariesMask
|
||||||
|
:
|
||||||
|
public std::array<bool,N>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
boundariesMask()=default;
|
||||||
|
|
||||||
|
boundariesMask(bool val)
|
||||||
|
{
|
||||||
|
this->fill(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
boundariesMask(std::initializer_list<bool> l)
|
||||||
|
:
|
||||||
|
std::array<bool,N>(l)
|
||||||
|
{}
|
||||||
|
|
||||||
|
inline
|
||||||
|
bool allElements(bool val)
|
||||||
|
{
|
||||||
|
return std::all_of(this->begin(), this->end(), [val](bool v) { return v==val;} );
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
bool anyElement(bool val)
|
||||||
|
{
|
||||||
|
return std::any_of(this->begin(), this->end(), [val](bool v) { return v==val;} );
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
bool noElement(bool val)
|
||||||
|
{
|
||||||
|
return std::none_of(this->begin(), this->end(), [val](bool v) { return v==val;} );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //__boundariesMask_hpp__
|
@ -257,7 +257,7 @@ pFlow::triSurface::triSurface
|
|||||||
bool pFlow::triSurface::read(iIstream &is, const IOPattern &iop)
|
bool pFlow::triSurface::read(iIstream &is, const IOPattern &iop)
|
||||||
{
|
{
|
||||||
points_.clear();
|
points_.clear();
|
||||||
if(!points_.read(is, iop))
|
if(!points_.read(is, iop, true))
|
||||||
{
|
{
|
||||||
ioErrorInFile(is.name(), is.lineNumber())<<
|
ioErrorInFile(is.name(), is.lineNumber())<<
|
||||||
" when reading field "<< points_.name()<<endl;
|
" when reading field "<< points_.name()<<endl;
|
||||||
@ -265,7 +265,7 @@ bool pFlow::triSurface::read(iIstream &is, const IOPattern &iop)
|
|||||||
}
|
}
|
||||||
|
|
||||||
vertices_.clear();
|
vertices_.clear();
|
||||||
if(!vertices_.read(is, iop))
|
if(!vertices_.read(is, iop, true))
|
||||||
{
|
{
|
||||||
ioErrorInFile(is.name(), is.lineNumber())<<
|
ioErrorInFile(is.name(), is.lineNumber())<<
|
||||||
" when reading field "<< vertices_.name()<<endl;
|
" when reading field "<< vertices_.name()<<endl;
|
||||||
|
Reference in New Issue
Block a user