Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
12adfe13
Commit
12adfe13
authored
Mar 01, 2019
by
Mark Olesen
Committed by
Andrew Heather
Mar 01, 2019
Browse files
ENH: update empty sampled surfaces storage (
#1217
)
- also store empty sampled surfaces, otherwise we miss geometry updates.
parent
97be0673
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C
View file @
12adfe13
...
...
@@ -490,8 +490,7 @@ bool Foam::sampledSurfaces::read(const dictionary& dict)
bool
Foam
::
sampledSurfaces
::
performAction
(
unsigned
request
)
{
// Update surfaces, writer associations etc.
// Update surfaces and store
bool
ok
=
false
;
forAll
(
*
this
,
surfi
)
...
...
@@ -508,12 +507,27 @@ bool Foam::sampledSurfaces::performAction(unsigned request)
nFaces_
[
surfi
]
=
returnReduce
(
s
.
faces
().
size
(),
sumOp
<
label
>
());
ok
=
ok
||
nFaces_
[
surfi
];
// Store surfaces (even empty ones) otherwise we miss geometry
// updates.
// Any associated fields will be removed if the size changes
if
((
request
&
actions_
[
surfi
])
&
ACTION_STORE
)
{
storeRegistrySurface
(
s
);
}
if
((
request
&
actions_
[
surfi
])
&
ACTION_SURF_MESH
)
{
s
.
storeSurfMesh
();
}
}
}
if
(
!
ok
)
{
// No surface with
faces or
an applicable action
// No surface with an applicable action
or with faces to sample
return
true
;
}
...
...
@@ -522,36 +536,13 @@ bool Foam::sampledSurfaces::performAction(unsigned request)
// Only seems to be needed for VTK legacy
countFields
();
// Update writers
forAll
(
*
this
,
surfi
)
{
const
sampledSurface
&
s
=
(
*
this
)[
surfi
];
if
(
!
(
request
&
actions_
[
surfi
]))
{
continue
;
}
// TDB: do we store empty surfaces, skip them, or remove them
// from the registry?
// - For now, just skip touching them.
if
(
!
nFaces_
[
surfi
])
{
continue
;
}
if
((
request
&
actions_
[
surfi
])
&
ACTION_STORE
)
{
storeRegistrySurface
(
s
);
}
if
((
request
&
actions_
[
surfi
])
&
ACTION_SURF_MESH
)
{
s
.
storeSurfMesh
();
}
if
((
request
&
actions_
[
surfi
])
&
ACTION_WRITE
)
if
(((
request
&
actions_
[
surfi
])
&
ACTION_WRITE
)
&&
nFaces_
[
surfi
])
{
// Output writers
surfaceWriter
&
outWriter
=
writers_
[
surfi
];
...
...
@@ -588,6 +579,8 @@ bool Foam::sampledSurfaces::performAction(unsigned request)
}
}
// Sample fields
const
IOobjectList
objects
(
obr_
,
obr_
.
time
().
timeName
());
performAction
<
volScalarField
>
(
objects
,
request
);
...
...
src/surfMesh/polySurface/polySurface.H
View file @
12adfe13
...
...
@@ -140,10 +140,6 @@ protected:
}
//- Update with new contents
void
copyContents
(
const
MeshedSurface
<
face
>&
surf
,
bool
validate
=
false
);
public:
// Public Typedefs
...
...
Write
Preview
Markdown
is supported
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