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
f94cf453
Commit
f94cf453
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Added a 'none' cooling function that just contains the minimally required infrastructure.
parent
f769a31b
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!247
Radiated energy
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/const.h
+2
-1
2 additions, 1 deletion
src/const.h
src/cooling.h
+3
-1
3 additions, 1 deletion
src/cooling.h
src/cooling/const_du/cooling.h
+2
-2
2 additions, 2 deletions
src/cooling/const_du/cooling.h
src/cooling/none/cooling.h
+103
-0
103 additions, 0 deletions
src/cooling/none/cooling.h
with
110 additions
and
4 deletions
src/const.h
+
2
−
1
View file @
f94cf453
...
...
@@ -95,8 +95,9 @@
//#define EXTERNAL_POTENTIAL_DISK_PATCH
/* Cooling properties */
#define COOLING_NONE
//#define COOLING_CONST_DU
#define COOLING_CONST_LAMBDA
//
#define COOLING_CONST_LAMBDA
//#define COOLING_GRACKLE
/* Are we debugging ? */
...
...
This diff is collapsed.
Click to expand it.
src/cooling.h
+
3
−
1
View file @
f94cf453
...
...
@@ -31,7 +31,9 @@
#include
"const.h"
/* Import the right cooling definition */
#if defined(COOLING_CONST_DU)
#if defined(COOLING_NONE)
#include
"./cooling/none/cooling.h"
#elif defined(COOLING_CONST_DU)
#include
"./cooling/const_du/cooling.h"
#elif defined(COOLING_CONST_LAMBDA)
#include
"./cooling/const_lambda/cooling.h"
...
...
This diff is collapsed.
Click to expand it.
src/cooling/const_du/cooling.h
+
2
−
2
View file @
f94cf453
...
...
@@ -106,7 +106,7 @@ __attribute__((always_inline)) INLINE static void cooling_cool_part(
* @param us The internal system of units.
* @param p Pointer to the particle data.
*/
__attribute__
((
always_inline
))
INLINE
static
double
cooling_timestep
(
__attribute__
((
always_inline
))
INLINE
static
float
cooling_timestep
(
const
struct
cooling_data
*
restrict
cooling
,
const
struct
phys_const
*
restrict
phys_const
,
const
struct
UnitSystem
*
restrict
us
,
const
struct
part
*
restrict
p
)
{
...
...
@@ -143,7 +143,7 @@ static INLINE void cooling_init_backend(
*/
static
INLINE
void
cooling_print_backend
(
const
struct
cooling_data
*
cooling
)
{
message
(
"Cooling function is 'Constant cooling' with rate %f and floor %f"
,
message
(
"Cooling function is 'Constant cooling' with rate %f and floor %f
.
"
,
cooling
->
cooling_rate
,
cooling
->
min_energy
);
}
...
...
This diff is collapsed.
Click to expand it.
src/cooling/none/cooling.h
0 → 100644
+
103
−
0
View file @
f94cf453
/*******************************************************************************
* This file is part of SWIFT.
* Copyright (c) 2016 Matthieu Schaller (matthieu.schaller@durham.ac.uk)
*
* 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
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#ifndef SWIFT_COOLING_NONE_H
#define SWIFT_COOLING_NONE_H
/**
* @file src/cooling/none/cooling.h
* @brief Empty infrastructure for the cases without cooling function
*/
/* Some standard headers. */
#include
<float.h>
#include
<math.h>
/* Local includes. */
#include
"error.h"
#include
"hydro.h"
#include
"parser.h"
#include
"part.h"
#include
"physical_constants.h"
#include
"units.h"
/**
* @brief Properties of the cooling function.
*/
struct
cooling_data
{};
/**
* @brief Apply the cooling function to a particle.
*
* We do nothing.
*
* @param phys_const The physical constants in internal units.
* @param us The internal system of units.
* @param cooling The #cooling_data used in the run.
* @param p Pointer to the particle data.
* @param dt The time-step of this particle.
*/
__attribute__
((
always_inline
))
INLINE
static
void
cooling_cool_part
(
const
struct
phys_const
*
restrict
phys_const
,
const
struct
UnitSystem
*
restrict
us
,
const
struct
cooling_data
*
restrict
cooling
,
struct
part
*
restrict
p
,
float
dt
)
{}
/**
* @brief Computes the cooling time-step.
*
* We return FLT_MAX so as to impose no limit on the time-step.
*
* @param cooling The #cooling_data used in the run.
* @param phys_const The physical constants in internal units.
* @param us The internal system of units.
* @param p Pointer to the particle data.
*/
__attribute__
((
always_inline
))
INLINE
static
float
cooling_timestep
(
const
struct
cooling_data
*
restrict
cooling
,
const
struct
phys_const
*
restrict
phys_const
,
const
struct
UnitSystem
*
restrict
us
,
const
struct
part
*
restrict
p
)
{
return
FLT_MAX
;
}
/**
* @brief Initialises the cooling properties.
*
* Nothing to do here.
*
* @param parameter_file The parsed parameter file.
* @param us The current internal system of units.
* @param phys_const The physical constants in internal units.
* @param cooling The cooling properties to initialize
*/
static
INLINE
void
cooling_init_backend
(
const
struct
swift_params
*
parameter_file
,
const
struct
UnitSystem
*
us
,
const
struct
phys_const
*
phys_const
,
struct
cooling_data
*
cooling
)
{}
/**
* @brief Prints the properties of the cooling model to stdout.
*
* @param cooling The properties of the cooling function.
*/
static
INLINE
void
cooling_print_backend
(
const
struct
cooling_data
*
cooling
)
{
message
(
"Cooling function is 'No cooling'."
);
}
#endif
/* SWIFT_COOLING_NONE_H */
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