Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Schruff
waLBerla
Commits
059bac46
Commit
059bac46
authored
Feb 16, 2018
by
Sebastian Eibl
Browse files
made minimum block weight changeable
parent
71eff542
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/pe/amr/weight_assignment/WeightAssignmentFunctor.cpp
deleted
100644 → 0
View file @
71eff542
//======================================================================================================================
//
// 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
// 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
// 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/>.
//
//! \file WeightAssignmentFunctor.cpp
//! \author Sebastian Eibl <sebastian.eibl@fau.de>
//
//======================================================================================================================
#include
"WeightAssignmentFunctor.h"
namespace
walberla
{
namespace
pe
{
namespace
amr
{
const
double
WeightAssignmentFunctor
::
baseWeight
=
real_t
(
10.0
);
}
}
}
src/pe/amr/weight_assignment/WeightAssignmentFunctor.h
View file @
059bac46
...
...
@@ -35,10 +35,7 @@ public:
typedef
walberla
::
blockforest
::
PODPhantomWeight
<
double
>
PhantomBlockWeight
;
typedef
walberla
::
blockforest
::
PODPhantomWeightPackUnpack
<
double
>
PhantomBlockWeightPackUnpackFunctor
;
///Base weight due to allocated data structures. A weight of zero for blocks is dangerous as empty blocks might accumulate on one process!
static
const
double
baseWeight
;
WeightAssignmentFunctor
(
shared_ptr
<
InfoCollection
>&
ic
)
:
ic_
(
ic
)
{}
WeightAssignmentFunctor
(
shared_ptr
<
InfoCollection
>&
ic
,
const
real_t
baseWeight
=
real_t
(
10.0
)
)
:
ic_
(
ic
),
baseWeight_
(
baseWeight
)
{}
void
operator
()(
std
::
vector
<
std
::
pair
<
const
PhantomBlock
*
,
boost
::
any
>
>
&
blockData
,
const
PhantomBlockForest
&
)
{
...
...
@@ -52,7 +49,7 @@ public:
{
auto
infoIt
=
ic_
->
find
(
block
->
getId
()
/*.getFatherId()*/
);
WALBERLA_ASSERT_UNEQUAL
(
infoIt
,
ic_
->
end
()
);
it
->
second
=
PhantomBlockWeight
(
double_c
(
infoIt
->
second
.
numberOfLocalBodies
)
+
baseWeight
);
it
->
second
=
PhantomBlockWeight
(
double_c
(
infoIt
->
second
.
numberOfLocalBodies
)
+
baseWeight
_
);
continue
;
}
...
...
@@ -60,7 +57,7 @@ public:
{
auto
infoIt
=
ic_
->
find
(
block
->
getId
()
);
WALBERLA_ASSERT_UNEQUAL
(
infoIt
,
ic_
->
end
()
);
it
->
second
=
PhantomBlockWeight
(
double_c
(
infoIt
->
second
.
numberOfLocalBodies
)
+
baseWeight
);
it
->
second
=
PhantomBlockWeight
(
double_c
(
infoIt
->
second
.
numberOfLocalBodies
)
+
baseWeight
_
);
continue
;
}
...
...
@@ -74,14 +71,20 @@ public:
WALBERLA_ASSERT_UNEQUAL
(
childIt
,
ic_
->
end
()
);
weight
+=
double_c
(
childIt
->
second
.
numberOfLocalBodies
);
}
it
->
second
=
PhantomBlockWeight
(
weight
+
baseWeight
);
it
->
second
=
PhantomBlockWeight
(
weight
+
baseWeight
_
);
continue
;
}
}
}
inline
void
setBaseWeight
(
const
real_t
weight
)
{
baseWeight_
=
weight
;}
inline
real_t
getBaseWeight
()
const
{
return
baseWeight_
;
}
private:
shared_ptr
<
InfoCollection
>
ic_
;
///Base weight due to allocated data structures. A weight of zero for blocks is dangerous as empty blocks might accumulate on one process!
double
baseWeight_
=
real_t
(
10.0
);
};
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment