Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
openfpm_numerics
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Sbalzarini Lab
Software
Parallel Computing
OpenFPM
openfpm_numerics
Commits
0f5865ce
Commit
0f5865ce
authored
3 years ago
by
jstark
Browse files
Options
Downloads
Patches
Plain Diff
Deducing type from property.
parent
dbdc3660
No related branches found
Branches containing commit
No related tags found
1 merge request
!15
FD_solver to develop Upstream
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/level_set/redistancing_Sussman/HelpFunctionsForGrid.hpp
+12
-9
12 additions, 9 deletions
src/level_set/redistancing_Sussman/HelpFunctionsForGrid.hpp
with
12 additions
and
9 deletions
src/level_set/redistancing_Sussman/HelpFunctionsForGrid.hpp
+
12
−
9
View file @
0f5865ce
...
...
@@ -188,11 +188,12 @@ typename grid_type::stype get_smallest_spacing(grid_type & grid)
* @return Double variable that contains the sum over all grid nodes of the difference between the value stored at \p
* Prop1 and the value stored at \p Prop2.
*/
template
<
size_t
Prop1
,
size_t
Prop2
,
typename
prop_type
,
typename
grid_type
>
prop_type
average_difference
(
grid_type
&
grid
)
template
<
size_t
Prop1
,
size_t
Prop2
,
typename
grid_type
>
auto
average_difference
(
grid_type
&
grid
)
{
prop_type
total_diff
=
0
;
auto
dom
=
grid
.
getDomainIterator
();
typedef
typename
std
::
decay_t
<
decltype
(
grid
.
template
get
<
Prop1
>(
dom
.
get
()))
>
prop_type
;
prop_type
total_diff
=
0
;
while
(
dom
.
isNext
())
{
auto
key
=
dom
.
get
();
...
...
@@ -209,11 +210,12 @@ prop_type average_difference(grid_type & grid)
* @param grid Input OpenFPM grid.
* @return Double variable that contains the maximum value of property \p Prop in \p grid.
*/
template
<
size_t
Prop
,
typename
prop_type
,
typename
grid_type
>
prop_type
get_max_val
(
grid_type
&
grid
)
template
<
size_t
Prop
,
typename
grid_type
>
auto
get_max_val
(
grid_type
&
grid
)
{
prop_type
max_value
=
std
::
numeric_limits
<
prop_type
>::
lowest
();
auto
dom
=
grid
.
getDomainIterator
();
typedef
typename
std
::
decay_t
<
decltype
(
grid
.
template
get
<
Prop
>(
dom
.
get
()))
>
prop_type
;
prop_type
max_value
=
std
::
numeric_limits
<
prop_type
>::
lowest
();
while
(
dom
.
isNext
())
{
auto
key
=
dom
.
get
();
...
...
@@ -233,11 +235,12 @@ prop_type get_max_val(grid_type & grid)
* @param grid Input OpenFPM grid.
* @return Double variable that contains the minimum value of property \p Prop in \p grid.
*/
template
<
size_t
Prop
,
typename
prop_type
,
typename
grid_type
>
prop_type
get_min_val
(
grid_type
&
grid
)
template
<
size_t
Prop
,
typename
grid_type
>
auto
get_min_val
(
grid_type
&
grid
)
{
prop_type
min_value
=
std
::
numeric_limits
<
prop_type
>::
max
();
auto
dom
=
grid
.
getDomainIterator
();
typedef
typename
std
::
decay_t
<
decltype
(
grid
.
template
get
<
Prop
>(
dom
.
get
()))
>
prop_type
;
prop_type
min_value
=
std
::
numeric_limits
<
prop_type
>::
max
();
while
(
dom
.
isNext
())
{
auto
key
=
dom
.
get
();
...
...
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