Skip to content

Commit

Permalink
Auto-format code using Clang-Format (#241)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub Actions <[email protected]>
  • Loading branch information
github-actions[bot] and actions-user authored Nov 5, 2024
1 parent f7a69ef commit e4c9786
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/micm/micm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,12 @@ namespace musica
cond.air_density_ = air_density[i_cond++];
}
std::size_t i_species_elem = 0;
for (auto &var : state.variables_.AsVector()) var = concentrations[i_species_elem++];
for (auto &var : state.variables_.AsVector())
var = concentrations[i_species_elem++];

std::size_t i_custom_rate_elem = 0;
for (auto &var : state.custom_rate_parameters_.AsVector()) var = custom_rate_parameters[i_custom_rate_elem++];
for (auto &var : state.custom_rate_parameters_.AsVector())
var = custom_rate_parameters[i_custom_rate_elem++];

solver->CalculateRateConstants(state);
auto result = solver->Solve(time_step, state);
Expand All @@ -463,7 +465,8 @@ namespace musica
result.final_time_);

i_species_elem = 0;
for (auto &var : state.variables_.AsVector()) concentrations[i_species_elem++] = var;
for (auto &var : state.variables_.AsVector())
concentrations[i_species_elem++] = var;

DeleteError(error);
*error = NoError();
Expand Down
8 changes: 6 additions & 2 deletions src/test/unit/micm/micm_c_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,16 @@ double CalculateArrhenius(const ArrheniusReaction parameters, const double tempe
}

// Common test function for solving multiple grid cells with standard-ordered matrices
void TestStandardMultipleGridCells(MICM* micm, const size_t num_grid_cells, const double time_step, const double test_accuracy)
void TestStandardMultipleGridCells(
MICM* micm,
const size_t num_grid_cells,
const double time_step,
const double test_accuracy)
{
const size_t num_concentrations = 6;
const size_t num_user_defined_reaction_rates = 2;
constexpr double GAS_CONSTANT = 8.31446261815324; // J mol-1 K-1

double* temperature = new double[num_grid_cells];
double* pressure = new double[num_grid_cells];
double* air_density = new double[num_grid_cells];
Expand Down

0 comments on commit e4c9786

Please sign in to comment.