Skip to content

File kernelstypes.h

File List > code_source > cosmolattice > include > CosmoInterface > evolvers > kernels > kernelstypes.h

Go to the documentation of this file

#ifndef COSMOINTERFACE_EVOLVERS_KERNELS_KERNELSTYPES_H
#define COSMOINTERFACE_EVOLVERS_KERNELS_KERNELSTYPES_H
/* This file is part of CosmoLattice, available at www.cosmolattice.net .
   Copyright Daniel G. Figueroa, Adrien Florio, Francisco Torrenti and Wessel Valkenburg.
   Released under the MIT license, see LICENSE.md. */

// File info: Main contributor(s): Adrien Florio  Year: 2024

#include "CosmoInterface/definitions/gausslaws.h"
#include "TempLat/lattice/algebra/su2algebra/su2algebra.h"
#include "TempLat/lattice/field/collections/vectorfieldcollection.h"

namespace TempLat::KernelsTypes
{
  template <typename Model> class EoM
  {
    using T = typename Model::FloatType;

  public:
    T tMinust0 = T{};

    void cache(Model &model, T tIn) { tMinust0 = tIn; }

  private:
    void cache(Model &model) {}
  };

  template <typename Model> class Diffusion
  {
    using T = typename Model::FloatType;

  public:
    T tMinust0 = T{};

    void cache(Model &model, T tIn) { tMinust0 = tIn; }

  private:
    void cache(Model &model) {}
  };

  template <class Model> auto getDt(Model &model, EoM<Model> &kt) { return model.dt; }
  template <class Model> auto setDt(Model &model, EoM<Model> &kt, typename Model::FloatType dt) { model.dt = dt; }

  template <class Model> auto getDt(Model &model, Diffusion<Model> &kt) { return model.dt; }
  template <class Model> auto setDt(Model &model, Diffusion<Model> &kt, typename Model::FloatType dt) { model.dt = dt; }
} // namespace TempLat::KernelsTypes

#endif