Skip to content
Snippets Groups Projects
Commit f6573674 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Added a constant to represent the allowed delta between the desired (weighted)...

Added a constant to represent the allowed delta between the desired (weighted) number of neighbours and the computed one. Was set to 1 in the code until now.


Former-commit-id: d038be315b4691e6e455844a774622836b55e34e
parent 9b5eefa6
No related branches found
No related tags found
No related merge requests found
/******************************************************************************* /*******************************************************************************
* This file is part of SWIFT. * This file is part of SWIFT.
* Coypright (c) 2012 Pedro Gonnet (pedro.gonnet@durham.ac.uk) * Coypright (c) 2012 Pedro Gonnet (pedro.gonnet@durham.ac.uk)
* Matthieu Schaller (matthieu.schaller@durham.ac.uk)
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published * it under the terms of the GNU Lesser General Public License as published
...@@ -18,7 +19,13 @@ ...@@ -18,7 +19,13 @@
******************************************************************************/ ******************************************************************************/
/* Physical constants. */ /* Hydrodynamical constants. */
#define const_gamma (5.0f/3.0f) #define const_gamma (5.0f/3.0f)
#define const_viscosity_alpha 0.8
/* Time integration constants. */
#define const_cfl 0.25f #define const_cfl 0.25f
#define const_nwneigh 48
/* Neighbour search constants. */
#define const_nwneigh 48.f
#define const_delta_nwneigh 1.f
...@@ -382,8 +382,8 @@ void runner_doghost ( struct runner *r , struct cell *c ) { ...@@ -382,8 +382,8 @@ void runner_doghost ( struct runner *r , struct cell *c ) {
cp->h = p->h; cp->h = p->h;
/* Did we get the right number density? */ /* Did we get the right number density? */
if ( p->wcount > const_nwneigh + 1 || if ( p->wcount > const_nwneigh + const_delta_nwneigh ||
p->wcount < const_nwneigh - 1 ) { p->wcount < const_nwneigh - const_delta_nwneigh ) {
// printf( "runner_doghost: particle %lli (h=%e,h_dt=%e,depth=%i) has bad wcount=%.3f.\n" , p->id , p->h , p->h_dt , c->depth , p->wcount ); fflush(stdout); // printf( "runner_doghost: particle %lli (h=%e,h_dt=%e,depth=%i) has bad wcount=%.3f.\n" , p->id , p->h , p->h_dt , c->depth , p->wcount ); fflush(stdout);
// p->h += ( p->wcount + kernel_root - const_nwneigh ) / p->wcount_dh; // p->h += ( p->wcount + kernel_root - const_nwneigh ) / p->wcount_dh;
pid[redo] = pid[i]; pid[redo] = pid[i];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment