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
Sbalzarini Lab
S
Software
P
Parallel Computing
OpenFPM
openfpm_numerics
Commits
de377110
Commit
de377110
authored
Dec 02, 2021
by
jstark
Browse files
Deleted redundant FD_order1 because already contained in FD_simple.
parent
b12fc283
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/FiniteDifference/FD_order1.hpp
deleted
100644 → 0
View file @
b12fc283
//
// Created by jstark on 17.05.21.
//
#ifndef OPENFPM_NUMERICS_SRC_FINITEDIFFERENCE_FD_ORDER1_HPP
#define OPENFPM_NUMERICS_SRC_FINITEDIFFERENCE_FD_ORDER1_HPP
// Include OpenFPM header files
#include "Grid/grid_dist_id.hpp"
/**@brief Computes the forward finite difference of a scalar property on the current grid node.
*
* @tparam Field Size_t index of property for which the gradient should be computed.
* @tparam gridtype Type of input grid.
* @tparam keytype Type of key variable.
* @param grid Grid, on which the gradient should be computed.
* @param key Key that contains the index of the current grid node.
* @param d Variable (size_t) that contains the dimension.
* @return Forward finite difference for the property under index Field on the current node with index key.
*/
template
<
size_t
Field
,
typename
gridtype
,
typename
keytype
>
double
FD_forward
(
gridtype
&
grid
,
keytype
&
key
,
size_t
d
)
{
return
(
grid
.
template
get
<
Field
>
(
key
.
move
(
d
,
1
))
-
grid
.
template
get
<
Field
>
(
key
))
/
grid
.
getSpacing
()[
d
];
}
/**@brief Computes the backward finite difference of a scalar property on the current grid node.
*
* @tparam Field Size_t index of property for which the gradient should be computed.
* @tparam gridtype Type of input grid.
* @tparam keytype Type of key variable.
* @param grid Grid, on which the gradient should be computed.
* @param key Key that contains the index of the current grid node.
* @param d Variable (size_t) that contains the dimension.
* @return Backward finite difference for the property under index Field on the current node with index key.
*/
template
<
size_t
Field
,
typename
gridtype
,
typename
keytype
>
double
FD_backward
(
gridtype
&
grid
,
keytype
&
key
,
size_t
d
)
{
return
(
grid
.
template
get
<
Field
>
(
key
)
-
grid
.
template
get
<
Field
>
(
key
.
move
(
d
,
-
1
)))
/
grid
.
getSpacing
()[
d
];
}
#endif //OPENFPM_NUMERICS_SRC_FINITEDIFFERENCE_FD_ORDER1_HPP
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