Cholla 3.0.1-dev
Cholla - Massively parallel hydro on GPUs
Loading...
Searching...
No Matches
Public Member Functions | List of all members
cool_component::CloudyHeatAndCool Class Reference

A callable type that uses texture mapping to interpolate Cloudy cooling/heating. More...

#include <load_cloudy_texture.h>

Public Member Functions

__host__ CloudyHeatAndCool (std::string filename)
 Construct an instance from the appropriate file name.
 
__host__ CloudyHeatAndCool (ParameterMap &pmap)
 Construct an instance from the ParameterMap.
 
template<bool TABLE_ONLY>
__device__ __forceinline__ Real calc_contrib_ (Real n, Real T) const
 compute the net cooling contribution
 
__device__ Real operator() (Real n, Real T) const
 compute the net cooling/heating rate
 

Detailed Description

A callable type that uses texture mapping to interpolate Cloudy cooling/heating.

For more context, a "callable" object is sometimes called a "functor." Essentially a "callable" object carries around state and can be called like a function.

This is intended to be used as a cooling component that is used to construct a cooling recipe.

Note
The built-in tables shipped with Cholla were constructed at z = 0 with solar metallicity and an HM05 UV background.

Future Ideas

As of now, this class internally tracks both a cooling table AND a heating table. If we want to support the use of just a single table:

Constructor & Destructor Documentation

◆ CloudyHeatAndCool()

__host__ cool_component::CloudyHeatAndCool::CloudyHeatAndCool ( std::string  filename)
explicit

Construct an instance from the appropriate file name.

When passed an empty string, it tries to guess the location of the standard data file.

Note
This constructor is useful for testing

Member Function Documentation

◆ calc_contrib_()

template<bool TABLE_ONLY>
__device__ __forceinline__ Real cool_component::CloudyHeatAndCool::calc_contrib_ ( Real  n,
Real  T 
) const
inline

compute the net cooling contribution

Todo:
Stop hardcoding properties of the interpolation grid

This primarily exists for testing purposes.

Note
Although I haven't explicitly checked that forceinline is necessary there isn't any harm since normal operation of Cholla always calls this method through the operator()(args) method (the only other time this is invoked is in our tests) is only directly invoked in the tests)

◆ operator()()

compute the net cooling/heating rate

The docstring of the cool_component namespace provides further context about how this method is used and describes some relevant optimization considerations

Todo:
Stop hardcoding properties of the interpolation grid
Note
In case you are unaware, this overloads the "function call operator". If we have an instance, obj, then you call this method by invoking obj(n, T). In python, this method would be called __call__

The documentation for this class was generated from the following files: