functionObjects::surfaceFieldValue: Update on mesh change
check that the mesh corresponds to the functionObject region
This commit is contained in:
@ -27,7 +27,9 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::polyMeshMap::polyMeshMap()
|
Foam::polyMeshMap::polyMeshMap(const polyMesh& mesh)
|
||||||
|
:
|
||||||
|
mesh_(mesh)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -50,19 +50,30 @@ class polyMesh;
|
|||||||
|
|
||||||
class polyMeshMap
|
class polyMeshMap
|
||||||
{
|
{
|
||||||
|
// Private Data
|
||||||
|
|
||||||
|
//- Reference to polyMesh
|
||||||
|
const polyMesh& mesh_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null
|
//- Construct for mesh
|
||||||
polyMeshMap();
|
polyMeshMap(const polyMesh& mesh);
|
||||||
|
|
||||||
//- Disallow default bitwise copy construction
|
//- Disallow default bitwise copy construction
|
||||||
polyMeshMap(const polyMeshMap&) = delete;
|
polyMeshMap(const polyMeshMap&) = delete;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
//- Return polyMesh
|
||||||
|
const polyMesh& mesh() const
|
||||||
|
{
|
||||||
|
return mesh_;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -31,6 +31,7 @@ License
|
|||||||
#include "indirectPrimitivePatch.H"
|
#include "indirectPrimitivePatch.H"
|
||||||
#include "PatchTools.H"
|
#include "PatchTools.H"
|
||||||
#include "polyTopoChangeMap.H"
|
#include "polyTopoChangeMap.H"
|
||||||
|
#include "polyMeshMap.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -832,8 +833,11 @@ void Foam::functionObjects::fieldValues::surfaceFieldValue::movePoints
|
|||||||
const polyMesh& mesh
|
const polyMesh& mesh
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Moving mesh might affect patch or region area
|
if (&mesh == &mesh_)
|
||||||
totalArea_ = totalArea();
|
{
|
||||||
|
// It may be necessary to reset if the mesh moves
|
||||||
|
// initialise(dict_);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -841,18 +845,24 @@ void Foam::functionObjects::fieldValues::surfaceFieldValue::topoChange
|
|||||||
(
|
(
|
||||||
const polyTopoChangeMap& map
|
const polyTopoChangeMap& map
|
||||||
)
|
)
|
||||||
|
{
|
||||||
|
if (&map.mesh() == &mesh_)
|
||||||
{
|
{
|
||||||
initialise(dict_);
|
initialise(dict_);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::functionObjects::fieldValues::surfaceFieldValue::mapMesh
|
void Foam::functionObjects::fieldValues::surfaceFieldValue::mapMesh
|
||||||
(
|
(
|
||||||
const polyMeshMap& map
|
const polyMeshMap& map
|
||||||
)
|
)
|
||||||
|
{
|
||||||
|
if (&map.mesh() == &mesh_)
|
||||||
{
|
{
|
||||||
initialise(dict_);
|
initialise(dict_);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -30,6 +30,8 @@ License
|
|||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "writeFile.H"
|
#include "writeFile.H"
|
||||||
|
#include "polyTopoChangeMap.H"
|
||||||
|
#include "polyMeshMap.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -349,25 +351,37 @@ bool Foam::functionObjects::layerAverage::write()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::functionObjects::layerAverage::movePoints(const polyMesh&)
|
void Foam::functionObjects::layerAverage::movePoints(const polyMesh& mesh)
|
||||||
|
{
|
||||||
|
if (&mesh == &mesh_)
|
||||||
{
|
{
|
||||||
Info<< type() << " " << name() << ":" << nl;
|
Info<< type() << " " << name() << ":" << nl;
|
||||||
calcLayers();
|
calcLayers();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::functionObjects::layerAverage::topoChange(const polyTopoChangeMap&)
|
void Foam::functionObjects::layerAverage::topoChange
|
||||||
|
(
|
||||||
|
const polyTopoChangeMap& map
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (&map.mesh() == &mesh_)
|
||||||
{
|
{
|
||||||
Info<< type() << " " << name() << ":" << nl;
|
Info<< type() << " " << name() << ":" << nl;
|
||||||
calcLayers();
|
calcLayers();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::functionObjects::layerAverage::mapMesh(const polyMeshMap&)
|
void Foam::functionObjects::layerAverage::mapMesh(const polyMeshMap& map)
|
||||||
|
{
|
||||||
|
if (&map.mesh() == &mesh_)
|
||||||
{
|
{
|
||||||
Info<< type() << " " << name() << ":" << nl;
|
Info<< type() << " " << name() << ":" << nl;
|
||||||
calcLayers();
|
calcLayers();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -34,8 +34,9 @@ License
|
|||||||
#include "distributionMap.H"
|
#include "distributionMap.H"
|
||||||
#include "interpolationCellPoint.H"
|
#include "interpolationCellPoint.H"
|
||||||
#include "PatchTools.H"
|
#include "PatchTools.H"
|
||||||
#include "polyTopoChangeMap.H"
|
|
||||||
#include "writeFile.H"
|
#include "writeFile.H"
|
||||||
|
#include "polyTopoChangeMap.H"
|
||||||
|
#include "polyMeshMap.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -611,9 +612,12 @@ void Foam::functionObjects::streamlines::mapMesh
|
|||||||
(
|
(
|
||||||
const polyMeshMap& map
|
const polyMeshMap& map
|
||||||
)
|
)
|
||||||
|
{
|
||||||
|
if (&map.mesh() == &mesh_)
|
||||||
{
|
{
|
||||||
read(dict_);
|
read(dict_);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -244,7 +244,7 @@ bool Foam::fvMeshTopoChangers::meshToMesh::update()
|
|||||||
// Interpolate U's to Uf's
|
// Interpolate U's to Uf's
|
||||||
interpolateUfs();
|
interpolateUfs();
|
||||||
|
|
||||||
polyMeshMap map;
|
polyMeshMap map(mesh());
|
||||||
mesh().mapMesh(map);
|
mesh().mapMesh(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user