Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
6aba1d08
Commit
6aba1d08
authored
Dec 13, 2012
by
andy
Browse files
ENH: Updated moving mesh support in function objects
parent
4cf65554
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.H
View file @
6aba1d08
...
...
@@ -133,10 +133,10 @@ public:
}
//- Update for changes of mesh
virtual
void
movePoints
(
const
po
intField
&
points
)
virtual
void
movePoints
(
const
po
lyMesh
&
mesh
)
{
read
();
OutputFilter
::
movePoints
(
points
);
OutputFilter
::
movePoints
(
mesh
);
}
};
...
...
src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C
View file @
6aba1d08
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2012
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -26,6 +26,7 @@ License
#include
"OutputFilterFunctionObject.H"
#include
"IOOutputFilter.H"
#include
"polyMesh.H"
#include
"mapPolyMesh.H"
#include
"addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * Private Members * * * * * * * * * * * * * * //
...
...
@@ -221,4 +222,30 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::read
}
template
<
class
OutputFilter
>
void
Foam
::
OutputFilterFunctionObject
<
OutputFilter
>::
updateMesh
(
const
mapPolyMesh
&
mpm
)
{
if
(
active
()
&&
mpm
.
mesh
().
name
()
==
regionName_
)
{
ptr_
->
updateMesh
(
mpm
);
}
}
template
<
class
OutputFilter
>
void
Foam
::
OutputFilterFunctionObject
<
OutputFilter
>::
movePoints
(
const
polyMesh
&
mesh
)
{
if
(
active
()
&&
mesh
.
name
()
==
regionName_
)
{
ptr_
->
movePoints
(
mesh
);
}
}
// ************************************************************************* //
src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H
View file @
6aba1d08
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2012
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -204,6 +204,12 @@ public:
//- Read and set the function object if its data have changed
virtual
bool
read
(
const
dictionary
&
);
//- Update for changes of mesh
virtual
void
updateMesh
(
const
mapPolyMesh
&
mpm
);
//- Update for changes of mesh
virtual
void
movePoints
(
const
polyMesh
&
mesh
);
};
...
...
src/OpenFOAM/db/functionObjects/functionObject/functionObject.H
View file @
6aba1d08
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2012
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -49,6 +49,8 @@ namespace Foam
// Forward declaration of classes
class
Time
;
class
polyMesh
;
class
mapPolyMesh
;
/*---------------------------------------------------------------------------*\
Class functionObject Declaration
...
...
@@ -157,6 +159,12 @@ public:
//- Read and set the function object if its data have changed
virtual
bool
read
(
const
dictionary
&
)
=
0
;
//- Update for changes of mesh
virtual
void
updateMesh
(
const
mapPolyMesh
&
mpm
)
=
0
;
//- Update for changes of mesh
virtual
void
movePoints
(
const
polyMesh
&
mesh
)
=
0
;
};
...
...
src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C
View file @
6aba1d08
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2012
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -25,11 +25,15 @@ License
#include
"functionObjectList.H"
#include
"Time.H"
#include
"mapPolyMesh.H"
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
Foam
::
functionObject
*
Foam
::
functionObjectList
::
remove
(
const
word
&
key
,
label
&
oldIndex
)
Foam
::
functionObject
*
Foam
::
functionObjectList
::
remove
(
const
word
&
key
,
label
&
oldIndex
)
{
functionObject
*
ptr
=
0
;
...
...
@@ -319,4 +323,28 @@ bool Foam::functionObjectList::read()
}
void
Foam
::
functionObjectList
::
updateMesh
(
const
mapPolyMesh
&
mpm
)
{
if
(
execution_
)
{
forAll
(
*
this
,
objectI
)
{
operator
[](
objectI
).
updateMesh
(
mpm
);
}
}
}
void
Foam
::
functionObjectList
::
movePoints
(
const
polyMesh
&
mesh
)
{
if
(
execution_
)
{
forAll
(
*
this
,
objectI
)
{
operator
[](
objectI
).
movePoints
(
mesh
);
}
}
}
// ************************************************************************* //
src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H
View file @
6aba1d08
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2012
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -49,6 +49,8 @@ SourceFiles
namespace
Foam
{
class
mapPolyMesh
;
/*---------------------------------------------------------------------------*\
Class functionObjectList Declaration
\*---------------------------------------------------------------------------*/
...
...
@@ -163,6 +165,12 @@ public:
//- Read and set the function objects if their data have changed
virtual
bool
read
();
//- Update for changes of mesh
virtual
void
updateMesh
(
const
mapPolyMesh
&
mpm
);
//- Update for changes of mesh
virtual
void
movePoints
(
const
polyMesh
&
mesh
);
};
...
...
src/OpenFOAM/meshes/polyMesh/polyMesh.C
View file @
6aba1d08
...
...
@@ -1173,6 +1173,8 @@ Foam::tmp<Foam::scalarField> Foam::polyMesh::movePoints
).
movePoints
(
points_
);
}
const_cast
<
Time
&>
(
time
()).
functionObjects
().
movePoints
(
*
this
);
return
sweptVols
;
}
...
...
src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C
View file @
6aba1d08
...
...
@@ -109,6 +109,8 @@ void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm)
)
).
updateMesh
(
mpm
);
}
const_cast
<
Time
&>
(
time
()).
functionObjects
().
updateMesh
(
mpm
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment