consumers_meanfield.cpp serif/eos/models/concepts.hpp serif/eos/models/polytropic.hpp serif::compile_time_checks::eos_meanfield::consumer_contracts::SingleRelationEOS serif serif::compile_time_checks serif::compile_time_checks::eos_meanfield serif::compile_time_checks::eos_meanfield::consumer_contracts #include"serif/eos/models/concepts.hpp" #include"serif/eos/models/polytropic.hpp" namespaceserif::compile_time_checks::eos_meanfield::consumer_contracts { template<typenameOutput,typenameInput,boolHasDerivative> structSingleRelationEOS { usingRelation=eos::relations::Relation<Output, Input>; usingRelations=eos::relations::RelationCatalog<Relation>; [[nodiscard]]constexprdimensions::QuantityValue<Output>evaluate(Relation,dimensions::QuantityValue<Input>value)const { returndimensions::QuantityValue<Output>{value.value()}; } [[nodiscard]]constexprdimensions::PartialDerivative<Output, Input>partial_derivative(Relation,dimensions::WithRespectTo<Input>,dimensions::QuantityValue<Input>)constrequiresHasDerivative { returndimensions::PartialDerivative<Output, Input>{1.0}; } }; usingDensityClosure=SingleRelationEOS<dimensions::MassDensity, dimensions::SpecificEnthalpy, true>; usingDensityWithoutDerivative=SingleRelationEOS<dimensions::MassDensity, dimensions::SpecificEnthalpy, false>; usingEnthalpyPressure=SingleRelationEOS<dimensions::Pressure, dimensions::SpecificEnthalpy, true>; usingDensitySeed=SingleRelationEOS<dimensions::SpecificEnthalpy, dimensions::MassDensity, false>; usingGeneralEOS=SingleRelationEOS<dimensions::SpecificEnthalpy, dimensions::Pressure, false>; usingDensityFromEnthalpy=eos::relations::DensityFromSpecificEnthalpy; static_assert(eos::models::EOSSupportingPartialDerivative<DensityClosure, DensityFromEnthalpy, dimensions::SpecificEnthalpy>); static_assert(eos::models::EOSModel<DensityWithoutDerivative>&&eos::models::EOSSupportingRelation<DensityWithoutDerivative, DensityFromEnthalpy>&& !eos::models::EOSSupportingPartialDerivative<DensityWithoutDerivative, DensityFromEnthalpy, dimensions::SpecificEnthalpy>); static_assert(!eos::models::EOSSupportingRelation<EnthalpyPressure, DensityFromEnthalpy>); static_assert(eos::models::StructureSeedEOS<eos::models::Polytrope>&&eos::models::StructureSeedEOS<DensitySeed>); static_assert(!eos::models::StructureSeedEOS<DensityClosure>); static_assert(eos::models::EOSModel<GeneralEOS>); static_assert(!eos::models::StructureSeedEOS<GeneralEOS>&&!eos::models::EOSSupportingRelation<GeneralEOS, DensityFromEnthalpy>); }//namespaceserif::compile_time_checks::eos_meanfield::consumer_contracts