Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
b74e1004
Commit
b74e1004
authored
4 years ago
by
Kutalmış Berçin
Browse files
Options
Downloads
Patches
Plain Diff
BUG: MappedFile: ensure separate entry scopes (fixes
#2098
)
BUG: MappedFile: ensure rmap() and automap() consistent
parent
48cdf552
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/meshTools/PatchFunction1/MappedFile/MappedFile.C
+50
-20
50 additions, 20 deletions
src/meshTools/PatchFunction1/MappedFile/MappedFile.C
src/meshTools/PatchFunction1/MappedFile/MappedFile.H
+27
-9
27 additions, 9 deletions
src/meshTools/PatchFunction1/MappedFile/MappedFile.H
with
77 additions
and
29 deletions
src/meshTools/PatchFunction1/MappedFile/MappedFile.C
+
50
−
20
View file @
b74e1004
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\ / A nd | www.openfoam.com
\\/ M anipulation |
\\/ M anipulation |
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Copyright (C) 2018-202
0
OpenCFD Ltd.
Copyright (C) 2018-202
1
OpenCFD Ltd.
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
License
License
This file is part of OpenFOAM.
This file is part of OpenFOAM.
...
@@ -175,8 +175,13 @@ void Foam::PatchFunction1Types::MappedFile<Type>::autoMap
...
@@ -175,8 +175,13 @@ void Foam::PatchFunction1Types::MappedFile<Type>::autoMap
if
(
startSampledValues_
.
size
())
if
(
startSampledValues_
.
size
())
{
{
startSampledValues_
.
autoMap
(
mapper
);
startSampledValues_
.
autoMap
(
mapper
);
}
if
(
endSampledValues_
.
size
())
{
endSampledValues_
.
autoMap
(
mapper
);
endSampledValues_
.
autoMap
(
mapper
);
}
}
// Clear interpolator
// Clear interpolator
mapperPtr_
.
clear
();
mapperPtr_
.
clear
();
startSampleTime_
=
-
1
;
startSampleTime_
=
-
1
;
...
@@ -196,8 +201,17 @@ void Foam::PatchFunction1Types::MappedFile<Type>::rmap
...
@@ -196,8 +201,17 @@ void Foam::PatchFunction1Types::MappedFile<Type>::rmap
const
PatchFunction1Types
::
MappedFile
<
Type
>&
tiptf
=
const
PatchFunction1Types
::
MappedFile
<
Type
>&
tiptf
=
refCast
<
const
PatchFunction1Types
::
MappedFile
<
Type
>>
(
pf1
);
refCast
<
const
PatchFunction1Types
::
MappedFile
<
Type
>>
(
pf1
);
startSampledValues_
.
rmap
(
tiptf
.
startSampledValues_
,
addr
);
if
(
tiptf
.
startSampledValues_
.
size
())
endSampledValues_
.
rmap
(
tiptf
.
endSampledValues_
,
addr
);
{
startSampledValues_
.
setSize
(
this
->
size
());
startSampledValues_
.
rmap
(
tiptf
.
startSampledValues_
,
addr
);
}
if
(
tiptf
.
endSampledValues_
.
size
())
{
endSampledValues_
.
setSize
(
this
->
size
());
endSampledValues_
.
rmap
(
tiptf
.
endSampledValues_
,
addr
);
}
// Clear interpolator
// Clear interpolator
mapperPtr_
.
clear
();
mapperPtr_
.
clear
();
...
@@ -584,27 +598,11 @@ Foam::PatchFunction1Types::MappedFile<Type>::integrate
...
@@ -584,27 +598,11 @@ Foam::PatchFunction1Types::MappedFile<Type>::integrate
template
<
class
Type
>
template
<
class
Type
>
void
Foam
::
PatchFunction1Types
::
MappedFile
<
Type
>::
write
Data
void
Foam
::
PatchFunction1Types
::
MappedFile
<
Type
>::
write
Entries
(
(
Ostream
&
os
Ostream
&
os
)
const
)
const
{
{
PatchFunction1
<
Type
>::
writeData
(
os
);
// Check if field name explicitly provided
// (e.g. through timeVaryingMapped bc)
if
(
dictConstructed_
)
{
os
.
writeEntry
(
this
->
name
(),
type
());
os
.
writeEntryIfDifferent
(
"fieldTable"
,
this
->
name
(),
fieldTableName_
);
}
if
(
setAverage_
)
if
(
setAverage_
)
{
{
os
.
writeEntry
(
"setAverage"
,
setAverage_
);
os
.
writeEntry
(
"setAverage"
,
setAverage_
);
...
@@ -628,4 +626,36 @@ void Foam::PatchFunction1Types::MappedFile<Type>::writeData
...
@@ -628,4 +626,36 @@ void Foam::PatchFunction1Types::MappedFile<Type>::writeData
}
}
template
<
class
Type
>
void
Foam
::
PatchFunction1Types
::
MappedFile
<
Type
>::
writeData
(
Ostream
&
os
)
const
{
PatchFunction1
<
Type
>::
writeData
(
os
);
// Check if field name explicitly provided
// (e.g. through timeVaryingMapped bc)
if
(
dictConstructed_
)
{
os
.
writeEntry
(
this
->
name
(),
type
());
os
.
writeEntryIfDifferent
(
"fieldTable"
,
this
->
name
(),
fieldTableName_
);
os
.
beginBlock
(
word
(
this
->
name
()
+
"Coeffs"
));
writeEntries
(
os
);
os
.
endBlock
();
}
else
{
writeEntries
(
os
);
}
}
// ************************************************************************* //
// ************************************************************************* //
This diff is collapsed.
Click to expand it.
src/meshTools/PatchFunction1/MappedFile/MappedFile.H
+
27
−
9
View file @
b74e1004
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\ / A nd | www.openfoam.com
\\/ M anipulation |
\\/ M anipulation |
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Copyright (C) 2018-202
0
OpenCFD Ltd.
Copyright (C) 2018-202
1
OpenCFD Ltd.
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
License
License
This file is part of OpenFOAM.
This file is part of OpenFOAM.
...
@@ -27,19 +27,34 @@ Class
...
@@ -27,19 +27,34 @@ Class
Foam::PatchFunction1Types::MappedFile
Foam::PatchFunction1Types::MappedFile
Description
Description
Patch value mapping from file
Patch value mapping from a set of values stored in a file and
a set of unstructured points using the following directory structure:
\verbatim
constant/boundaryData/\<patchName\>/points
constant/boundaryData/\<patchName\>/\<time\>/\<field\>
\endverbatim
Options:
Options:
\table
\table
Property | Description | Required | Default
Property | Description | Type | Reqd | Deflt
mapMethod | (nearest/planarInterpolation) | no | planarInterpolation
mapMethod | Mapping method | word | no <!--
offset | Time-varying offset values to interpolated data | no |
--> | planarInterpolation
fieldTable | Name of field data table | no | field-name
offset | Time-varying offset values to interpolated data <!--
points | The name of the points file | no | points
--> | Function1\<Type\> | no | -
perturb | Perturbation fraction of bounding box | no | 1e-5
fieldTable | Name of field data table | word | no | field-name
setAverage | adjust mapped field to maintain average value | no | false
points | Name of the points file | word | no | points
perturb | Perturbation fraction of bounding box | scalar | no | 1e-5
setAverage | Adjust mapped field to maintain average value <!--
--> | scalar | no | false
\endtable
\endtable
Options for the \c mapMethod entry:
\verbatim
nearest | Use nearest points only (avoids triangulation)
planarInterpolation | Interpolation using 2D Delaunay triangulation
\endverbatim
SourceFiles
SourceFiles
MappedFile.C
MappedFile.C
...
@@ -229,6 +244,9 @@ public:
...
@@ -229,6 +244,9 @@ public:
// I-O
// I-O
//- Write coefficient entries in dictionary format
void
writeEntries
(
Ostream
&
os
)
const
;
//- Write in dictionary format
//- Write in dictionary format
virtual
void
writeData
(
Ostream
&
os
)
const
;
virtual
void
writeData
(
Ostream
&
os
)
const
;
};
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment