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
04a985cc
Commit
04a985cc
authored
Oct 30, 2018
by
mattijs
Browse files
ENH: ConstantField: allow nonuniform. See
#1046
.
parent
6f2376a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/meshTools/PatchFunction1/ConstantField/ConstantField.C
View file @
04a985cc
...
...
@@ -70,11 +70,44 @@ Foam::Field<Type> Foam::PatchFunction1Types::ConstantField<Type>::getValue
fld
.
setSize
(
len
);
fld
=
pTraits
<
Type
>
(
is
);
}
else
if
(
firstToken
.
wordToken
()
==
"nonuniform"
)
{
List
<
Type
>&
list
=
fld
;
is
>>
list
;
label
currentSize
=
fld
.
size
();
if
(
currentSize
!=
len
)
{
if
(
len
<
currentSize
&&
FieldBase
::
allowConstructFromLargerSize
)
{
#ifdef FULLDEBUG
IOWarningInFunction
(
dict
)
<<
"Sizes do not match. "
<<
"Re-sizing "
<<
currentSize
<<
" entries to "
<<
len
<<
endl
;
#endif
// Resize the data
fld
.
setSize
(
len
);
}
else
{
FatalIOErrorInFunction
(
dict
)
<<
"size "
<<
fld
.
size
()
<<
" is not equal to the given value of "
<<
len
<<
exit
(
FatalIOError
);
}
}
}
else
{
FatalIOErrorInFunction
(
dict
)
<<
"expected keyword 'uniform' or 'constant'
, found
"
<<
firstToken
.
wordToken
()
<<
"expected keyword 'uniform'
, 'nonuniform'
or 'constant'"
<<
", found "
<<
firstToken
.
wordToken
()
<<
exit
(
FatalIOError
);
}
}
...
...
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