Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
SWIFT
SWIFTsim
Commits
3e4330d3
Commit
3e4330d3
authored
6 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Added function to compute a value to the power of inverse dimenstion effectively.
parent
8e4d5e73
No related branches found
No related tags found
1 merge request
!714
New ghost iteration scheme
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/dimension.h
+28
-0
28 additions, 0 deletions
src/dimension.h
with
28 additions
and
0 deletions
src/dimension.h
+
28
−
0
View file @
3e4330d3
...
...
@@ -89,6 +89,34 @@ __attribute__((always_inline)) INLINE static float pow_dimension(float x) {
#endif
}
/**
* @brief Returns the argument to the power given by the inverse of the
* dimension
*
* Computes \f$x^{1/d}\f$.
*/
__attribute__
((
always_inline
))
INLINE
static
float
pow_inv_dimension
(
float
x
)
{
#if defined(HYDRO_DIMENSION_3D)
return
cbrtf
(
x
);
#elif defined(HYDRO_DIMENSION_2D)
return
sqrtf
(
x
);
#elif defined(HYDRO_DIMENSION_1D)
return
x
;
#else
error
(
"The dimension is not defined !"
);
return
0
.
f
;
#endif
}
/**
* @brief Returns the argument to the power given by the dimension plus one
*
...
...
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