Skip to content

Commit

Permalink
Auto-format code changes (#274)
Browse files Browse the repository at this point in the history
Auto-format code using Clang-Format

Co-authored-by: GitHub Actions <[email protected]>
  • Loading branch information
github-actions[bot] and actions-user authored Oct 2, 2023
1 parent 2bb42fd commit 12f1eab
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
12 changes: 6 additions & 6 deletions test/tutorial/test_multiple_grid_cells.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <iomanip>
#include <iostream>

#include <micm/process/user_defined_rate_constant.hpp>
#include <micm/solver/rosenbrock.hpp>

Expand Down Expand Up @@ -86,7 +85,7 @@ int main()
State<Matrix> state = solver.GetState();

// mol m-3
state.SetConcentration(a, std::vector<double>{1, 2, 0.5 });
state.SetConcentration(a, std::vector<double>{ 1, 2, 0.5 });
state.SetConcentration(b, std::vector<double>(3, 0));
state.SetConcentration(c, std::vector<double>(3, 0));

Expand All @@ -97,11 +96,12 @@ int main()
state.SetCustomRateParameter("r2", std::vector<double>(3, k2));
state.SetCustomRateParameter("r3", std::vector<double>(3, k3));

double temperature = 272.5; // [K]
double pressure = 101253.3; // [Pa]
double air_density = 1e6; // [mol m-3]
double temperature = 272.5; // [K]
double pressure = 101253.3; // [Pa]
double air_density = 1e6; // [mol m-3]

for(size_t cell = 0; cell < solver.parameters_.number_of_grid_cells_; ++cell) {
for (size_t cell = 0; cell < solver.parameters_.number_of_grid_cells_; ++cell)
{
state.conditions_[cell].temperature_ = temperature;
state.conditions_[cell].pressure_ = pressure;
state.conditions_[cell].air_density_ = air_density;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ int main(const int argc, const char* argv[])
auto chemical_system = System(micm::SystemParameters{ .gas_phase_ = gas_phase });
auto reactions = std::vector<micm::Process>{ r1, r2, r3, r4, r5, r6, r7 };

RosenbrockSolver<> solver{ chemical_system,
reactions,
RosenbrockSolverParameters::three_stage_rosenbrock_parameters() };
RosenbrockSolver<> solver{ chemical_system, reactions, RosenbrockSolverParameters::three_stage_rosenbrock_parameters() };
State state = solver.GetState();

state.conditions_[0].temperature_ = 287.45; // K
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ int main(const int argc, const char* argv[])
auto chemical_system = solver_params.system_;
auto reactions = solver_params.processes_;

RosenbrockSolver<> solver{ chemical_system,
reactions,
RosenbrockSolverParameters::three_stage_rosenbrock_parameters() };
RosenbrockSolver<> solver{ chemical_system, reactions, RosenbrockSolverParameters::three_stage_rosenbrock_parameters() };

State state = solver.GetState();

Expand Down
11 changes: 5 additions & 6 deletions test/tutorial/test_rate_constants_user_defined_by_hand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,18 @@ int main(const int argc, const char* argv[])
Process r8 = Process::create()
.reactants({ c })
.products({ yields(g, 1) })
.rate_constant(UserDefinedRateConstant({.label_="my photolysis rate"}))
.rate_constant(UserDefinedRateConstant({ .label_ = "my photolysis rate" }))
.phase(gas_phase);

Process r9 = Process::create()
.products({ yields(a, 1) })
.rate_constant(UserDefinedRateConstant({.label_="my emission rate"}))
.rate_constant(UserDefinedRateConstant({ .label_ = "my emission rate" }))
.phase(gas_phase);

Process r10 = Process::create()
.reactants({ b })
.rate_constant(UserDefinedRateConstant({.label_="my loss rate"}))
.phase(gas_phase);
.reactants({ b })
.rate_constant(UserDefinedRateConstant({ .label_ = "my loss rate" }))
.phase(gas_phase);

auto chemical_system = System(micm::SystemParameters{ .gas_phase_ = gas_phase });
auto reactions = std::vector<micm::Process>{ r1, r2, r3, r4, r5, r6, r7, r8, r9, r10 };
Expand All @@ -171,7 +171,6 @@ int main(const int argc, const char* argv[])
state.SetCustomRateParameter("C.effective radius [m]", 1e-7);
state.SetCustomRateParameter("C.particle number concentration [# m-3]", 2.5e6);


// choose and timestep a print the initial state
double time_step = 500; // s

Expand Down

0 comments on commit 12f1eab

Please sign in to comment.