feat(libmeanfield): variadic refactor
also added normaliztion operator
This commit is contained in:
43
extension_example/demo.cpp
Normal file
43
extension_example/demo.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
|
||||
import mean_field;
|
||||
import mean_field_extension_example.rotating_stellar_model;
|
||||
|
||||
int main() {
|
||||
using namespace mean_field;
|
||||
using namespace mean_field::extension_example;
|
||||
|
||||
const IdealGasRadiation equationOfState({
|
||||
.meanMolecularWeight = 0.61,
|
||||
.boltzmannConstant = 1.380649e-16,
|
||||
.atomicMassUnit = 1.66053906660e-24,
|
||||
.radiationConstant = 7.5657e-15
|
||||
});
|
||||
|
||||
const dimensions::DensityValue density{10.0}; // g cm^-3
|
||||
const dimensions::TemperatureValue temperature{1.5e7}; // K
|
||||
const auto pressure = eos::evaluate<dimensions::quantity::Pressure>(
|
||||
equationOfState,
|
||||
density,
|
||||
temperature
|
||||
);
|
||||
|
||||
const auto model = makeRotatingStellarModel({
|
||||
.equationOfState = equationOfState.parameters(),
|
||||
.surfacePressure = dimensions::PressureValue{0.0},
|
||||
.totalMass = dimensions::MassValue{1.0},
|
||||
.totalAngularMomentum = dimensions::AngularMomentumValue{0.2}
|
||||
});
|
||||
|
||||
std::cout << std::scientific
|
||||
<< "P(rho = 10 g cm^-3, T = 1.5e7 K) = "
|
||||
<< pressure.value() << " dyn cm^-2\n"
|
||||
<< "Compiled specification count = "
|
||||
<< model.specificationCount << '\n'
|
||||
<< "Current barotropic backend accepts this thermal model = "
|
||||
<< std::boolalpha
|
||||
<< currentEquilibriumBackendSupportsIdealGasRadiation << '\n';
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user