Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
waLBerla
waLBerla
Commits
8e3ea121
Commit
8e3ea121
authored
Jun 23, 2021
by
Markus Holzer
Browse files
Merge branch 'diffusion-dirichlet' into 'master'
Fix SimpleDiffusionDirichlet Closes
#149
See merge request
!466
parents
6b0e8cab
60289a94
Pipeline
#32862
passed with stages
in 684 minutes and 33 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/lbm/boundary/SimpleDiffusionDirichlet.h
View file @
8e3ea121
//======================================================================================================================
//
// This file is part of waLBerla. waLBerla is free software: you can
// This file is part of waLBerla. waLBerla is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// waLBerla is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
//
// waLBerla is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
//
// You should have received a copy of the GNU General Public License along
// with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
//
...
...
@@ -108,9 +108,9 @@ private:
template
<
typename
LatticeModel_T
,
typename
flag_t
>
inline
SimpleDiffusionDirichlet
<
LatticeModel_T
,
flag_t
>::
SimpleDiffusionDirichlet
(
const
BoundaryUID
&
boundaryUID
,
const
FlagUID
&
uid
,
PDFField
*
const
pdfField
,
const
real_t
val
)
:
Boundary
<
flag_t
>
(
boundaryUID
),
uid_
(
uid
),
pdfField_
(
pdfField
),
val_
(
val
),
init_
(
false
)
Boundary
<
flag_t
>
(
boundaryUID
),
uid_
(
uid
),
pdfField_
(
pdfField
),
val_
(
val
),
init_
(
false
)
{
WALBERLA_ASSERT_NOT_NULLPTR
(
pdfField_
);
WALBERLA_ASSERT_NOT_NULLPTR
(
pdfField_
);
}
...
...
@@ -139,17 +139,8 @@ inline void SimpleDiffusionDirichlet< LatticeModel_T, flag_t >::registerCell( Bu
template
<
typename
LatticeModel_T
,
typename
flag_t
>
inline
void
SimpleDiffusionDirichlet
<
LatticeModel_T
,
flag_t
>::
registerCell
(
const
flag_t
,
const
cell_idx_t
,
const
cell_idx_t
,
const
cell_idx_t
,
const
BoundaryConfiguration
&
bc
)
const
BoundaryConfiguration
&
)
{
WALBERLA_ASSERT_EQUAL
(
dynamic_cast
<
const
ScalarConfiguration
*
>
(
&
bc
),
&
bc
);
const
ScalarConfiguration
&
sclConfig
=
dynamic_cast
<
const
ScalarConfiguration
&
>
(
bc
);
if
(
init_
)
WALBERLA_ASSERT_FLOAT_EQUAL
(
val_
,
sclConfig
.
val
()
);
init_
=
true
;
val_
=
sclConfig
.
val
();
}
...
...
@@ -183,7 +174,7 @@ inline void SimpleDiffusionDirichlet< LatticeModel_T, flag_t >::treatDirection(
WALBERLA_ASSERT_EQUAL
(
ny
,
y
+
cell_idx_c
(
stencil
::
cy
[
dir
]
)
);
WALBERLA_ASSERT_EQUAL
(
nz
,
z
+
cell_idx_c
(
stencil
::
cz
[
dir
]
)
);
WALBERLA_ASSERT_UNEQUAL
(
mask
&
this
->
mask_
,
numeric_cast
<
flag_t
>
(
0
)
);
WALBERLA_ASSERT_EQUAL
(
mask
&
this
->
mask_
,
this
->
mask_
);
WALBERLA_ASSERT_EQUAL
(
mask
&
this
->
mask_
,
this
->
mask_
);
// only true if "this->mask_" only contains one single flag, which is the case for the current implementation of this boundary condition (SimpleDiffusionDirichlet)
pdfField_
->
get
(
nx
,
ny
,
nz
,
Stencil
::
invDirIdx
(
dir
)
)
=
real_t
(
2
)
*
val_
*
LatticeModel_T
::
w
[
Stencil
::
idx
[
dir
]]
-
pdfField_
->
get
(
x
,
y
,
z
,
Stencil
::
idx
[
dir
]
);
...
...
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