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
9461d950
Commit
9461d950
authored
6 years ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
ENH: PatchFunction1: work with points. See 1046.
parent
c6cf671d
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/ConstantField/ConstantField.C
+35
-4
35 additions, 4 deletions
src/meshTools/PatchFunction1/ConstantField/ConstantField.C
src/meshTools/PatchFunction1/PatchFunction1New.C
+6
-2
6 additions, 2 deletions
src/meshTools/PatchFunction1/PatchFunction1New.C
with
41 additions
and
6 deletions
src/meshTools/PatchFunction1/ConstantField/ConstantField.C
+
35
−
4
View file @
9461d950
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
========= |
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018
-2019
OpenCFD Ltd.
\\/ M anipulation |
\\/ M anipulation |
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
License
License
...
@@ -43,7 +43,22 @@ Foam::PatchFunction1Types::ConstantField<Type>::ConstantField
...
@@ -43,7 +43,22 @@ Foam::PatchFunction1Types::ConstantField<Type>::ConstantField
isUniform_
(
isUniform
),
isUniform_
(
isUniform
),
uniformValue_
(
uniformValue
),
uniformValue_
(
uniformValue
),
value_
(
nonUniformValue
)
value_
(
nonUniformValue
)
{}
{
if
(
faceValues
&&
nonUniformValue
.
size
()
!=
pp
.
size
())
{
FatalIOErrorInFunction
(
dict
)
<<
"Supplied field size "
<<
nonUniformValue
.
size
()
<<
" is not equal to the number of faces "
<<
pp
.
size
()
<<
" of patch "
<<
pp
.
name
()
<<
exit
(
FatalIOError
);
}
else
if
(
!
faceValues
&&
nonUniformValue
.
size
()
!=
pp
.
nPoints
())
{
FatalIOErrorInFunction
(
dict
)
<<
"Supplied field size "
<<
nonUniformValue
.
size
()
<<
" is not equal to the number of points "
<<
pp
.
nPoints
()
<<
" of patch "
<<
pp
.
name
()
<<
exit
(
FatalIOError
);
}
}
template
<
class
Type
>
template
<
class
Type
>
...
@@ -132,6 +147,7 @@ Foam::Field<Type> Foam::PatchFunction1Types::ConstantField<Type>::getValue
...
@@ -132,6 +147,7 @@ Foam::Field<Type> Foam::PatchFunction1Types::ConstantField<Type>::getValue
fld
=
uniformValue
;
fld
=
uniformValue
;
}
}
}
}
return
fld
;
return
fld
;
}
}
...
@@ -147,7 +163,17 @@ Foam::PatchFunction1Types::ConstantField<Type>::ConstantField
...
@@ -147,7 +163,17 @@ Foam::PatchFunction1Types::ConstantField<Type>::ConstantField
)
)
:
:
PatchFunction1
<
Type
>
(
pp
,
entryName
,
dict
,
faceValues
),
PatchFunction1
<
Type
>
(
pp
,
entryName
,
dict
,
faceValues
),
value_
(
getValue
(
entryName
,
dict
,
pp
.
size
(),
isUniform_
,
uniformValue_
))
value_
(
getValue
(
entryName
,
dict
,
(
faceValues
?
pp
.
size
()
:
pp
.
nPoints
()),
isUniform_
,
uniformValue_
)
)
{}
{}
...
@@ -177,7 +203,12 @@ Foam::PatchFunction1Types::ConstantField<Type>::ConstantField
...
@@ -177,7 +203,12 @@ Foam::PatchFunction1Types::ConstantField<Type>::ConstantField
value_
(
cnst
.
value_
)
value_
(
cnst
.
value_
)
{
{
// If different sizes do what?
// If different sizes do what?
value_
.
setSize
(
this
->
patch_
.
size
());
value_
.
setSize
(
this
->
faceValues_
?
this
->
patch_
.
size
()
:
this
->
patch_
.
nPoints
()
);
if
(
isUniform_
)
if
(
isUniform_
)
{
{
value_
=
uniformValue_
;
value_
=
uniformValue_
;
...
...
This diff is collapsed.
Click to expand it.
src/meshTools/PatchFunction1/PatchFunction1New.C
+
6
−
2
View file @
9461d950
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
========= |
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018
-2019
OpenCFD Ltd.
\\/ M anipulation |
\\/ M anipulation |
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
License
License
...
@@ -69,7 +69,11 @@ Foam::autoPtr<Foam::PatchFunction1<Type>> Foam::PatchFunction1<Type>::New
...
@@ -69,7 +69,11 @@ Foam::autoPtr<Foam::PatchFunction1<Type>> Foam::PatchFunction1<Type>::New
is
.
putBack
(
firstToken
);
is
.
putBack
(
firstToken
);
const
Type
uniformValue
=
pTraits
<
Type
>
(
is
);
const
Type
uniformValue
=
pTraits
<
Type
>
(
is
);
const
Field
<
Type
>
value
(
pp
.
size
(),
uniformValue
);
const
Field
<
Type
>
value
(
(
faceValues
?
pp
.
size
()
:
pp
.
nPoints
()),
uniformValue
);
return
autoPtr
<
PatchFunction1
<
Type
>>
return
autoPtr
<
PatchFunction1
<
Type
>>
(
(
...
...
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