Shamrock
2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
shammodels
sph
include
shammodels
sph
modules
ComputeEos.hpp
Go to the documentation of this file.
1
// -------------------------------------------------------//
2
//
3
// SHAMROCK code for hydrodynamics
4
// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5
// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6
// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7
//
8
// -------------------------------------------------------//
9
10
#pragma once
11
19
20
#include "
shambackends/typeAliasVec.hpp
"
21
#include "
shambackends/vec.hpp
"
22
#include "
shammodels/sph/SolverConfig.hpp
"
23
#include "
shammodels/sph/modules/SolverStorage.hpp
"
24
#include "
shamrock/scheduler/ShamrockCtx.hpp
"
25
#include "
shamsolvergraph/edge/IDataEdge.hpp
"
26
27
namespace
shammodels::sph::modules
{
28
34
template
<
class
Tvec,
template
<
class
>
class
SPHKernel>
35
class
ComputeEos {
36
public
:
37
using
Tscal = shambase::VecComponent<Tvec>;
38
static
constexpr
u32
dim = shambase::VectorProperties<Tvec>::dimension;
39
using
Kernel = SPHKernel<Tscal>;
40
41
using
Config =
SolverConfig<Tvec, SPHKernel>
;
42
using
Storage =
SolverStorage<Tvec, u32>
;
43
44
ShamrockCtx
&context;
45
Config &solver_config;
46
Storage &storage;
47
48
ComputeEos(
ShamrockCtx
&context, Config &solver_config, Storage &storage)
49
: context(context), solver_config(solver_config), storage(storage) {}
50
52
void
compute_eos
();
53
54
private
:
55
void
compute_eos_internal(
56
const
shamrock::solvergraph::IDataEdge<Tscal>
&hfactd,
57
const
shamrock::solvergraph::IDataEdge<Tscal>
&pmass,
58
const
std::optional<
59
std::reference_wrapper<
const
shamrock::solvergraph::IFieldSpan<Tscal>
>> spans_rho,
60
const
std::optional<
61
std::reference_wrapper<
const
shamrock::solvergraph::IFieldSpan<Tscal>
>> spans_h,
62
const
std::optional<
63
std::reference_wrapper<
const
shamrock::solvergraph::IFieldSpan<Tscal>
>> spans_uint,
64
const
shamrock::solvergraph::Indexes<u32>
&sizes,
65
shamrock::solvergraph::IFieldSpan<Tscal>
&spans_pressure,
66
shamrock::solvergraph::IFieldSpan<Tscal>
&spans_soundspeed);
67
68
inline
PatchScheduler
&scheduler() {
return
shambase::get_check_ref
(context.sched); }
69
};
70
71
}
// namespace shammodels::sph::modules
IDataEdge.hpp
ShamrockCtx.hpp
u32
std::uint32_t u32
32 bit unsigned integer
Definition
aliases_int.hpp:27
PatchScheduler
The MPI scheduler.
Definition
PatchScheduler.hpp:86
ShamrockCtx
Definition
ShamrockCtx.hpp:42
shammodels::sph::SolverStorage
Definition
SolverStorage.hpp:47
shammodels::sph::modules::ComputeEos::compute_eos
void compute_eos()
Computes pressure and sound speed from equation of state.
Definition
ComputeEos.cpp:720
shamrock::solvergraph::IDataEdge
Definition
IDataEdge.hpp:27
shamrock::solvergraph::IFieldSpan
Interface for a solver graph edge representing a field as spans.
Definition
IFieldSpan.hpp:37
shamrock::solvergraph::Indexes
Definition
Indexes.hpp:26
shambase::get_check_ref
T & get_check_ref(const std::unique_ptr< T > &ptr, SourceLocation loc=SourceLocation())
Takes a std::unique_ptr and returns a reference to the object it holds. It throws a std::runtime_erro...
Definition
memory.hpp:110
shammodels::sph::modules
namespace for the sph model modules
Definition
AnalysisAngularMomentum.hpp:28
SolverConfig.hpp
SolverStorage.hpp
shammodels::sph::SolverConfig
The configuration for a sph solver.
Definition
SolverConfig.hpp:434
typeAliasVec.hpp
vec.hpp
Generated on
for Shamrock by
1.15.0