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
ef042b2b
Commit
ef042b2b
authored
7 months ago
by
Darwin
Browse files
Options
Downloads
Patches
Plain Diff
Add adaptive softening struct to gpart
parent
b513d5a6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/adaptive_softening_struct.h
+48
-0
48 additions, 0 deletions
src/adaptive_softening_struct.h
src/gravity/MultiSoftening/gravity_part.h
+4
-0
4 additions, 0 deletions
src/gravity/MultiSoftening/gravity_part.h
with
52 additions
and
0 deletions
src/adaptive_softening_struct.h
+
48
−
0
View file @
ef042b2b
...
...
@@ -33,6 +33,49 @@ struct adaptive_softening_part_data {
float
zeta
;
};
/**
* @brief Gravity particle-carried fields for the adaptive softening scheme.
*/
/* 1) Compute zeta and omega during the tree walk with the tidal tensor of the
previous timestep. We can drift them to et an estimate of the current
timestep, but we'll do this later. At the same time, compute the new tidal
tensor. (store the old value in another variable.
---> create a new adaptive_softening_add_correction_term() fct and call it
in runner_iact_grav_pp_full() and _truncated().
To finish the computations, we might need to add a task.
2) Compute the Gamma_ab terms during the force interaction, i.e. when we
compute the acceleration. Compute d_epsilon_dt. Pay attention to the
interaction with gas particles -> not the same softening rule.
--> create a new adaptive_softening_get_acc_term() and call it in
3) Update the softening with the new tidal tensor. We can do this probably in
grav_end_force or in kick2() ? See where the gas updates its value.
Notes:
We only need to compute zeta and omega over all particles in the softening
kernel. Outside the softening kernel (r>H), the d Phi/d_epsilon = 0.
When computing the tidal tensor, use do not use the same Phi. See Hopkins
paper.
At the end, add a minimal softening and maximal softening.
*/
struct
adaptive_softening_gpart_data
{
/*! Correction term for energy conservation eq 15 in Hopkins 2023.*/
float
zeta
;
/*! Correction term for energy conservation (second term) eq 35 */
float
omega
;
/*! Time derivative of the softening eq 37 */
float
depsilon_dt
;
};
#else
/**
...
...
@@ -40,6 +83,11 @@ struct adaptive_softening_part_data {
*/
struct
adaptive_softening_part_data
{};
/**
* @brief Gravity particle-carried fields for the adaptive softening scheme.
*/
struct
adaptive_softening_gpart_data
{};
#endif
#endif
/* SWIFT_ADAPTIVE_SOFTENING_STRUCT_H */
This diff is collapsed.
Click to expand it.
src/gravity/MultiSoftening/gravity_part.h
+
4
−
0
View file @
ef042b2b
...
...
@@ -19,6 +19,7 @@
#ifndef SWIFT_MULTI_SOFTENING_GRAVITY_PART_H
#define SWIFT_MULTI_SOFTENING_GRAVITY_PART_H
#include
"adaptive_softening_struct.h"
#include
"csds.h"
#include
"fof_struct.h"
...
...
@@ -69,6 +70,9 @@ struct gpart {
/*! Type of the #gpart (DM, gas, star, ...) */
enum
part_type
type
;
/*! Additional data used for adaptive softening */
struct
adaptive_softening_gpart_data
adaptive_softening_data
;
#ifdef WITH_CSDS
/* Additional data for the particle csds */
struct
csds_part_data
csds_data
;
...
...
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