@@ -17,7 +17,8 @@ namespace musica
1717 // remove USER. SURF. PHOTO. from name
1818 std::string stripped_name = name;
1919 const std::string prefixes[] = { " USER." , " SURF." , " PHOTO." };
20- for (const auto & prefix : prefixes) {
20+ for (const auto & prefix : prefixes)
21+ {
2122 if (stripped_name.find (prefix) == 0 )
2223 {
2324 stripped_name = stripped_name.substr (prefix.length ());
@@ -69,15 +70,18 @@ namespace musica
6970 const std::vector<mechanism_configuration::v0::types::Species>& v0_species);
7071
7172 mechanism_configuration::v1::types::Reactions convert_reactions_v0_to_v1 (
72- const mechanism_configuration::v0::types::Reactions& v0_reactions, bool convert_reaction_units);
73+ const mechanism_configuration::v0::types::Reactions& v0_reactions,
74+ bool convert_reaction_units);
7375
7476 std::vector<mechanism_configuration::v1::types::ReactionComponent> convert_reaction_components_v0_to_v1 (
7577 const std::vector<mechanism_configuration::v0::types::ReactionComponent>& v0_components);
7678
7779 mechanism_configuration::v1::types::ReactionComponent convert_reaction_component_v0_to_v1 (
7880 const mechanism_configuration::v0::types::ReactionComponent& v0_component);
7981
80- mechanism_configuration::v1::types::Mechanism ConvertV0MechanismToV1 (const std::string& config_path, bool convert_reaction_units)
82+ mechanism_configuration::v1::types::Mechanism ConvertV0MechanismToV1 (
83+ const std::string& config_path,
84+ bool convert_reaction_units)
8185 {
8286 mechanism_configuration::v0::Parser parser;
8387 auto parsed = parser.Parse (config_path);
@@ -160,7 +164,8 @@ namespace musica
160164 }
161165
162166 mechanism_configuration::v1::types::Reactions convert_reactions_v0_to_v1 (
163- const mechanism_configuration::v0::types::Reactions& v0_reactions, bool convert_reaction_units)
167+ const mechanism_configuration::v0::types::Reactions& v0_reactions,
168+ bool convert_reaction_units)
164169 {
165170 mechanism_configuration::v1::types::Reactions v1_reactions;
166171
@@ -187,7 +192,8 @@ namespace musica
187192 v1_branched.reactants = convert_reaction_components_v0_to_v1 (branched.reactants );
188193 v1_branched.alkoxy_products = convert_reaction_components_v0_to_v1 (branched.alkoxy_products );
189194 v1_branched.nitrate_products = convert_reaction_components_v0_to_v1 (branched.nitrate_products );
190- v1_branched.X = convert_reaction_units ? convert_molecules_cm3_to_moles_m3 (v1_branched.reactants , branched.X ) : branched.X ;
195+ v1_branched.X =
196+ convert_reaction_units ? convert_molecules_cm3_to_moles_m3 (v1_branched.reactants , branched.X ) : branched.X ;
191197 v1_branched.Y = branched.Y ;
192198 v1_branched.a0 = branched.a0 ;
193199 v1_branched.n = branched.n ;
@@ -215,8 +221,10 @@ namespace musica
215221 mechanism_configuration::v1::types::Troe v1_troe;
216222 v1_troe.reactants = convert_reaction_components_v0_to_v1 (troe.reactants );
217223 v1_troe.products = convert_reaction_components_v0_to_v1 (troe.products );
218- v1_troe.k0_A = convert_reaction_units ? k0_A_convert_molecules_cm3_to_moles_m3 (v1_troe.reactants , troe.k0_A ) : troe.k0_A ;
219- v1_troe.kinf_A = convert_reaction_units ? convert_molecules_cm3_to_moles_m3 (v1_troe.reactants , troe.kinf_A ) : troe.kinf_A ;
224+ v1_troe.k0_A =
225+ convert_reaction_units ? k0_A_convert_molecules_cm3_to_moles_m3 (v1_troe.reactants , troe.k0_A ) : troe.k0_A ;
226+ v1_troe.kinf_A =
227+ convert_reaction_units ? convert_molecules_cm3_to_moles_m3 (v1_troe.reactants , troe.kinf_A ) : troe.kinf_A ;
220228 v1_troe.k0_B = troe.k0_B ;
221229 v1_troe.k0_C = troe.k0_C ;
222230 v1_troe.kinf_B = troe.kinf_B ;
@@ -234,8 +242,10 @@ namespace musica
234242 mechanism_configuration::v1::types::TernaryChemicalActivation v1_ternary;
235243 v1_ternary.reactants = convert_reaction_components_v0_to_v1 (ternary.reactants );
236244 v1_ternary.products = convert_reaction_components_v0_to_v1 (ternary.products );
237- v1_ternary.k0_A = convert_reaction_units ? convert_molecules_cm3_to_moles_m3 (v1_ternary.reactants , ternary.k0_A ) : ternary.k0_A ;
238- v1_ternary.kinf_A = convert_reaction_units ? convert_molecules_cm3_to_moles_m3 (v1_ternary.reactants , ternary.kinf_A ) : ternary.kinf_A ;
245+ v1_ternary.k0_A =
246+ convert_reaction_units ? convert_molecules_cm3_to_moles_m3 (v1_ternary.reactants , ternary.k0_A ) : ternary.k0_A ;
247+ v1_ternary.kinf_A =
248+ convert_reaction_units ? convert_molecules_cm3_to_moles_m3 (v1_ternary.reactants , ternary.kinf_A ) : ternary.kinf_A ;
239249 v1_ternary.k0_B = ternary.k0_B ;
240250 v1_ternary.k0_C = ternary.k0_C ;
241251 v1_ternary.kinf_B = ternary.kinf_B ;
@@ -253,7 +263,8 @@ namespace musica
253263 mechanism_configuration::v1::types::Tunneling v1_tunneling;
254264 v1_tunneling.reactants = convert_reaction_components_v0_to_v1 (tunneling.reactants );
255265 v1_tunneling.products = convert_reaction_components_v0_to_v1 (tunneling.products );
256- v1_tunneling.A = convert_reaction_units ? convert_molecules_cm3_to_moles_m3 (v1_tunneling.reactants , tunneling.A ) : tunneling.A ;
266+ v1_tunneling.A =
267+ convert_reaction_units ? convert_molecules_cm3_to_moles_m3 (v1_tunneling.reactants , tunneling.A ) : tunneling.A ;
257268 v1_tunneling.B = tunneling.B ;
258269 v1_tunneling.C = tunneling.C ;
259270 v1_tunneling.gas_phase = " gas" ;
0 commit comments