Motion models integrated into geometryMotion, stationaryWall is added
This commit is contained in:
parent
9dfe98eea2
commit
5b4a524afe
|
@ -7,11 +7,13 @@ add_subdirectory(Property)
|
||||||
|
|
||||||
add_subdirectory(Particles)
|
add_subdirectory(Particles)
|
||||||
|
|
||||||
|
add_subdirectory(Geometry)
|
||||||
|
|
||||||
#add_subdirectory(Interaction)
|
#add_subdirectory(Interaction)
|
||||||
|
|
||||||
add_subdirectory(MotionModel)
|
add_subdirectory(MotionModel)
|
||||||
|
|
||||||
#add_subdirectory(Geometry)
|
|
||||||
|
|
||||||
|
|
||||||
#add_subdirectory(MPIParallelization)
|
#add_subdirectory(MPIParallelization)
|
||||||
|
|
|
@ -19,33 +19,41 @@ Licence:
|
||||||
-----------------------------------------------------------------------------*/
|
-----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "geometry.hpp"
|
#include "geometry.hpp"
|
||||||
|
#include "systemControl.hpp"
|
||||||
#include "vocabs.hpp"
|
#include "vocabs.hpp"
|
||||||
|
|
||||||
|
|
||||||
bool pFlow::geometry::findPropertyId()
|
bool pFlow::geometry::createPropertyId()
|
||||||
{
|
{
|
||||||
|
if(materialName_.size() != numSurfaces() )
|
||||||
int8Vector propId(0, surface().capacity(),RESERVE());
|
|
||||||
propId.clear();
|
|
||||||
|
|
||||||
uint32 pId;
|
|
||||||
ForAll(matI, materialName_)
|
|
||||||
{
|
{
|
||||||
|
fatalErrorInFunction<<
|
||||||
|
"number of subSurface and material names do not match"<<endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32Vector propId(
|
||||||
|
"propId",
|
||||||
|
surface().capacity(),
|
||||||
|
surface().size(),
|
||||||
|
RESERVE());
|
||||||
|
|
||||||
|
ForAll(i, materialName_)
|
||||||
|
{
|
||||||
|
uint32 pIdx =0;
|
||||||
|
|
||||||
if( !wallProperty_.nameToIndex( materialName_[matI], pId ) )
|
if( !wallProperty_.nameToIndex(materialName_[i], pIdx) )
|
||||||
{
|
{
|
||||||
fatalErrorInFunction<<
|
fatalErrorInFunction<<
|
||||||
"material name for the geometry is invalid: "<< materialName_[matI]<<endl;
|
"Property/material name is invalid "<<materialName_[i]<<
|
||||||
return false;
|
". A list of valid names are \n"<< wallProperty_.materials()<<endl;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 surfSize = surface().surfNumTriangles(matI);
|
auto triRange = subSurfaceRange(i);
|
||||||
|
propId.fill(triRange.start(), triRange.end(), pIdx);
|
||||||
for(int32 i=0; i<surfSize; i++)
|
|
||||||
{
|
}
|
||||||
propId.push_back(pId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
propertyId_.assign(propId);
|
propertyId_.assign(propId);
|
||||||
|
|
||||||
|
@ -59,77 +67,245 @@ pFlow::geometry::geometry
|
||||||
const property& prop
|
const property& prop
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
demGeometry(control),
|
multiTriSurface
|
||||||
|
(
|
||||||
|
objectFile
|
||||||
|
(
|
||||||
|
triSurfaceFile__,
|
||||||
|
"",
|
||||||
|
objectFile::READ_ALWAYS,
|
||||||
|
objectFile::WRITE_ALWAYS
|
||||||
|
),
|
||||||
|
&control.geometry()
|
||||||
|
),
|
||||||
|
demComponent
|
||||||
|
(
|
||||||
|
"geometry",
|
||||||
|
control
|
||||||
|
),
|
||||||
wallProperty_(prop),
|
wallProperty_(prop),
|
||||||
geometryRepository_(control.geometry()),
|
motionComponentName_
|
||||||
triSurface_(
|
(
|
||||||
control.geometry().emplaceObject<multiTriSurface>(
|
"motionComponentName",
|
||||||
objectFile(
|
"motionComponentName"
|
||||||
"triSurface",
|
),
|
||||||
"",
|
materialName_
|
||||||
objectFile::READ_ALWAYS,
|
(
|
||||||
objectFile::WRITE_ALWAYS
|
"materialName",
|
||||||
)
|
"materialName"
|
||||||
)
|
),
|
||||||
|
propertyId_
|
||||||
|
(
|
||||||
|
objectFile
|
||||||
|
(
|
||||||
|
"propertyId",
|
||||||
|
"",
|
||||||
|
objectFile::READ_NEVER,
|
||||||
|
objectFile::WRITE_NEVER
|
||||||
),
|
),
|
||||||
motionComponentName_(
|
*this,
|
||||||
control.geometry().emplaceObject<wordField>(
|
0u
|
||||||
objectFile(
|
),
|
||||||
"motionComponentName",
|
contactForceWall_
|
||||||
"",
|
(
|
||||||
objectFile::READ_ALWAYS,
|
objectFile
|
||||||
objectFile::WRITE_ALWAYS
|
(
|
||||||
),
|
"contactForcWall",
|
||||||
"motionNamesList"
|
"",
|
||||||
)
|
objectFile::READ_IF_PRESENT,
|
||||||
|
objectFile::WRITE_NEVER
|
||||||
),
|
),
|
||||||
materialName_(
|
*this,
|
||||||
control.geometry().emplaceObject<wordField>(
|
zero3
|
||||||
objectFile(
|
),
|
||||||
"materialName",
|
normalStressWall_
|
||||||
"",
|
(
|
||||||
objectFile::READ_ALWAYS,
|
objectFile
|
||||||
objectFile::WRITE_ALWAYS
|
(
|
||||||
),
|
"normalStressWall",
|
||||||
"materialNamesList"
|
"",
|
||||||
)
|
objectFile::READ_IF_PRESENT,
|
||||||
|
objectFile::WRITE_NEVER
|
||||||
),
|
),
|
||||||
propertyId_(
|
*this,
|
||||||
control.geometry().emplaceObject<int8TriSurfaceField_D>(
|
zero3
|
||||||
objectFile(
|
),
|
||||||
"propertyId",
|
shearStressWall_
|
||||||
"",
|
(
|
||||||
objectFile::READ_NEVER,
|
objectFile
|
||||||
objectFile::WRITE_NEVER),
|
(
|
||||||
surface(),
|
"shearStressWall",
|
||||||
0 ) ),
|
"",
|
||||||
contactForceWall_(
|
objectFile::READ_IF_PRESENT,
|
||||||
control.geometry().emplaceObject<realx3TriSurfaceField_D>(
|
objectFile::WRITE_NEVER
|
||||||
objectFile(
|
),
|
||||||
"contactForceWall",
|
*this,
|
||||||
"",
|
zero3
|
||||||
objectFile::READ_IF_PRESENT,
|
)
|
||||||
objectFile::WRITE_ALWAYS),
|
|
||||||
surface(),
|
|
||||||
zero3) ),
|
|
||||||
stressWall_(
|
|
||||||
control.geometry().emplaceObject<realx3TriSurfaceField_D>(
|
|
||||||
objectFile(
|
|
||||||
"stressWall",
|
|
||||||
"",
|
|
||||||
objectFile::READ_IF_PRESENT,
|
|
||||||
objectFile::WRITE_ALWAYS),
|
|
||||||
surface(),
|
|
||||||
zero3) )
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if(!findPropertyId())
|
readWholeObject_ = false;
|
||||||
|
if( !IOobject::readObject() )
|
||||||
|
{
|
||||||
|
fatalErrorInFunction<<
|
||||||
|
"Error in reading from file "<<IOobject::path()<<endl;
|
||||||
|
fatalExit;
|
||||||
|
}
|
||||||
|
readWholeObject_ = true;
|
||||||
|
|
||||||
|
if( this->numSurfaces() != motionComponentName_.size() )
|
||||||
|
{
|
||||||
|
fatalErrorInFunction<<
|
||||||
|
"Number of surfaces is not equal to number of motion component names"<<endl;
|
||||||
|
fatalExit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!createPropertyId())
|
||||||
{
|
{
|
||||||
fatalExit;
|
fatalExit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pFlow::geometry::geometry
|
pFlow::geometry::geometry
|
||||||
|
(
|
||||||
|
systemControl &control,
|
||||||
|
const property &prop,
|
||||||
|
multiTriSurface &surf,
|
||||||
|
const wordVector &motionCompName,
|
||||||
|
const wordVector &materialName,
|
||||||
|
const dictionary& motionDict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
multiTriSurface
|
||||||
|
(
|
||||||
|
objectFile
|
||||||
|
(
|
||||||
|
triSurfaceFile__,
|
||||||
|
"",
|
||||||
|
objectFile::READ_NEVER,
|
||||||
|
objectFile::WRITE_ALWAYS
|
||||||
|
),
|
||||||
|
&control.geometry(),
|
||||||
|
surf
|
||||||
|
),
|
||||||
|
demComponent
|
||||||
|
(
|
||||||
|
"geometry",
|
||||||
|
control
|
||||||
|
),
|
||||||
|
wallProperty_
|
||||||
|
(
|
||||||
|
prop
|
||||||
|
),
|
||||||
|
motionComponentName_
|
||||||
|
(
|
||||||
|
"motionComponentName",
|
||||||
|
"motionComponentName"
|
||||||
|
),
|
||||||
|
materialName_
|
||||||
|
(
|
||||||
|
"materialName",
|
||||||
|
"materialName"
|
||||||
|
),
|
||||||
|
propertyId_
|
||||||
|
(
|
||||||
|
objectFile
|
||||||
|
(
|
||||||
|
"propertyId",
|
||||||
|
"",
|
||||||
|
objectFile::READ_NEVER,
|
||||||
|
objectFile::WRITE_NEVER
|
||||||
|
),
|
||||||
|
*this,
|
||||||
|
0u
|
||||||
|
),
|
||||||
|
contactForceWall_
|
||||||
|
(
|
||||||
|
objectFile
|
||||||
|
(
|
||||||
|
"contactForcWall",
|
||||||
|
"",
|
||||||
|
objectFile::READ_IF_PRESENT,
|
||||||
|
objectFile::WRITE_NEVER
|
||||||
|
),
|
||||||
|
*this,
|
||||||
|
zero3
|
||||||
|
),
|
||||||
|
normalStressWall_
|
||||||
|
(
|
||||||
|
objectFile
|
||||||
|
(
|
||||||
|
"normalStressWall",
|
||||||
|
"",
|
||||||
|
objectFile::READ_IF_PRESENT,
|
||||||
|
objectFile::WRITE_NEVER
|
||||||
|
),
|
||||||
|
*this,
|
||||||
|
zero3
|
||||||
|
),
|
||||||
|
shearStressWall_
|
||||||
|
(
|
||||||
|
objectFile
|
||||||
|
(
|
||||||
|
"shearStressWall",
|
||||||
|
"",
|
||||||
|
objectFile::READ_IF_PRESENT,
|
||||||
|
objectFile::WRITE_NEVER
|
||||||
|
),
|
||||||
|
*this,
|
||||||
|
zero3
|
||||||
|
)
|
||||||
|
|
||||||
|
{
|
||||||
|
motionComponentName_.assign(motionCompName);
|
||||||
|
materialName_.assign(materialName);
|
||||||
|
|
||||||
|
|
||||||
|
if( this->numSurfaces() != motionComponentName_.size() )
|
||||||
|
{
|
||||||
|
fatalErrorInFunction<<
|
||||||
|
"Number of surfaces is not equal to number of motion component names"<<endl;
|
||||||
|
fatalExit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!createPropertyId())
|
||||||
|
{
|
||||||
|
fatalExit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool pFlow::geometry::read(iIstream &is, const IOPattern &iop)
|
||||||
|
{
|
||||||
|
motionComponentName_.read(is, iop);
|
||||||
|
materialName_.read(is, iop);
|
||||||
|
|
||||||
|
if( readWholeObject_ )
|
||||||
|
{
|
||||||
|
return multiTriSurface::read(is, iop);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool pFlow::geometry::write(iOstream &os, const IOPattern &iop) const
|
||||||
|
{
|
||||||
|
|
||||||
|
if( !motionComponentName_.write(os, iop) )
|
||||||
|
{
|
||||||
|
fatalErrorInFunction;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !materialName_.write(os,iop))
|
||||||
|
{
|
||||||
|
fatalErrorInFunction;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return multiTriSurface::write(os,iop);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*pFlow::geometry::geometry
|
||||||
(
|
(
|
||||||
systemControl& control,
|
systemControl& control,
|
||||||
const property& prop,
|
const property& prop,
|
||||||
|
@ -296,23 +472,25 @@ bool pFlow::geometry::afterIteration()
|
||||||
Kokkos::fence();
|
Kokkos::fence();
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
|
||||||
pFlow::uniquePtr<pFlow::geometry>
|
pFlow::uniquePtr<pFlow::geometry>
|
||||||
pFlow::geometry::create(
|
pFlow::geometry::create
|
||||||
systemControl& control,
|
(
|
||||||
const property& prop,
|
systemControl& control,
|
||||||
const dictionary& dict,
|
const property& prop,
|
||||||
const multiTriSurface& triSurface,
|
multiTriSurface& surf,
|
||||||
const wordVector& motionCompName,
|
const wordVector& motionCompName,
|
||||||
const wordVector& propName)
|
const wordVector& materialName,
|
||||||
|
const dictionary& motionDic
|
||||||
|
)
|
||||||
{
|
{
|
||||||
|
|
||||||
word model = dict.getVal<word>("motionModel");
|
word model = motionDic.getVal<word>("motionModel");
|
||||||
|
|
||||||
auto geomModel = angleBracketsNames("geometry", model);
|
auto geomModel = angleBracketsNames("geometry", model);
|
||||||
|
|
||||||
REPORT(1)<< "Selecting geometry model . . ."<<endREPORT;
|
REPORT(1)<< "Selecting geometry model . . ."<<END_REPORT;
|
||||||
|
|
||||||
if( dictionaryvCtorSelector_.search(geomModel) )
|
if( dictionaryvCtorSelector_.search(geomModel) )
|
||||||
{
|
{
|
||||||
|
@ -320,19 +498,19 @@ pFlow::uniquePtr<pFlow::geometry>
|
||||||
(
|
(
|
||||||
control,
|
control,
|
||||||
prop,
|
prop,
|
||||||
dict,
|
surf,
|
||||||
triSurface,
|
|
||||||
motionCompName,
|
motionCompName,
|
||||||
propName
|
materialName,
|
||||||
|
motionDic
|
||||||
);
|
);
|
||||||
REPORT(2)<<"Model "<< greenText(geomModel)<<" is created.\n"<<endREPORT;
|
REPORT(2)<<"Model "<< Green_Text(geomModel)<<" is created.\n"<<END_REPORT;
|
||||||
return objPtr;
|
return objPtr;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printKeys
|
printKeys
|
||||||
(
|
(
|
||||||
fatalError << "Ctor Selector "<< yellowText(geomModel) << " dose not exist. \n"
|
fatalError << "Ctor Selector "<< Yellow_Text(geomModel) << " dose not exist. \n"
|
||||||
<<"Avaiable ones are: \n\n"
|
<<"Avaiable ones are: \n\n"
|
||||||
,
|
,
|
||||||
dictionaryvCtorSelector_
|
dictionaryvCtorSelector_
|
||||||
|
@ -340,4 +518,4 @@ pFlow::uniquePtr<pFlow::geometry>
|
||||||
fatalExit;
|
fatalExit;
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,13 +23,14 @@ Licence:
|
||||||
|
|
||||||
|
|
||||||
#include "virtualConstructor.hpp"
|
#include "virtualConstructor.hpp"
|
||||||
#include "demGeometry.hpp"
|
#include "demComponent.hpp"
|
||||||
#include "property.hpp"
|
#include "property.hpp"
|
||||||
#include "Fields.hpp"
|
|
||||||
#include "Vectors.hpp"
|
|
||||||
#include "multiTriSurface.hpp"
|
#include "multiTriSurface.hpp"
|
||||||
#include "triSurfaceFields.hpp"
|
#include "triSurfaceFields.hpp"
|
||||||
#include "dictionary.hpp"
|
//#include "Fields.hpp"
|
||||||
|
//#include "Vectors.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace pFlow
|
namespace pFlow
|
||||||
{
|
{
|
||||||
|
@ -42,47 +43,48 @@ namespace pFlow
|
||||||
*/
|
*/
|
||||||
class geometry
|
class geometry
|
||||||
:
|
:
|
||||||
public demGeometry
|
public multiTriSurface,
|
||||||
|
public demComponent
|
||||||
{
|
{
|
||||||
protected:
|
private:
|
||||||
|
|
||||||
// - Protected members
|
// - Protected members
|
||||||
|
|
||||||
/// Const reference to physical property of materials
|
/// Const reference to physical property of materials
|
||||||
const property& wallProperty_;
|
const property& wallProperty_;
|
||||||
|
|
||||||
/// Repository to store geometry data at each simulation moment
|
|
||||||
repository& geometryRepository_;
|
|
||||||
|
|
||||||
/// All triangles in the set of wall surfaces
|
|
||||||
multiTriSurface& triSurface_;
|
|
||||||
|
|
||||||
/// The name of motion component of each wall surface
|
/// The name of motion component of each wall surface
|
||||||
wordField& motionComponentName_;
|
wordField_H motionComponentName_;
|
||||||
|
|
||||||
/// Material name of each wall surface
|
/// Material name of each wall surface
|
||||||
wordField& materialName_;
|
wordField_H materialName_;
|
||||||
|
|
||||||
/// Property id of each triangle in the set of wall surfaces
|
/// Property id of each triangle in the set of wall surfaces
|
||||||
int8TriSurfaceField_D& propertyId_;
|
uint32TriSurfaceField_D propertyId_;
|
||||||
|
|
||||||
/// Contact force on each triangle in the set of wall surfaces
|
/// Contact force on each triangle in the set of wall surfaces
|
||||||
realx3TriSurfaceField_D& contactForceWall_;
|
realx3TriSurfaceField_D contactForceWall_;
|
||||||
|
|
||||||
/// Stress on ech triangle in the set of wall surfaces
|
/// Stress on each triangle in the set of wall surfaces
|
||||||
realx3TriSurfaceField_D& stressWall_;
|
realx3TriSurfaceField_D normalStressWall_;
|
||||||
|
|
||||||
|
/// Stress on each triangle in the set of wall surfaces
|
||||||
|
realx3TriSurfaceField_D shearStressWall_;
|
||||||
|
|
||||||
|
|
||||||
|
bool readWholeObject_ = true;
|
||||||
|
|
||||||
// - Protected member functions
|
// - Protected member functions
|
||||||
|
|
||||||
/// Find property id of each triangle based on the supplied material name
|
/// Find property id of each triangle based on the supplied material name
|
||||||
/// and the surface wall that the triangle belongs to.
|
/// and the surface wall that the triangle belongs to.
|
||||||
bool findPropertyId();
|
bool createPropertyId();
|
||||||
|
|
||||||
/// Initialize contact force to zero
|
/// Initialize contact force to zero
|
||||||
void zeroForce()
|
/*void zeroForce()
|
||||||
{
|
{
|
||||||
contactForceWall_.fill(zero3);
|
contactForceWall_.fill(zero3);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -95,8 +97,15 @@ public:
|
||||||
/// Construct from controlSystem and property, for reading from file
|
/// Construct from controlSystem and property, for reading from file
|
||||||
geometry(systemControl& control, const property& prop);
|
geometry(systemControl& control, const property& prop);
|
||||||
|
|
||||||
|
geometry(systemControl& control,
|
||||||
|
const property& prop,
|
||||||
|
multiTriSurface& surf,
|
||||||
|
const wordVector& motionCompName,
|
||||||
|
const wordVector& materialName,
|
||||||
|
const dictionary& motionDict);
|
||||||
|
|
||||||
/// Construct from components
|
/// Construct from components
|
||||||
geometry(systemControl& control,
|
/*geometry(systemControl& control,
|
||||||
const property& prop,
|
const property& prop,
|
||||||
const multiTriSurface& triSurface,
|
const multiTriSurface& triSurface,
|
||||||
const wordVector& motionCompName,
|
const wordVector& motionCompName,
|
||||||
|
@ -110,13 +119,13 @@ public:
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const multiTriSurface& triSurface,
|
const multiTriSurface& triSurface,
|
||||||
const wordVector& motionCompName,
|
const wordVector& motionCompName,
|
||||||
const wordVector& propName);
|
const wordVector& propName);*/
|
||||||
|
|
||||||
/// Destructor
|
/// Destructor
|
||||||
virtual ~geometry() = default;
|
virtual ~geometry() = default;
|
||||||
|
|
||||||
/// Virtual constructor
|
/// Virtual constructor
|
||||||
create_vCtor
|
/*create_vCtor
|
||||||
(
|
(
|
||||||
geometry,
|
geometry,
|
||||||
systemControl,
|
systemControl,
|
||||||
|
@ -125,37 +134,24 @@ public:
|
||||||
const property& prop
|
const property& prop
|
||||||
),
|
),
|
||||||
(control, prop)
|
(control, prop)
|
||||||
);
|
);*/
|
||||||
|
|
||||||
/// Virtual constructor
|
/// Virtual constructor
|
||||||
create_vCtor
|
create_vCtor
|
||||||
(
|
(
|
||||||
geometry,
|
geometry,
|
||||||
dictionary,
|
dictionary,
|
||||||
(systemControl& control,
|
(
|
||||||
const property& prop,
|
systemControl& control,
|
||||||
const dictionary& dict,
|
const property& prop,
|
||||||
const multiTriSurface& triSurface,
|
multiTriSurface& surf,
|
||||||
const wordVector& motionCompName,
|
const wordVector& motionCompName,
|
||||||
const wordVector& propName),
|
const wordVector& materialName,
|
||||||
(control, prop, dict, triSurface, motionCompName, propName)
|
const dictionary& motionDic),
|
||||||
|
(control, prop, surf, motionCompName, materialName, motionDic)
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Methods
|
//- Methods
|
||||||
|
|
||||||
/// Size of tri-surface
|
|
||||||
inline
|
|
||||||
auto size()const
|
|
||||||
{
|
|
||||||
return triSurface_.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Number of points in the set of surface walls
|
|
||||||
inline
|
|
||||||
auto numPoints()const
|
|
||||||
{
|
|
||||||
return triSurface_.numPoints();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Number of triangles in the set of surface walls
|
/// Number of triangles in the set of surface walls
|
||||||
inline
|
inline
|
||||||
|
@ -165,39 +161,47 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Access to the points
|
/// Access to the points
|
||||||
inline
|
/*inline
|
||||||
const auto& points()const
|
const auto& points()const
|
||||||
{
|
{
|
||||||
return triSurface_.points();
|
return triSurface_.points();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/// Access to the vertices
|
/// Access to the vertices
|
||||||
inline
|
/*inline
|
||||||
const auto& vertices()const
|
const auto& vertices()const
|
||||||
{
|
{
|
||||||
return triSurface_.vertices();
|
return triSurface_.vertices();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/// Obtain an object for accessing triangles
|
/// Obtain an object for accessing triangles
|
||||||
inline auto getTriangleAccessor()const
|
/*inline auto getTriangleAccessor()const
|
||||||
{
|
{
|
||||||
return triSurface_.getTriangleAccessor();
|
return triSurface_.getTriangleAccessor();
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/// Surface
|
||||||
|
inline
|
||||||
|
auto& surface()
|
||||||
|
{
|
||||||
|
return static_cast<multiTriSurface&>(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Surface
|
/// Surface
|
||||||
inline auto& surface()
|
inline
|
||||||
|
const auto& surface()const
|
||||||
{
|
{
|
||||||
return triSurface_;
|
return static_cast<const multiTriSurface&>(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Surface
|
inline
|
||||||
inline const auto& surface()const
|
const auto& motionComponentName()const
|
||||||
{
|
{
|
||||||
return triSurface_;
|
return motionComponentName_;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Access to contact force
|
/// Access to contact force
|
||||||
inline
|
/*inline
|
||||||
realx3TriSurfaceField_D& contactForceWall()
|
realx3TriSurfaceField_D& contactForceWall()
|
||||||
{
|
{
|
||||||
return contactForceWall_;
|
return contactForceWall_;
|
||||||
|
@ -214,34 +218,34 @@ public:
|
||||||
inline const auto& wallProperty()const
|
inline const auto& wallProperty()const
|
||||||
{
|
{
|
||||||
return wallProperty_;
|
return wallProperty_;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/// Owner repository
|
/// Owner repository
|
||||||
inline
|
/*inline
|
||||||
const repository& owner()const
|
const repository& owner()const
|
||||||
{
|
{
|
||||||
return geometryRepository_;
|
return geometryRepository_;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/// Owner repository
|
/// Owner repository
|
||||||
inline
|
/*inline
|
||||||
repository& owner()
|
repository& owner()
|
||||||
{
|
{
|
||||||
return geometryRepository_;
|
return geometryRepository_;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/// Path to the repository folder
|
/// Path to the repository folder
|
||||||
inline auto path()
|
/*inline auto path()
|
||||||
{
|
{
|
||||||
return owner().path();
|
return owner().path();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/// The name of motion model
|
/// The name of motion model
|
||||||
virtual
|
/*virtual
|
||||||
word motionModelTypeName()const = 0;
|
word motionModelTypeName()const = 0;*/
|
||||||
|
|
||||||
/// Motion model index of triangles
|
/// Motion model index of triangles
|
||||||
virtual
|
/*virtual
|
||||||
const int8Vector_HD& triMotionIndex() const =0;
|
const int8Vector_HD& triMotionIndex() const =0;
|
||||||
|
|
||||||
/// Motion model index of points
|
/// Motion model index of points
|
||||||
|
@ -252,36 +256,58 @@ public:
|
||||||
const int8TriSurfaceField_D& propertyId() const
|
const int8TriSurfaceField_D& propertyId() const
|
||||||
{
|
{
|
||||||
return propertyId_;
|
return propertyId_;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/// Operations before each iteration
|
/// Operations before each iteration
|
||||||
bool beforeIteration() override;
|
//bool beforeIteration() override;
|
||||||
|
|
||||||
/// Operations after each iteration
|
/// Operations after each iteration
|
||||||
bool afterIteration() override;
|
//bool afterIteration() override;
|
||||||
|
|
||||||
|
|
||||||
|
bool beforeIteration() override
|
||||||
|
{
|
||||||
|
notImplementedFunction;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// This is called in time loop. Perform the main calculations
|
||||||
|
/// when the component should evolve along time.
|
||||||
|
bool iterate() override
|
||||||
|
{
|
||||||
|
notImplementedFunction;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// This is called in time loop, after iterate.
|
||||||
|
bool afterIteration() override
|
||||||
|
{
|
||||||
|
notImplementedFunction;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
//- IO
|
//- IO
|
||||||
|
|
||||||
|
bool read(iIstream& is, const IOPattern& iop) override;
|
||||||
|
|
||||||
/// write
|
/// write
|
||||||
bool write()const
|
bool write( iOstream& os, const IOPattern& iop )const override;
|
||||||
{
|
|
||||||
return owner().write();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//- Static members
|
//- Static members
|
||||||
|
|
||||||
static
|
/*static
|
||||||
uniquePtr<geometry> create(systemControl& control, const property& prop);
|
uniquePtr<geometry> create(systemControl& control, const property& prop);*/
|
||||||
|
|
||||||
static
|
static
|
||||||
uniquePtr<geometry> create(
|
uniquePtr<geometry> create(
|
||||||
systemControl& control,
|
systemControl& control,
|
||||||
const property& prop,
|
const property& prop,
|
||||||
const dictionary& dict,
|
multiTriSurface& surf,
|
||||||
const multiTriSurface& triSurface,
|
const wordVector& motionCompName,
|
||||||
const wordVector& motionCompName,
|
const wordVector& materialName,
|
||||||
const wordVector& propName);
|
const dictionary& motionDic);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#include "geometryMotion.hpp"
|
||||||
/*------------------------------- phasicFlow ---------------------------------
|
/*------------------------------- phasicFlow ---------------------------------
|
||||||
O C enter of
|
O C enter of
|
||||||
O O E ngineering and
|
O O E ngineering and
|
||||||
|
@ -21,37 +22,49 @@ Licence:
|
||||||
template<typename MotionModel>
|
template<typename MotionModel>
|
||||||
bool pFlow::geometryMotion<MotionModel>::findMotionIndex()
|
bool pFlow::geometryMotion<MotionModel>::findMotionIndex()
|
||||||
{
|
{
|
||||||
motionIndex_.clear();
|
|
||||||
triMotionIndex_.reserve( this->surface().capacity() );
|
if(motionComponentName().size() != numSurfaces() )
|
||||||
triMotionIndex_.clear();
|
|
||||||
|
|
||||||
ForAll( surfI, motionComponentName_)
|
|
||||||
{
|
{
|
||||||
auto mName = motionComponentName_[surfI];
|
fatalErrorInFunction<<
|
||||||
auto mInd = motionModel_.nameToIndex(mName);
|
"size of motion component names in the triSurface is not"<<
|
||||||
motionIndex_.push_back(mInd);
|
" equal to size of number of sub-surfaces"<<endl;
|
||||||
// fill motionIndex for triangles of the surface
|
return false;
|
||||||
int32 surfSize = this->surface().surfNumTriangles(surfI);
|
}
|
||||||
for(int32 i=0; i<surfSize; i++)
|
|
||||||
|
uint32Vector surfMotionIndex("surfMotionIndex");
|
||||||
|
uint32Vector triMotionIndex("triMotionIndex");
|
||||||
|
uint32Vector pointMotionIndex("pointMotionIndex");
|
||||||
|
|
||||||
|
ForAll( surfI, motionComponentName())
|
||||||
|
{
|
||||||
|
auto mName = motionComponentName()[surfI];
|
||||||
|
uint32 mInd=0;
|
||||||
|
|
||||||
|
if( !motionModel_.nameToIndex(mName, mInd) )
|
||||||
{
|
{
|
||||||
triMotionIndex_.push_back(mInd);
|
fatalErrorInFunction<<
|
||||||
|
mName<< " does not exist in the list of motion names -> "<<
|
||||||
|
motionModel_.componentNames();
|
||||||
|
}
|
||||||
|
surfMotionIndex.push_back(mInd);
|
||||||
|
|
||||||
|
auto surfRange = this->surface().subSurfaceRange(surfI);
|
||||||
|
|
||||||
|
for(uint32 i=0; i<surfRange.numElements(); i++)
|
||||||
|
{
|
||||||
|
triMotionIndex.push_back(mInd);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto pointRange = this->surface().subSurfacePointRange(surfI);
|
||||||
|
for(uint32 n=0; n<pointRange.numElements(); n++)
|
||||||
|
{
|
||||||
|
pointMotionIndex.push_back(mInd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
motionIndex_.syncViews();
|
|
||||||
triMotionIndex_.syncViews();
|
surfMotionIndex_.assign(surfMotionIndex);
|
||||||
|
triMotionIndex_.assign(triMotionIndex);
|
||||||
pointMotionIndex_.reserve(triSurface_.numPoints());
|
pointMotionIndex_.assign(pointMotionIndex);
|
||||||
pointMotionIndex_.clear();
|
|
||||||
|
|
||||||
ForAll(surfI, motionIndex_)
|
|
||||||
{
|
|
||||||
auto nP = triSurface_.surfNumPoints(surfI);
|
|
||||||
for(int32 i=0; i<nP; i++)
|
|
||||||
{
|
|
||||||
pointMotionIndex_.push_back(motionIndex_[surfI]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pointMotionIndex_.syncViews();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -65,144 +78,188 @@ pFlow::geometryMotion<MotionModel>::geometryMotion
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
geometry(control, prop),
|
geometry(control, prop),
|
||||||
motionModel_(
|
motionModel_
|
||||||
this->owner().template emplaceObject<MotionModel>(
|
(
|
||||||
objectFile(
|
objectFile
|
||||||
motionModelFile__,
|
(
|
||||||
"",
|
motionModelFile__,
|
||||||
objectFile::READ_ALWAYS,
|
"",
|
||||||
objectFile::WRITE_ALWAYS
|
objectFile::READ_ALWAYS,
|
||||||
)
|
objectFile::WRITE_ALWAYS
|
||||||
)
|
|
||||||
),
|
),
|
||||||
|
owner()
|
||||||
|
),
|
||||||
moveGeomTimer_("move geometry", &this->timers())
|
moveGeomTimer_("move geometry", &this->timers())
|
||||||
{
|
{
|
||||||
findMotionIndex();
|
if(!findMotionIndex())
|
||||||
}
|
|
||||||
|
|
||||||
template<typename MotionModel>
|
|
||||||
pFlow::geometryMotion<MotionModel>::geometryMotion
|
|
||||||
(
|
|
||||||
systemControl& control,
|
|
||||||
const property& prop,
|
|
||||||
const multiTriSurface& triSurface,
|
|
||||||
const wordVector& motionCompName,
|
|
||||||
const wordVector& propName,
|
|
||||||
const MotionModel& motionModel
|
|
||||||
)
|
|
||||||
:
|
|
||||||
geometry(
|
|
||||||
control,
|
|
||||||
prop,
|
|
||||||
triSurface,
|
|
||||||
motionCompName,
|
|
||||||
propName
|
|
||||||
),
|
|
||||||
motionModel_(
|
|
||||||
this->owner().template emplaceObject<MotionModel>(
|
|
||||||
objectFile(
|
|
||||||
motionModelFile__,
|
|
||||||
"",
|
|
||||||
objectFile::READ_NEVER,
|
|
||||||
objectFile::WRITE_ALWAYS
|
|
||||||
),
|
|
||||||
motionModel
|
|
||||||
)
|
|
||||||
),
|
|
||||||
moveGeomTimer_("move geometry", &this->timers())
|
|
||||||
{
|
|
||||||
findMotionIndex();
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename MotionModel>
|
|
||||||
pFlow::geometryMotion<MotionModel>::geometryMotion
|
|
||||||
(
|
|
||||||
systemControl& control,
|
|
||||||
const property& prop,
|
|
||||||
const dictionary& dict,
|
|
||||||
const multiTriSurface& triSurface,
|
|
||||||
const wordVector& motionCompName,
|
|
||||||
const wordVector& propName
|
|
||||||
)
|
|
||||||
:
|
|
||||||
geometry(
|
|
||||||
control,
|
|
||||||
prop,
|
|
||||||
dict,
|
|
||||||
triSurface,
|
|
||||||
motionCompName,
|
|
||||||
propName
|
|
||||||
),
|
|
||||||
motionModel_(
|
|
||||||
this->owner().template emplaceObject<MotionModel>(
|
|
||||||
objectFile(
|
|
||||||
motionModelFile__,
|
|
||||||
"",
|
|
||||||
objectFile::READ_NEVER,
|
|
||||||
objectFile::WRITE_ALWAYS
|
|
||||||
),
|
|
||||||
dict
|
|
||||||
)
|
|
||||||
),
|
|
||||||
moveGeomTimer_("move geometry", &this->timers())
|
|
||||||
{
|
|
||||||
findMotionIndex();
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename MotionModel>
|
|
||||||
bool pFlow::geometryMotion<MotionModel>::beforeIteration()
|
|
||||||
{
|
|
||||||
geometry::beforeIteration();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename MotionModel>
|
|
||||||
bool pFlow::geometryMotion<MotionModel>::iterate()
|
|
||||||
{
|
|
||||||
if( motionModel_.isMoving() )
|
|
||||||
{
|
{
|
||||||
moveGeomTimer_.start();
|
fatalExit;
|
||||||
moveGeometry();
|
|
||||||
moveGeomTimer_.end();
|
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename MotionModel>
|
template <typename MotionModelType>
|
||||||
bool pFlow::geometryMotion<MotionModel>::afterIteration()
|
pFlow::geometryMotion<MotionModelType>::geometryMotion
|
||||||
|
(
|
||||||
|
systemControl &control,
|
||||||
|
const property &prop,
|
||||||
|
multiTriSurface &surf,
|
||||||
|
const wordVector &motionCompName,
|
||||||
|
const wordVector &materialName,
|
||||||
|
const dictionary &motionDict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
geometry
|
||||||
|
(
|
||||||
|
control,
|
||||||
|
prop,
|
||||||
|
surf,
|
||||||
|
motionCompName,
|
||||||
|
materialName,
|
||||||
|
motionDict
|
||||||
|
),
|
||||||
|
motionModel_
|
||||||
|
(
|
||||||
|
objectFile
|
||||||
|
(
|
||||||
|
motionModelFile__,
|
||||||
|
"",
|
||||||
|
objectFile::READ_NEVER,
|
||||||
|
objectFile::WRITE_ALWAYS
|
||||||
|
),
|
||||||
|
motionDict,
|
||||||
|
owner()
|
||||||
|
),
|
||||||
|
moveGeomTimer_("move geometry", &this->timers())
|
||||||
{
|
{
|
||||||
geometry::afterIteration();
|
if(!findMotionIndex())
|
||||||
return true;
|
{
|
||||||
}
|
fatalExit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template<typename MotionModel>
|
/*template<typename MotionModel>
|
||||||
bool pFlow::geometryMotion<MotionModel>::moveGeometry()
|
pFlow::geometryMotion<MotionModel>::geometryMotion
|
||||||
{
|
(
|
||||||
|
systemControl& control,
|
||||||
|
const property& prop,
|
||||||
|
const multiTriSurface& triSurface,
|
||||||
|
const wordVector& motionCompName,
|
||||||
|
const wordVector& propName,
|
||||||
|
const MotionModel& motionModel
|
||||||
|
)
|
||||||
|
:
|
||||||
|
geometry(
|
||||||
|
control,
|
||||||
|
prop,
|
||||||
|
triSurface,
|
||||||
|
motionCompName,
|
||||||
|
propName
|
||||||
|
),
|
||||||
|
motionModel_(
|
||||||
|
this->owner().template emplaceObject<MotionModel>(
|
||||||
|
objectFile(
|
||||||
|
motionModelFile__,
|
||||||
|
"",
|
||||||
|
objectFile::READ_NEVER,
|
||||||
|
objectFile::WRITE_ALWAYS
|
||||||
|
),
|
||||||
|
motionModel
|
||||||
|
)
|
||||||
|
),
|
||||||
|
moveGeomTimer_("move geometry", &this->timers())
|
||||||
|
{
|
||||||
|
findMotionIndex();
|
||||||
|
}
|
||||||
|
|
||||||
real dt = this->dt();
|
template<typename MotionModel>
|
||||||
real t = this->currentTime();
|
pFlow::geometryMotion<MotionModel>::geometryMotion
|
||||||
|
(
|
||||||
|
systemControl& control,
|
||||||
|
const property& prop,
|
||||||
|
const dictionary& dict,
|
||||||
|
const multiTriSurface& triSurface,
|
||||||
|
const wordVector& motionCompName,
|
||||||
|
const wordVector& propName
|
||||||
|
)
|
||||||
|
:
|
||||||
|
geometry(
|
||||||
|
control,
|
||||||
|
prop,
|
||||||
|
dict,
|
||||||
|
triSurface,
|
||||||
|
motionCompName,
|
||||||
|
propName
|
||||||
|
),
|
||||||
|
motionModel_(
|
||||||
|
this->owner().template emplaceObject<MotionModel>(
|
||||||
|
objectFile(
|
||||||
|
motionModelFile__,
|
||||||
|
"",
|
||||||
|
objectFile::READ_NEVER,
|
||||||
|
objectFile::WRITE_ALWAYS
|
||||||
|
),
|
||||||
|
dict
|
||||||
|
)
|
||||||
|
),
|
||||||
|
moveGeomTimer_("move geometry", &this->timers())
|
||||||
|
{
|
||||||
|
findMotionIndex();
|
||||||
|
}
|
||||||
|
|
||||||
auto pointMIndex= pointMotionIndex_.deviceVector();
|
template<typename MotionModel>
|
||||||
auto mModel = motionModel_.getModel(t);
|
bool pFlow::geometryMotion<MotionModel>::beforeIteration()
|
||||||
realx3* points = triSurface_.pointsData_D();
|
{
|
||||||
auto numPoints = triSurface_.numPoints();
|
geometry::beforeIteration();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename MotionModel>
|
||||||
|
bool pFlow::geometryMotion<MotionModel>::iterate()
|
||||||
|
{
|
||||||
|
if( motionModel_.isMoving() )
|
||||||
|
{
|
||||||
|
moveGeomTimer_.start();
|
||||||
|
moveGeometry();
|
||||||
|
moveGeomTimer_.end();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename MotionModel>
|
||||||
|
bool pFlow::geometryMotion<MotionModel>::afterIteration()
|
||||||
|
{
|
||||||
|
geometry::afterIteration();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename MotionModel>
|
||||||
|
bool pFlow::geometryMotion<MotionModel>::moveGeometry()
|
||||||
|
{
|
||||||
|
|
||||||
|
real dt = this->dt();
|
||||||
|
real t = this->currentTime();
|
||||||
|
|
||||||
|
auto pointMIndex= pointMotionIndex_.deviceVector();
|
||||||
|
auto mModel = motionModel_.getModel(t);
|
||||||
|
realx3* points = triSurface_.pointsData_D();
|
||||||
|
auto numPoints = triSurface_.numPoints();
|
||||||
|
|
||||||
|
|
||||||
Kokkos::parallel_for(
|
Kokkos::parallel_for(
|
||||||
"geometryMotion<MotionModel>::movePoints",
|
"geometryMotion<MotionModel>::movePoints",
|
||||||
numPoints,
|
numPoints,
|
||||||
LAMBDA_HD(int32 i){
|
LAMBDA_HD(int32 i){
|
||||||
auto newPos = mModel.transferPoint(pointMIndex[i], points[i], dt);
|
auto newPos = mModel.transferPoint(pointMIndex[i], points[i], dt);
|
||||||
points[i] = newPos;
|
points[i] = newPos;
|
||||||
});
|
});
|
||||||
|
|
||||||
Kokkos::fence();
|
Kokkos::fence();
|
||||||
|
|
||||||
// move the motion components
|
// move the motion components
|
||||||
motionModel_.move(t,dt);
|
motionModel_.move(t,dt);
|
||||||
|
|
||||||
// end of calculations
|
// end of calculations
|
||||||
moveGeomTimer_.end();
|
moveGeomTimer_.end();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}*/
|
|
@ -20,9 +20,8 @@ Licence:
|
||||||
#ifndef __geometryMotion_hpp__
|
#ifndef __geometryMotion_hpp__
|
||||||
#define __geometryMotion_hpp__
|
#define __geometryMotion_hpp__
|
||||||
|
|
||||||
|
#include "vocabs.hpp"
|
||||||
#include "geometry.hpp"
|
#include "geometry.hpp"
|
||||||
#include "VectorDuals.hpp"
|
|
||||||
|
|
||||||
namespace pFlow
|
namespace pFlow
|
||||||
{
|
{
|
||||||
|
@ -38,22 +37,22 @@ class geometryMotion
|
||||||
public geometry
|
public geometry
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
using MotionModel = MotionModelType;
|
|
||||||
|
|
||||||
protected:
|
using ModelComponent = typename MotionModelType::ModelComponent;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
/// Ref to motion model
|
/// Ref to motion model
|
||||||
MotionModel& motionModel_;
|
MotionModelType motionModel_;
|
||||||
|
|
||||||
/// motion indext mapped on each surface
|
/// motion indext mapped on each surface
|
||||||
int32Vector_HD motionIndex_;
|
uint32Field_D surfMotionIndex_{"triMotionIndex"};
|
||||||
|
|
||||||
/// motion index mapped on each triangle
|
/// motion index mapped on each triangle
|
||||||
int8Vector_HD triMotionIndex_;
|
uint32Field_D triMotionIndex_ {"surfMotionIndex"};
|
||||||
|
|
||||||
/// motion index mapped on each point
|
/// motion index mapped on each point
|
||||||
int8Vector_HD pointMotionIndex_;
|
uint32Field_D pointMotionIndex_{"pointMotionIndex"};
|
||||||
|
|
||||||
/// timer for moveGeometry
|
/// timer for moveGeometry
|
||||||
Timer moveGeomTimer_;
|
Timer moveGeomTimer_;
|
||||||
|
@ -64,37 +63,45 @@ protected:
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// Type info
|
/// Type info
|
||||||
TypeInfoTemplate("geometry", MotionModel);
|
TypeInfoTemplate11("geometry", ModelComponent);
|
||||||
|
|
||||||
// - Constructors
|
// - Constructors
|
||||||
|
|
||||||
geometryMotion(systemControl& control, const property& prop);
|
geometryMotion(systemControl& control, const property& prop);
|
||||||
|
|
||||||
|
|
||||||
geometryMotion(
|
geometryMotion(
|
||||||
|
systemControl& control,
|
||||||
|
const property& prop,
|
||||||
|
multiTriSurface& surf,
|
||||||
|
const wordVector& motionCompName,
|
||||||
|
const wordVector& materialName,
|
||||||
|
const dictionary& motionDict);
|
||||||
|
|
||||||
|
|
||||||
|
/*geometryMotion(
|
||||||
systemControl& control,
|
systemControl& control,
|
||||||
const property& prop,
|
const property& prop,
|
||||||
const multiTriSurface& triSurface,
|
const multiTriSurface& triSurface,
|
||||||
const wordVector& motionCompName,
|
const wordVector& motionCompName,
|
||||||
const wordVector& propName,
|
const wordVector& propName,
|
||||||
const MotionModel& motionModel);
|
const MotionModel& motionModel);*/
|
||||||
|
|
||||||
/// Construct from components and dictionary that contains
|
/// Construct from components and dictionary that contains
|
||||||
/// motionModel
|
/// motionModel
|
||||||
geometryMotion(systemControl& control,
|
/*geometryMotion(systemControl& control,
|
||||||
const property& prop,
|
const property& prop,
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const multiTriSurface& triSurface,
|
const multiTriSurface& triSurface,
|
||||||
const wordVector& motionCompName,
|
const wordVector& motionCompName,
|
||||||
const wordVector& propName);
|
const wordVector& propName);*/
|
||||||
|
|
||||||
/// Add virtual constructor
|
/// Add virtual constructor
|
||||||
add_vCtor
|
/*add_vCtor
|
||||||
(
|
(
|
||||||
geometry,
|
geometry,
|
||||||
geometryMotion,
|
geometryMotion,
|
||||||
systemControl
|
systemControl
|
||||||
);
|
);*/
|
||||||
|
|
||||||
/// Add virtual constructor
|
/// Add virtual constructor
|
||||||
add_vCtor
|
add_vCtor
|
||||||
|
@ -107,19 +114,19 @@ public:
|
||||||
// - Methods
|
// - Methods
|
||||||
|
|
||||||
/// Obtain motion model at time t
|
/// Obtain motion model at time t
|
||||||
auto getModel(real t)const
|
/*auto getModel(real t)const
|
||||||
{
|
{
|
||||||
return motionModel_.getModel(t);
|
return motionModel_.getModel(t);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/// TypeName / TypeInfo of motion model
|
/// TypeName / TypeInfo of motion model
|
||||||
word motionModelTypeName()const override
|
/*word motionModelTypeName()const override
|
||||||
{
|
{
|
||||||
return motionModel_.typeName();
|
return motionModel_.typeName();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/// Access to motion model index of triangles
|
/// Access to motion model index of triangles
|
||||||
const int8Vector_HD& triMotionIndex()const override
|
/*const auto& triMotionIndex()const override
|
||||||
{
|
{
|
||||||
return triMotionIndex_;
|
return triMotionIndex_;
|
||||||
}
|
}
|
||||||
|
@ -128,19 +135,19 @@ public:
|
||||||
const int8Vector_HD& pointMotionIndex()const override
|
const int8Vector_HD& pointMotionIndex()const override
|
||||||
{
|
{
|
||||||
return pointMotionIndex_;
|
return pointMotionIndex_;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/// Operations before each iteration
|
/// Operations before each iteration
|
||||||
bool beforeIteration() override;
|
/*bool beforeIteration() override;
|
||||||
|
|
||||||
/// Iterate geometry one time step
|
/// Iterate geometry one time step
|
||||||
bool iterate() override ;
|
bool iterate() override ;
|
||||||
|
|
||||||
/// Operations after each iteration
|
/// Operations after each iteration
|
||||||
bool afterIteration() override;
|
bool afterIteration() override;*/
|
||||||
|
|
||||||
/// Move geometry
|
/// Move geometry
|
||||||
bool moveGeometry();
|
//bool moveGeometry();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -22,22 +22,22 @@ Licence:
|
||||||
#define __geometryMotions_hpp__
|
#define __geometryMotions_hpp__
|
||||||
|
|
||||||
#include "geometryMotion.hpp"
|
#include "geometryMotion.hpp"
|
||||||
#include "fixedWall.hpp"
|
#include "stationaryWall.hpp"
|
||||||
#include "rotatingAxisMotion.hpp"
|
#include "rotatingAxisMotion.hpp"
|
||||||
#include "multiRotatingAxisMotion.hpp"
|
//#include "multiRotatingAxisMotion.hpp"
|
||||||
#include "vibratingMotion.hpp"
|
#include "vibratingMotion.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace pFlow
|
namespace pFlow
|
||||||
{
|
{
|
||||||
|
|
||||||
typedef geometryMotion<vibratingMotion> vibratingMotionGeometry;
|
using vibratingMotionGeometry = geometryMotion<vibratingMotion>;
|
||||||
|
|
||||||
typedef geometryMotion<rotatingAxisMotion> rotationAxisMotionGeometry;
|
using rotationAxisMotionGeometry = geometryMotion<rotatingAxisMotion>;
|
||||||
|
|
||||||
typedef geometryMotion<multiRotatingAxisMotion> multiRotationAxisMotionGeometry;
|
//typedef geometryMotion<multiRotatingAxisMotion> multiRotationAxisMotionGeometry;
|
||||||
|
|
||||||
typedef geometryMotion<fixedWall> fixedGeometry;
|
typedef geometryMotion<stationaryWall> stationaryGeometry;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,15 +18,15 @@ Licence:
|
||||||
|
|
||||||
-----------------------------------------------------------------------------*/
|
-----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "fixedWall.hpp"
|
#include "stationaryWall.hpp"
|
||||||
#include "rotatingAxisMotion.hpp"
|
#include "rotatingAxisMotion.hpp"
|
||||||
#include "multiRotatingAxisMotion.hpp"
|
//#include "multiRotatingAxisMotion.hpp"
|
||||||
#include "vibratingMotion.hpp"
|
#include "vibratingMotion.hpp"
|
||||||
|
|
||||||
template class pFlow::geometryMotion<pFlow::fixedWall>;
|
template class pFlow::geometryMotion<pFlow::stationaryWall>;
|
||||||
|
|
||||||
template class pFlow::geometryMotion<pFlow::rotatingAxisMotion>;
|
template class pFlow::geometryMotion<pFlow::rotatingAxisMotion>;
|
||||||
|
|
||||||
template class pFlow::geometryMotion<pFlow::multiRotatingAxisMotion>;
|
//template class pFlow::geometryMotion<pFlow::multiRotatingAxisMotion>;
|
||||||
|
|
||||||
template class pFlow::geometryMotion<pFlow::vibratingMotion>;
|
template class pFlow::geometryMotion<pFlow::vibratingMotion>;
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
|
|
||||||
list(APPEND SourceFiles
|
list(APPEND SourceFiles
|
||||||
entities/timeInterval/timeInterval.cpp
|
entities/timeInterval/timeInterval.cpp
|
||||||
|
|
||||||
entities/rotatingAxis/rotatingAxis.cpp
|
entities/rotatingAxis/rotatingAxis.cpp
|
||||||
rotatingAxisMotion/rotatingAxisMotion.cpp
|
rotatingAxisMotion/rotatingAxisMotion.cpp
|
||||||
|
|
||||||
|
|
||||||
entities/vibrating/vibrating.cpp
|
entities/vibrating/vibrating.cpp
|
||||||
vibratingMotion/vibratingMotion.cpp
|
vibratingMotion/vibratingMotion.cpp
|
||||||
#fixedWall/fixedWall.cpp
|
|
||||||
|
stationaryWall/stationaryWall.cpp
|
||||||
|
entities/stationary/stationary.cpp
|
||||||
|
|
||||||
#entities/multiRotatingAxis/multiRotatingAxis.cpp
|
#entities/multiRotatingAxis/multiRotatingAxis.cpp
|
||||||
#multiRotatingAxisMotion/multiRotatingAxisMotion.cpp
|
#multiRotatingAxisMotion/multiRotatingAxisMotion.cpp
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,11 @@ protected:
|
||||||
|
|
||||||
bool impl_indexToName(uint32 i, word& name)const;
|
bool impl_indexToName(uint32 i, word& name)const;
|
||||||
|
|
||||||
|
const wordList& impl_componentNames()const
|
||||||
|
{
|
||||||
|
return componentNames_;
|
||||||
|
}
|
||||||
|
|
||||||
bool impl_isMoving()const
|
bool impl_isMoving()const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -221,6 +225,11 @@ public:
|
||||||
{
|
{
|
||||||
return getModel().impl_indexToName(idx, name);
|
return getModel().impl_indexToName(idx, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const wordList& componentNames()const
|
||||||
|
{
|
||||||
|
return getModel().impl_componentNames();
|
||||||
|
}
|
||||||
|
|
||||||
/// Are walls moving
|
/// Are walls moving
|
||||||
bool isMoving()const
|
bool isMoving()const
|
||||||
|
|
|
@ -75,6 +75,8 @@ public:
|
||||||
|
|
||||||
// - Constructor
|
// - Constructor
|
||||||
|
|
||||||
|
TypeInfoNV("rotatingAxis");
|
||||||
|
|
||||||
/// Empty constructor
|
/// Empty constructor
|
||||||
FUNCTION_HD
|
FUNCTION_HD
|
||||||
rotatingAxis()=default;
|
rotatingAxis()=default;
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
/*------------------------------- phasicFlow ---------------------------------
|
||||||
|
O C enter of
|
||||||
|
O O E ngineering and
|
||||||
|
O O M ultiscale modeling of
|
||||||
|
OOOOOOO F luid flow
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
Copyright (C): www.cemf.ir
|
||||||
|
email: hamid.r.norouzi AT gmail.com
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
Licence:
|
||||||
|
This file is part of phasicFlow code. It is a free software for simulating
|
||||||
|
granular and multiphase flows. You can redistribute it and/or modify it under
|
||||||
|
the terms of GNU General Public License v3 or any other later versions.
|
||||||
|
|
||||||
|
phasicFlow is distributed to help others in their research in the field of
|
||||||
|
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
|
||||||
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
-----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "stationary.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
FUNCTION_H
|
||||||
|
pFlow::stationary::stationary(const dictionary& dict)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
FUNCTION_H
|
||||||
|
bool pFlow::stationary::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
FUNCTION_H
|
||||||
|
bool pFlow::stationary::write(dictionary& dict) const
|
||||||
|
{
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
FUNCTION_H
|
||||||
|
bool pFlow::stationary::read(iIstream& is)
|
||||||
|
{
|
||||||
|
|
||||||
|
notImplementedFunction;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
FUNCTION_H
|
||||||
|
bool pFlow::stationary::write(iOstream& os)const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
|
@ -0,0 +1,104 @@
|
||||||
|
/*------------------------------- phasicFlow ---------------------------------
|
||||||
|
O C enter of
|
||||||
|
O O E ngineering and
|
||||||
|
O O M ultiscale modeling of
|
||||||
|
OOOOOOO F luid flow
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
Copyright (C): www.cemf.ir
|
||||||
|
email: hamid.r.norouzi AT gmail.com
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
Licence:
|
||||||
|
This file is part of phasicFlow code. It is a free software for simulating
|
||||||
|
granular and multiphase flows. You can redistribute it and/or modify it under
|
||||||
|
the terms of GNU General Public License v3 or any other later versions.
|
||||||
|
|
||||||
|
phasicFlow is distributed to help others in their research in the field of
|
||||||
|
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
|
||||||
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
-----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef __stationary_hpp__
|
||||||
|
#define __stationary_hpp__
|
||||||
|
|
||||||
|
|
||||||
|
#include "types.hpp"
|
||||||
|
#include "typeInfo.hpp"
|
||||||
|
#include "streams.hpp"
|
||||||
|
|
||||||
|
namespace pFlow
|
||||||
|
{
|
||||||
|
|
||||||
|
// forward
|
||||||
|
class dictionary;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* stationary model for a wall
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class stationary
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
TypeInfoNV("stationary");
|
||||||
|
|
||||||
|
FUNCTION_HD
|
||||||
|
stationary()=default;
|
||||||
|
|
||||||
|
FUNCTION_H
|
||||||
|
explicit stationary(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
|
FUNCTION_HD
|
||||||
|
stationary(const stationary&) = default;
|
||||||
|
|
||||||
|
stationary& operator=(const stationary&) = default;
|
||||||
|
|
||||||
|
INLINE_FUNCTION_HD
|
||||||
|
void setTime(real t)
|
||||||
|
{}
|
||||||
|
|
||||||
|
INLINE_FUNCTION_HD
|
||||||
|
realx3 linTangentialVelocityPoint(const realx3 &)const
|
||||||
|
{
|
||||||
|
return zero3;
|
||||||
|
}
|
||||||
|
|
||||||
|
INLINE_FUNCTION_HD
|
||||||
|
realx3 transferPoint(const realx3& p, real dt)
|
||||||
|
{
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
// - IO operation
|
||||||
|
FUNCTION_H
|
||||||
|
bool read(const dictionary& dict);
|
||||||
|
|
||||||
|
FUNCTION_H
|
||||||
|
bool write(dictionary& dict) const;
|
||||||
|
|
||||||
|
FUNCTION_H
|
||||||
|
bool read(iIstream& is);
|
||||||
|
|
||||||
|
FUNCTION_H
|
||||||
|
bool write(iOstream& os)const;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
inline iOstream& operator <<(iOstream& os, const stationary& obj)
|
||||||
|
{
|
||||||
|
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline iIstream& operator >>(iIstream& is, stationary& obj)
|
||||||
|
{
|
||||||
|
|
||||||
|
return is;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
|
@ -94,6 +94,8 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
TypeInfoNV("vibrating");
|
||||||
|
|
||||||
FUNCTION_HD
|
FUNCTION_HD
|
||||||
vibrating()=default;
|
vibrating()=default;
|
||||||
|
|
||||||
|
|
|
@ -1,110 +0,0 @@
|
||||||
/*------------------------------- phasicFlow ---------------------------------
|
|
||||||
O C enter of
|
|
||||||
O O E ngineering and
|
|
||||||
O O M ultiscale modeling of
|
|
||||||
OOOOOOO F luid flow
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
Copyright (C): www.cemf.ir
|
|
||||||
email: hamid.r.norouzi AT gmail.com
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
Licence:
|
|
||||||
This file is part of phasicFlow code. It is a free software for simulating
|
|
||||||
granular and multiphase flows. You can redistribute it and/or modify it under
|
|
||||||
the terms of GNU General Public License v3 or any other later versions.
|
|
||||||
|
|
||||||
phasicFlow is distributed to help others in their research in the field of
|
|
||||||
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
|
|
||||||
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
-----------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "fixedWall.hpp"
|
|
||||||
#include "dictionary.hpp"
|
|
||||||
#include "vocabs.hpp"
|
|
||||||
|
|
||||||
bool pFlow::fixedWall::readDictionary
|
|
||||||
(
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
{
|
|
||||||
|
|
||||||
auto motionModel = dict.getVal<word>("motionModel");
|
|
||||||
|
|
||||||
if(motionModel != "fixedWall")
|
|
||||||
{
|
|
||||||
fatalErrorInFunction<<
|
|
||||||
" motionModel should be fixedWall, but found " << motionModel <<endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool pFlow::fixedWall::writeDictionary
|
|
||||||
(
|
|
||||||
dictionary& dict
|
|
||||||
)const
|
|
||||||
{
|
|
||||||
dict.add("motionModel", "fixedWall");
|
|
||||||
|
|
||||||
auto& motionInfo = dict.subDictOrCreate("fixedWallInfo");
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
pFlow::fixedWall::fixedWall()
|
|
||||||
{}
|
|
||||||
|
|
||||||
pFlow::fixedWall::fixedWall
|
|
||||||
(
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if(! readDictionary(dict) )
|
|
||||||
{
|
|
||||||
fatalExit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool pFlow::fixedWall::read
|
|
||||||
(
|
|
||||||
iIstream& is
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// create an empty file dictionary
|
|
||||||
dictionary motionInfo(motionModelFile__, true);
|
|
||||||
|
|
||||||
// read dictionary from stream
|
|
||||||
if( !motionInfo.read(is) )
|
|
||||||
{
|
|
||||||
ioErrorInFile(is.name(), is.lineNumber()) <<
|
|
||||||
" error in reading dictionray " << motionModelFile__ <<" from file. \n";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !readDictionary(motionInfo) ) return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool pFlow::fixedWall::write
|
|
||||||
(
|
|
||||||
iOstream& os
|
|
||||||
)const
|
|
||||||
{
|
|
||||||
// create an empty file dictionary
|
|
||||||
dictionary motionInfo(motionModelFile__, true);
|
|
||||||
|
|
||||||
if( !writeDictionary(motionInfo))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !motionInfo.write(os) )
|
|
||||||
{
|
|
||||||
ioErrorInFile( os.name(), os.lineNumber() )<<
|
|
||||||
" error in writing dictionray to file. \n";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
|
@ -1,206 +0,0 @@
|
||||||
/*------------------------------- phasicFlow ---------------------------------
|
|
||||||
O C enter of
|
|
||||||
O O E ngineering and
|
|
||||||
O O M ultiscale modeling of
|
|
||||||
OOOOOOO F luid flow
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
Copyright (C): www.cemf.ir
|
|
||||||
email: hamid.r.norouzi AT gmail.com
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
Licence:
|
|
||||||
This file is part of phasicFlow code. It is a free software for simulating
|
|
||||||
granular and multiphase flows. You can redistribute it and/or modify it under
|
|
||||||
the terms of GNU General Public License v3 or any other later versions.
|
|
||||||
|
|
||||||
phasicFlow is distributed to help others in their research in the field of
|
|
||||||
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
|
|
||||||
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
-----------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef __fixedWall_hpp__
|
|
||||||
#define __fixedWall_hpp__
|
|
||||||
|
|
||||||
|
|
||||||
#include "types.hpp"
|
|
||||||
#include "typeInfo.hpp"
|
|
||||||
#include "Vectors.hpp"
|
|
||||||
#include "uniquePtr.hpp"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace pFlow
|
|
||||||
{
|
|
||||||
|
|
||||||
class dictionary;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fixed wall motion model for walls
|
|
||||||
*
|
|
||||||
* This class is used for geometries that are fixed during simulation.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
\verbatim
|
|
||||||
// In geometryDict file, this will defines fixed walls during simulation
|
|
||||||
...
|
|
||||||
motionModel fixedWall;
|
|
||||||
...
|
|
||||||
\endverbatim
|
|
||||||
*/
|
|
||||||
class fixedWall
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/** Motion model class to be passed to computational units/kernels for
|
|
||||||
* transfing points and returning velocities at various positions
|
|
||||||
*/
|
|
||||||
class Model
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
INLINE_FUNCTION_HD
|
|
||||||
Model(){}
|
|
||||||
|
|
||||||
INLINE_FUNCTION_HD
|
|
||||||
Model(const Model&) = default;
|
|
||||||
|
|
||||||
INLINE_FUNCTION_HD
|
|
||||||
Model& operator=(const Model&) = default;
|
|
||||||
|
|
||||||
|
|
||||||
INLINE_FUNCTION_HD
|
|
||||||
realx3 pointVelocity(int32 n, const realx3 p)const
|
|
||||||
{
|
|
||||||
return 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
INLINE_FUNCTION_HD
|
|
||||||
realx3 operator()(int32 n, const realx3& p)const
|
|
||||||
{
|
|
||||||
return 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
INLINE_FUNCTION_HD
|
|
||||||
realx3 transferPoint(int32 n, const realx3 p, real dt)const
|
|
||||||
{
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
INLINE_FUNCTION_HD int32 numComponents()const
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
/// Name
|
|
||||||
const word name_ = "none";
|
|
||||||
|
|
||||||
|
|
||||||
/// Read from a dictionary
|
|
||||||
bool readDictionary(const dictionary& dict);
|
|
||||||
|
|
||||||
/// write to a dictionary
|
|
||||||
bool writeDictionary(dictionary& dict)const;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/// Type info
|
|
||||||
TypeInfoNV("fixedWall");
|
|
||||||
|
|
||||||
// - Constructors
|
|
||||||
|
|
||||||
/// Empty
|
|
||||||
fixedWall();
|
|
||||||
|
|
||||||
/// Constructor with dictionary
|
|
||||||
fixedWall(const dictionary& dict);
|
|
||||||
|
|
||||||
/// Copy constructor
|
|
||||||
fixedWall(const fixedWall&) = default;
|
|
||||||
|
|
||||||
/// Move constructor
|
|
||||||
fixedWall(fixedWall&&) = default;
|
|
||||||
|
|
||||||
/// Copy assignment
|
|
||||||
fixedWall& operator=(const fixedWall&) = default;
|
|
||||||
|
|
||||||
/// Move assignment
|
|
||||||
fixedWall& operator=(fixedWall&&) = default;
|
|
||||||
|
|
||||||
/// Destructor
|
|
||||||
~fixedWall() = default;
|
|
||||||
|
|
||||||
// - Methods
|
|
||||||
|
|
||||||
/// Return motion model
|
|
||||||
/// t is the current simulation time
|
|
||||||
Model getModel(real t)const
|
|
||||||
{
|
|
||||||
return Model();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Name of the motion component to index
|
|
||||||
int32 nameToIndex(const word& name)const
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Index of motion component to name
|
|
||||||
word indexToName(label i)const
|
|
||||||
{
|
|
||||||
return name_;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Velocity at point p
|
|
||||||
INLINE_FUNCTION_HD
|
|
||||||
realx3 pointVelocity(label n, const realx3& p)const
|
|
||||||
{
|
|
||||||
return zero3;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// Transfer point p for dt seconds according to motion component n
|
|
||||||
INLINE_FUNCTION_HD
|
|
||||||
realx3 transferPoint(label n, const realx3 p, real dt)const
|
|
||||||
{
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Transfer a vector of point pVec for dt seconds according to motion
|
|
||||||
/// component n
|
|
||||||
INLINE_FUNCTION_HD
|
|
||||||
bool transferPoint(label n, realx3* pVec, size_t numP, real dt)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Are walls moving
|
|
||||||
INLINE_FUNCTION_HD
|
|
||||||
bool isMoving()const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Move points
|
|
||||||
bool move(real t, real dt)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// - IO operations
|
|
||||||
|
|
||||||
/// Read from input stream is
|
|
||||||
FUNCTION_H
|
|
||||||
bool read(iIstream& is);
|
|
||||||
|
|
||||||
/// Write to output stream os
|
|
||||||
FUNCTION_H
|
|
||||||
bool write(iOstream& os)const;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // pFlow
|
|
||||||
|
|
||||||
#endif //__fixed_hpp__
|
|
|
@ -37,6 +37,22 @@ pFlow::rotatingAxisMotion::rotatingAxisMotion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pFlow::rotatingAxisMotion::rotatingAxisMotion
|
||||||
|
(
|
||||||
|
const objectFile &objf,
|
||||||
|
const dictionary &dict,
|
||||||
|
repository *owner
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fileDictionary(objf, dict, owner)
|
||||||
|
{
|
||||||
|
if(! getModel().impl_readDictionary(*this) )
|
||||||
|
{
|
||||||
|
fatalErrorInFunction;
|
||||||
|
fatalExit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool pFlow::rotatingAxisMotion::write
|
bool pFlow::rotatingAxisMotion::write
|
||||||
(
|
(
|
||||||
iOstream &os,
|
iOstream &os,
|
||||||
|
|
|
@ -70,12 +70,17 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TypeInfo("rotatingAxisMotion");
|
TypeInfo("rotatingAxisMotion");
|
||||||
|
|
||||||
rotatingAxisMotion(const objectFile& objf, repository* owner);
|
rotatingAxisMotion(const objectFile& objf, repository* owner);
|
||||||
|
|
||||||
|
rotatingAxisMotion(
|
||||||
|
const objectFile& objf,
|
||||||
|
const dictionary& dict,
|
||||||
|
repository* owner);
|
||||||
|
|
||||||
|
|
||||||
bool write(iOstream& os, const IOPattern& iop)const override;
|
bool write(iOstream& os, const IOPattern& iop)const override;
|
||||||
|
|
||||||
static
|
static
|
||||||
auto noneComponent()
|
auto noneComponent()
|
||||||
|
|
|
@ -0,0 +1,75 @@
|
||||||
|
/*------------------------------- phasicFlow ---------------------------------
|
||||||
|
O C enter of
|
||||||
|
O O E ngineering and
|
||||||
|
O O M ultiscale modeling of
|
||||||
|
OOOOOOO F luid flow
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
Copyright (C): www.cemf.ir
|
||||||
|
email: hamid.r.norouzi AT gmail.com
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
Licence:
|
||||||
|
This file is part of phasicFlow code. It is a free software for simulating
|
||||||
|
granular and multiphase flows. You can redistribute it and/or modify it under
|
||||||
|
the terms of GNU General Public License v3 or any other later versions.
|
||||||
|
|
||||||
|
phasicFlow is distributed to help others in their research in the field of
|
||||||
|
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
|
||||||
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
-----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "stationaryWall.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
pFlow::stationaryWall::stationaryWall
|
||||||
|
(
|
||||||
|
const objectFile &objf,
|
||||||
|
repository *owner
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fileDictionary(objf, owner)
|
||||||
|
{
|
||||||
|
|
||||||
|
if(! getModel().impl_readDictionary(*this) )
|
||||||
|
{
|
||||||
|
fatalErrorInFunction;
|
||||||
|
fatalExit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pFlow::stationaryWall::stationaryWall
|
||||||
|
(
|
||||||
|
const objectFile &objf,
|
||||||
|
const dictionary &dict,
|
||||||
|
repository *owner
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fileDictionary(objf, dict, owner)
|
||||||
|
{
|
||||||
|
if(! getModel().impl_readDictionary(*this) )
|
||||||
|
{
|
||||||
|
fatalErrorInFunction;
|
||||||
|
fatalExit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool pFlow::stationaryWall::write
|
||||||
|
(
|
||||||
|
iOstream &os,
|
||||||
|
const IOPattern &iop
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
// a global dictionary
|
||||||
|
dictionary newDict(fileDictionary::dictionary::name(), true);
|
||||||
|
if( iop.thisProcWriteData() )
|
||||||
|
{
|
||||||
|
if( !this->impl_writeDictionary(newDict) ||
|
||||||
|
!newDict.write(os))
|
||||||
|
{
|
||||||
|
fatalErrorInFunction<<
|
||||||
|
" error in writing to dictionary "<< newDict.globalName()<<endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
|
@ -0,0 +1,69 @@
|
||||||
|
/*------------------------------- phasicFlow ---------------------------------
|
||||||
|
O C enter of
|
||||||
|
O O E ngineering and
|
||||||
|
O O M ultiscale modeling of
|
||||||
|
OOOOOOO F luid flow
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
Copyright (C): www.cemf.ir
|
||||||
|
email: hamid.r.norouzi AT gmail.com
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
Licence:
|
||||||
|
This file is part of phasicFlow code. It is a free software for simulating
|
||||||
|
granular and multiphase flows. You can redistribute it and/or modify it under
|
||||||
|
the terms of GNU General Public License v3 or any other later versions.
|
||||||
|
|
||||||
|
phasicFlow is distributed to help others in their research in the field of
|
||||||
|
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
|
||||||
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
-----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef __stationaryWall_hpp__
|
||||||
|
#define __stationaryWall_hpp__
|
||||||
|
|
||||||
|
|
||||||
|
#include "MotionModel.hpp"
|
||||||
|
#include "stationary.hpp"
|
||||||
|
#include "fileDictionary.hpp"
|
||||||
|
|
||||||
|
namespace pFlow
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
class stationaryWall
|
||||||
|
:
|
||||||
|
public fileDictionary,
|
||||||
|
public MotionModel<stationaryWall, stationary>
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
|
||||||
|
bool impl_isMoving()const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
TypeInfo("stationaryWall");
|
||||||
|
|
||||||
|
stationaryWall(const objectFile& objf, repository* owner);
|
||||||
|
|
||||||
|
stationaryWall(
|
||||||
|
const objectFile& objf,
|
||||||
|
const dictionary& dict,
|
||||||
|
repository* owner);
|
||||||
|
|
||||||
|
|
||||||
|
bool write(iOstream& os, const IOPattern& iop)const override;
|
||||||
|
|
||||||
|
static
|
||||||
|
auto noneComponent()
|
||||||
|
{
|
||||||
|
return stationary();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // pFlow
|
||||||
|
|
||||||
|
|
||||||
|
#endif // __stationaryWall_hpp__
|
|
@ -14,6 +14,22 @@ pFlow::vibratingMotion::vibratingMotion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pFlow::vibratingMotion::vibratingMotion
|
||||||
|
(
|
||||||
|
const objectFile &objf,
|
||||||
|
const dictionary &dict,
|
||||||
|
repository *owner
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fileDictionary(objf,dict,owner)
|
||||||
|
{
|
||||||
|
if(! getModel().impl_readDictionary(*this) )
|
||||||
|
{
|
||||||
|
fatalErrorInFunction;
|
||||||
|
fatalExit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool pFlow::vibratingMotion::write(iOstream &os, const IOPattern &iop) const
|
bool pFlow::vibratingMotion::write(iOstream &os, const IOPattern &iop) const
|
||||||
{
|
{
|
||||||
// a global dictionary
|
// a global dictionary
|
||||||
|
|
|
@ -81,6 +81,11 @@ public:
|
||||||
|
|
||||||
vibratingMotion(const objectFile& objf, repository* owner);
|
vibratingMotion(const objectFile& objf, repository* owner);
|
||||||
|
|
||||||
|
vibratingMotion(
|
||||||
|
const objectFile& objf,
|
||||||
|
const dictionary& dict,
|
||||||
|
repository* owner);
|
||||||
|
|
||||||
/// Destructor
|
/// Destructor
|
||||||
~vibratingMotion()override = default;
|
~vibratingMotion()override = default;
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,10 @@ bool pFlow::Field<T, MemorySpace>::write
|
||||||
if(!VectorType::write(os, iop)) return false;
|
if(!VectorType::write(os, iop)) return false;
|
||||||
|
|
||||||
if(iop.thisProcWriteData())
|
if(iop.thisProcWriteData())
|
||||||
|
{
|
||||||
os.endEntry();
|
os.endEntry();
|
||||||
|
os.newLine();
|
||||||
|
}
|
||||||
|
|
||||||
if(!os.check(FUNCTION_NAME))return false;
|
if(!os.check(FUNCTION_NAME))return false;
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,11 @@ public:
|
||||||
VectorType()
|
VectorType()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
Field(const word& name)
|
||||||
|
:
|
||||||
|
VectorType(name)
|
||||||
|
{}
|
||||||
|
|
||||||
/// Construct an empty field with name and fieldKey
|
/// Construct an empty field with name and fieldKey
|
||||||
Field(const word& name, const word& fieldKey)
|
Field(const word& name, const word& fieldKey)
|
||||||
:
|
:
|
||||||
|
|
|
@ -289,6 +289,9 @@ public:
|
||||||
// - fill the whole content of vector, [begin, end), with val
|
// - fill the whole content of vector, [begin, end), with val
|
||||||
void fill( const T& val);
|
void fill( const T& val);
|
||||||
|
|
||||||
|
/// fill the content in range [start, end)
|
||||||
|
void fill( uint32 start, uint32 end, const T& val);
|
||||||
|
|
||||||
inline
|
inline
|
||||||
auto getSpan()
|
auto getSpan()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#include "Vector.hpp"
|
||||||
/*------------------------------- phasicFlow ---------------------------------
|
/*------------------------------- phasicFlow ---------------------------------
|
||||||
O C enter of
|
O C enter of
|
||||||
O O E ngineering and
|
O O E ngineering and
|
||||||
|
@ -24,9 +25,17 @@ inline void pFlow::Vector<T, Allocator>::fill( const T& val)
|
||||||
std::fill(this->begin(), this->end(), val);
|
std::fill(this->begin(), this->end(), val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T, typename Allocator>
|
||||||
|
inline void pFlow::Vector<T, Allocator>::fill(uint32 start, uint32 end, const T &val)
|
||||||
|
{
|
||||||
|
|
||||||
|
for(uint32 i=start; i<end; i++)
|
||||||
|
{
|
||||||
|
this->at(i) = val;
|
||||||
|
}
|
||||||
|
}
|
||||||
#pragma hd_warning_disable
|
#pragma hd_warning_disable
|
||||||
template<typename T, typename Allocator>
|
template < typename T, typename Allocator> inline void pFlow::Vector < T, Allocator> ::operator+= (const T &val)
|
||||||
inline void pFlow::Vector<T, Allocator>::operator +=( const T& val)
|
|
||||||
{
|
{
|
||||||
for( auto& v:(*this) )
|
for( auto& v:(*this) )
|
||||||
{
|
{
|
||||||
|
|
|
@ -362,6 +362,7 @@ void pFlow::VectorSingle<T,MemorySpace>::fill
|
||||||
const T& val
|
const T& val
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
changeSize(r.end());
|
||||||
pFlow::fill(view_, r, val);
|
pFlow::fill(view_, r, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -373,6 +374,7 @@ void pFlow::VectorSingle<T,MemorySpace>::assign
|
||||||
const T& val
|
const T& val
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
||||||
if( n > capacity() )
|
if( n > capacity() )
|
||||||
{
|
{
|
||||||
reallocateCapacitySize(evalCapacity(n), n);
|
reallocateCapacitySize(evalCapacity(n), n);
|
||||||
|
@ -392,11 +394,13 @@ void pFlow::VectorSingle<T,MemorySpace>::assign
|
||||||
uint32 cap
|
uint32 cap
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
// make sure that vector has enough capacity
|
||||||
|
uint32 newCap = max(static_cast<uint32>(src.size()), cap);
|
||||||
uint32 srcSize = src.size();
|
uint32 srcSize = src.size();
|
||||||
|
|
||||||
if(cap != capacity())
|
if(newCap != capacity())
|
||||||
{
|
{
|
||||||
reallocateCapacitySize(cap, srcSize);
|
reallocateCapacitySize(newCap, srcSize);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -415,7 +419,7 @@ void pFlow::VectorSingle<T,MemorySpace>::assign
|
||||||
const std::vector<T>& src
|
const std::vector<T>& src
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
assign(src, src.capacity());
|
assign(src, this->capacity());
|
||||||
}
|
}
|
||||||
template<typename T, typename MemorySpace>
|
template<typename T, typename MemorySpace>
|
||||||
INLINE_FUNCTION_H
|
INLINE_FUNCTION_H
|
||||||
|
|
|
@ -107,7 +107,39 @@ public:
|
||||||
return surface_;
|
return surface_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
auto size()const
|
||||||
|
{
|
||||||
|
return field_.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
auto capacity()const
|
||||||
|
{
|
||||||
|
return field_.capacity();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
void assign(const std::vector<T>& vals)
|
||||||
|
{
|
||||||
|
if(vals.size() != surface_.size())
|
||||||
|
{
|
||||||
|
fatalErrorInFunction;
|
||||||
|
fatalExit;
|
||||||
|
}
|
||||||
|
field_.assign(vals, surface_.capacity());
|
||||||
|
}
|
||||||
|
|
||||||
|
bool hearChanges(
|
||||||
|
real t,
|
||||||
|
real dt,
|
||||||
|
uint32 iter,
|
||||||
|
const message& msg,
|
||||||
|
const anyList& varList) override
|
||||||
|
{
|
||||||
|
notImplementedFunction;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//// - IO operations
|
//// - IO operations
|
||||||
bool write(iOstream& is, const IOPattern& iop)const override;
|
bool write(iOstream& is, const IOPattern& iop)const override;
|
||||||
|
|
|
@ -29,30 +29,19 @@ Licence:
|
||||||
namespace pFlow
|
namespace pFlow
|
||||||
{
|
{
|
||||||
|
|
||||||
/*using realTriSurfaceField_D = triSurfaceField<VectorSingle, real> ;
|
using uint32TriSurfaceField_D = triSurfaceField<uint32> ;
|
||||||
|
|
||||||
using realTriSurfaceField_H = triSurfaceField<VectorSingle, real, HostSpace> ;
|
using uint32TriSurfaceField_H = triSurfaceField<uint32, HostSpace> ;
|
||||||
|
|
||||||
using realx3TriSurfaceField_D = triSurfaceField<VectorSingle, realx3> ;
|
using realTriSurfaceField_D = triSurfaceField<real> ;
|
||||||
|
|
||||||
using realx3TriSurfaceField_H = triSurfaceField<VectorSingle, realx3, HostSpace> ;
|
using realTriSurfaceField_H = triSurfaceField<real, HostSpace> ;
|
||||||
|
|
||||||
using realTriSurfaceField_HD = triSurfaceField<VectorDual, real> ;
|
using realx3TriSurfaceField_D = triSurfaceField<realx3> ;
|
||||||
|
|
||||||
using realx3TriSurfaceField_HD = triSurfaceField<VectorDual, realx3> ;
|
using realx3TriSurfaceField_H = triSurfaceField<realx3, HostSpace> ;
|
||||||
|
|
||||||
using realTriSurfaceField = triSurfaceField<Vector, real, vecAllocator<real>> ;
|
|
||||||
|
|
||||||
using realx3TriSurfaceField = triSurfaceField<Vector, realx3, vecAllocator<realx3>> ;
|
|
||||||
|
|
||||||
using int8TriSurfaceField_D = triSurfaceField<VectorSingle, int8> ;
|
|
||||||
|
|
||||||
using int8TriSurfaceField_H = triSurfaceField<VectorSingle, int8, HostSpace> ;
|
|
||||||
|
|
||||||
using int8TriSurfaceField_HD = triSurfaceField<VectorDual, int8> ;
|
|
||||||
|
|
||||||
using int8TriSurfaceField = triSurfaceField<Vector, int8, vecAllocator<real>> ;
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -299,6 +299,13 @@ pFlow::dictionary::dictionary
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pFlow::dictionary::dictionary(const dictionary &src, bool global)
|
||||||
|
:
|
||||||
|
dictionary(src)
|
||||||
|
{
|
||||||
|
isGlobal_ = global;
|
||||||
|
}
|
||||||
|
|
||||||
pFlow::dictionary& pFlow::dictionary::operator=
|
pFlow::dictionary& pFlow::dictionary::operator=
|
||||||
(
|
(
|
||||||
const dictionary& rhs
|
const dictionary& rhs
|
||||||
|
|
|
@ -144,6 +144,8 @@ public:
|
||||||
/// entries_ are copied smoothly. set parrent dict to nullDict
|
/// entries_ are copied smoothly. set parrent dict to nullDict
|
||||||
dictionary(const dictionary& );
|
dictionary(const dictionary& );
|
||||||
|
|
||||||
|
dictionary(const dictionary& src, bool global);
|
||||||
|
|
||||||
|
|
||||||
/// assignment preserve name of this dictionary
|
/// assignment preserve name of this dictionary
|
||||||
/// only entries are transfered with ownership
|
/// only entries are transfered with ownership
|
||||||
|
|
|
@ -43,6 +43,30 @@ pFlow::fileDictionary::fileDictionary(const word &keyword, const fileSystem &fil
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
pFlow::fileDictionary::fileDictionary
|
||||||
|
(
|
||||||
|
const objectFile &objf,
|
||||||
|
const dictionary &dict,
|
||||||
|
repository *owner
|
||||||
|
)
|
||||||
|
:
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
objectFile
|
||||||
|
(
|
||||||
|
objf.name(),
|
||||||
|
objf.localPath(),
|
||||||
|
objectFile::READ_NEVER,
|
||||||
|
objf.wFlag()
|
||||||
|
),
|
||||||
|
IOPattern::AllProcessorsSimilar,
|
||||||
|
owner
|
||||||
|
),
|
||||||
|
dictionary(dict, true)
|
||||||
|
{
|
||||||
|
dictionary::name_ = IOobject::path().wordPath();
|
||||||
|
}
|
||||||
|
|
||||||
bool pFlow::fileDictionary::read(iIstream &is, const IOPattern &iop)
|
bool pFlow::fileDictionary::read(iIstream &is, const IOPattern &iop)
|
||||||
{
|
{
|
||||||
return dictionary::read(is);
|
return dictionary::read(is);
|
||||||
|
|
|
@ -41,7 +41,10 @@ public:
|
||||||
/// construct a dictionary with name and read it from file
|
/// construct a dictionary with name and read it from file
|
||||||
fileDictionary(const word& keyword, const fileSystem& file);
|
fileDictionary(const word& keyword, const fileSystem& file);
|
||||||
|
|
||||||
|
fileDictionary(
|
||||||
|
const objectFile& objf,
|
||||||
|
const dictionary& dict,
|
||||||
|
repository* owner=nullptr);
|
||||||
|
|
||||||
/// read from stream
|
/// read from stream
|
||||||
bool read(iIstream& is, const IOPattern& iop) override;
|
bool read(iIstream& is, const IOPattern& iop) override;
|
||||||
|
|
|
@ -36,6 +36,9 @@ pFlow::IOobject::IOobject
|
||||||
|
|
||||||
if(owner_&& !owner->addToRepository(this))
|
if(owner_&& !owner->addToRepository(this))
|
||||||
{
|
{
|
||||||
|
fatalErrorInFunction<<
|
||||||
|
"failed to add object "<< objf.name()<<
|
||||||
|
" to repository "<< owner->name()<<endl;
|
||||||
fatalExit;
|
fatalExit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,7 @@ bool pFlow::repository::addToRepository(IOobject* io)
|
||||||
if( !objects_.insertIf(io->name(), io ) )
|
if( !objects_.insertIf(io->name(), io ) )
|
||||||
{
|
{
|
||||||
warningInFunction<<
|
warningInFunction<<
|
||||||
"Failed to add repository " << io->name() <<
|
"Failed to add object " << io->name() <<
|
||||||
" to repository " << this->name() <<
|
" to repository " << this->name() <<
|
||||||
". It is already in this repository. \n";
|
". It is already in this repository. \n";
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -171,6 +171,20 @@ pFlow::multiTriSurface::multiTriSurface
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pFlow::multiTriSurface::multiTriSurface
|
||||||
|
(
|
||||||
|
const objectFile &objf,
|
||||||
|
repository *owner,
|
||||||
|
const multiTriSurface &surf
|
||||||
|
)
|
||||||
|
:
|
||||||
|
triSurface(objf, owner, surf),
|
||||||
|
subscriber("multiTriSurface"),
|
||||||
|
subSurfaces_(surf.subSurfaces_)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
bool pFlow::multiTriSurface::appendTriSurface
|
bool pFlow::multiTriSurface::appendTriSurface
|
||||||
(
|
(
|
||||||
const word &name,
|
const word &name,
|
||||||
|
@ -193,8 +207,17 @@ bool pFlow::multiTriSurface::appendTriSurface
|
||||||
}
|
}
|
||||||
|
|
||||||
bool pFlow::multiTriSurface::read(iIstream &is, const IOPattern &iop)
|
bool pFlow::multiTriSurface::read(iIstream &is, const IOPattern &iop)
|
||||||
{
|
{
|
||||||
return false;
|
subSurfaces_.clear();
|
||||||
|
|
||||||
|
if( !is.findKeywordAndVal("subSurfaces", subSurfaces_ ) )
|
||||||
|
{
|
||||||
|
fatalErrorInFunction<<
|
||||||
|
"Error in reading subSurfaces from stream "<< is.name()<<endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return triSurface::read(is, iop);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool pFlow::multiTriSurface::write
|
bool pFlow::multiTriSurface::write
|
||||||
|
@ -203,6 +226,8 @@ bool pFlow::multiTriSurface::write
|
||||||
const IOPattern &iop
|
const IOPattern &iop
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if( iop.thisProcWriteData() )
|
if( iop.thisProcWriteData() )
|
||||||
{
|
{
|
||||||
os.writeWordEntry("subSurfaces", subSurfaces_);
|
os.writeWordEntry("subSurfaces", subSurfaces_);
|
||||||
|
|
|
@ -53,6 +53,11 @@ public:
|
||||||
//
|
//
|
||||||
multiTriSurface(const objectFile& obj, repository* owner);
|
multiTriSurface(const objectFile& obj, repository* owner);
|
||||||
|
|
||||||
|
multiTriSurface(
|
||||||
|
const objectFile& objf,
|
||||||
|
repository* owner,
|
||||||
|
const multiTriSurface& surf);
|
||||||
|
|
||||||
multiTriSurface(const multiTriSurface&) = default;
|
multiTriSurface(const multiTriSurface&) = default;
|
||||||
|
|
||||||
multiTriSurface& operator = (const multiTriSurface&) = default;
|
multiTriSurface& operator = (const multiTriSurface&) = default;
|
||||||
|
@ -78,6 +83,29 @@ public:
|
||||||
{
|
{
|
||||||
return subSurfaces_;
|
return subSurfaces_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rangeU32 subSurfaceRange(uint32 nSub)
|
||||||
|
{
|
||||||
|
if( !(nSub < numSurfaces() ) )
|
||||||
|
{
|
||||||
|
fatalErrorInFunction;
|
||||||
|
fatalExit;
|
||||||
|
}
|
||||||
|
return {subSurfaces_[nSub].start(),subSurfaces_[nSub].end()};
|
||||||
|
}
|
||||||
|
|
||||||
|
rangeU32 subSurfacePointRange(uint32 nSub)const
|
||||||
|
{
|
||||||
|
if( !(nSub < numSurfaces() ) )
|
||||||
|
{
|
||||||
|
fatalErrorInFunction;
|
||||||
|
fatalExit;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
subSurfaces_[nSub].pointStart(),
|
||||||
|
subSurfaces_[nSub].pointEnd()};
|
||||||
|
}
|
||||||
|
|
||||||
/*void clear()
|
/*void clear()
|
||||||
{
|
{
|
||||||
triSurface::clear();
|
triSurface::clear();
|
||||||
|
|
|
@ -126,26 +126,44 @@ pFlow::triSurface::triSurface
|
||||||
|
|
||||||
pFlow::triSurface::triSurface
|
pFlow::triSurface::triSurface
|
||||||
(
|
(
|
||||||
const realx3x3Field_H &triangles,
|
const objectFile &objf,
|
||||||
repository* owner
|
repository* owner,
|
||||||
|
const triSurface &surf
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
objectFile
|
objectFile
|
||||||
(
|
(
|
||||||
triangles.name(),
|
objf.name(),
|
||||||
"",
|
objf.localPath(),
|
||||||
IOobject::READ_NEVER,
|
objectFile::READ_NEVER,
|
||||||
IOobject::WRITE_ALWAYS
|
objf.wFlag()
|
||||||
),
|
),
|
||||||
IOPattern::AllProcessorsSimilar,
|
IOPattern::AllProcessorsSimilar,
|
||||||
owner
|
owner
|
||||||
),
|
),
|
||||||
points_("points", "points"),
|
points_(surf.points_),
|
||||||
vertices_("vertices", "vertices"),
|
vertices_(surf.vertices_),
|
||||||
area_("area", "area"),
|
area_(surf.area_),
|
||||||
normals_("normals","normals")
|
normals_(surf.normals_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
pFlow::triSurface::triSurface(
|
||||||
|
const realx3x3Field_H &triangles,
|
||||||
|
repository *owner)
|
||||||
|
: IOobject(
|
||||||
|
objectFile(
|
||||||
|
triangles.name(),
|
||||||
|
"",
|
||||||
|
IOobject::READ_NEVER,
|
||||||
|
IOobject::WRITE_ALWAYS),
|
||||||
|
IOPattern::AllProcessorsSimilar,
|
||||||
|
owner),
|
||||||
|
points_("points", "points"),
|
||||||
|
vertices_("vertices", "vertices"),
|
||||||
|
area_("area", "area"),
|
||||||
|
normals_("normals", "normals")
|
||||||
{
|
{
|
||||||
if( !appendTriSurface(triangles) )
|
if( !appendTriSurface(triangles) )
|
||||||
{
|
{
|
||||||
|
@ -238,6 +256,8 @@ bool pFlow::triSurface::read(iIstream &is, const IOPattern &iop)
|
||||||
" when reading field "<< vertices_.name()<<endl;
|
" when reading field "<< vertices_.name()<<endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WARNING<<"You should calculate area and normal after reading "<<END_WARNING;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,6 +62,11 @@ public:
|
||||||
// - type info
|
// - type info
|
||||||
TypeInfo("triSurface");
|
TypeInfo("triSurface");
|
||||||
|
|
||||||
|
triSurface(
|
||||||
|
const objectFile& objf,
|
||||||
|
repository* owner,
|
||||||
|
const triSurface& surf);
|
||||||
|
|
||||||
//// - Constructors
|
//// - Constructors
|
||||||
|
|
||||||
// - construct from vertices of triangles
|
// - construct from vertices of triangles
|
||||||
|
|
|
@ -145,10 +145,9 @@ namespace pFlow
|
||||||
|
|
||||||
|
|
||||||
#define TypeInfoTemplate11(tName, Type) \
|
#define TypeInfoTemplate11(tName, Type) \
|
||||||
has_static_member(TYPENAME); \
|
|
||||||
inline static word TYPENAME() \
|
inline static word TYPENAME() \
|
||||||
{ \
|
{ \
|
||||||
return word(tName)+"<"+getTypeName<Type1>()+">"; \
|
return word(tName)+"<"+getTypeName<Type>()+">"; \
|
||||||
} \
|
} \
|
||||||
virtual word typeName() const { return TYPENAME();}
|
virtual word typeName() const { return TYPENAME();}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue