continuation.cpp memory serif/solver/continuation/polytropic.hpp serif/solver/continuation/identified_equations.hpp serif/solver/continuation/options.hpp #include<memory> #include"serif/solver/continuation/polytropic.hpp" #include"serif/solver/continuation/identified_equations.hpp" #include"serif/solver/continuation/options.hpp" namespace{ namespacefamily=serif::solver::continuation; usingIndex=family::PolytropicIndex; usingConstant=family::PolytropicConstant; usingMomentum=family::AngularMomentum; usingDefinition=decltype([](){}); usingModel=decltype(serif::model::make_stellar_model(std::declval<serif::eos::models::Polytrope>(),Definition{}, std::declval<serif::model::FixedAngularMomentum>())); usingNoRotation=decltype(serif::model::make_stellar_model(std::declval<serif::eos::models::Polytrope>(),Definition{})); template<typename...Parameters> conceptSelectable=requires(Parameters...parameters){family::in(parameters...);}; template<typenameSelection,typenameLaw> conceptAttachable=requires(Selectionselection,Lawlaw){std::move(selection).with(std::move(law));}; template<typenameSelection,typenameTarget> conceptBindable=requires(Selectionselection,Targettarget){std::move(selection).bind(std::move(target));}; template<typenameFunction> conceptConstantLaw=requires(Functionfunction){family::law(Constant{},family::depends_on(Index{}),std::move(function));}; template<typenameParameter,typenameValue> conceptStartingValue=requires(Parameterparameter,Valuevalue){family::starting_at(parameter,value);}; template<typenameSetting,typenameBound> conceptApplicable=requires(Settingsetting,serif::solver::continuation::Options<Bound>&options){setting.apply(options);}; usingIndexSelection=decltype(family::in(Index{})); usingMomentumSelection=decltype(family::in(Momentum{})); usingKLaw=decltype(family::law(Constant{},family::depends_on(Index{}),[](doublevalue){return1.0/value;})); usingComplete=decltype(std::declval<IndexSelection>().with(std::declval<KLaw>())); usingBoth=decltype(family::in(Index{},Momentum{}).with(std::declval<KLaw>())); usingBound=decltype(std::declval<Both>().bind(std::declval<Model>())); usingSelfLaw=decltype(family::law(Constant{},family::depends_on(Constant{}),[](doublevalue){returnvalue;})); structUnidentifiedEOS{}; usingUnidentified=decltype(serif::model::make_stellar_model(UnidentifiedEOS{},Definition{},std::declval<serif::model::FixedAngularMomentum>())); structOpaqueEquations{doublepressure;}; usingOpaque=decltype(serif::model::make_stellar_model(std::declval<serif::eos::models::Polytrope>(),OpaqueEquations{},std::declval<serif::model::FixedAngularMomentum>())); usingIdentified=decltype(family::identified_equations([](constauto&){return1;},serif::dimensions::PressureValue{0.1})); usingExplicitIdentity=decltype(serif::model::make_stellar_model(std::declval<serif::eos::models::Polytrope>(), std::declval<Identified>(),std::declval<serif::model::FixedAngularMomentum>())); static_assert(family::PhysicalParameter<Index>&&family::PhysicalParameter<Constant>&&family::PhysicalParameter<Momentum>); static_assert(!Selectable<>&&!Selectable<int>&&!Selectable<Index,Index>); static_assert(Attachable<IndexSelection,KLaw>); static_assert(!Attachable<MomentumSelection,KLaw>); static_assert(!Attachable<Complete,KLaw>); static_assert(!Attachable<IndexSelection,SelfLaw>); static_assert(!Attachable<decltype(family::in(Index{},Constant{})),KLaw>); static_assert(!ConstantLaw<decltype([](double){returnserif::dimensions::AngularMomentumValue{1.0};})>); static_assert(!ConstantLaw<decltype([](serif::dimensions::AngularMomentumValue){return1.0;})>); static_assert(!Bindable<IndexSelection,Model>); static_assert(Bindable<Complete,Model>); static_assert(!Bindable<MomentumSelection,NoRotation>); static_assert(!Bindable<MomentumSelection,Unidentified>); static_assert(!Bindable<MomentumSelection,Opaque>); static_assert(Bindable<MomentumSelection,ExplicitIdentity>); static_assert(std::same_as<std::tuple_element_t<0,decltype(std::declval<Identified>().identity)>,serif::dimensions::PressureValue>); static_assert(StartingValue<Index,double>); static_assert(StartingValue<Momentum,serif::dimensions::AngularMomentumValue>); static_assert(!StartingValue<Momentum,double>); static_assert(Bound::coordinate_count==2); static_assert(Bound::coordinate_index(Index{})==0&&Bound::coordinate_index(Momentum{})==1); static_assert(!Bound::has_coordinate<Constant>); static_assert(Applicable<decltype(family::prefer(Index{})),Bound>); static_assert(!Applicable<decltype(family::stages(Index{})),Bound>); static_assert(Applicable<decltype(family::stages(Momentum{},Index{})),Bound>); }