Commit d7833f1d authored by renchao.lu's avatar renchao.lu
Browse files

[CL] Add members into KineticReactant.

parent 76f0149b
......@@ -39,7 +39,9 @@ void ChemicalSystem::initialize(std::size_t const num_chemical_systems)
for (auto& kinetic_reactant : kinetic_reactants)
{
kinetic_reactant.molality->resize(num_chemical_systems);
kinetic_reactant.molality_prev->resize(num_chemical_systems);
kinetic_reactant.volume_fraction->resize(num_chemical_systems);
kinetic_reactant.volume_fraction_prev->resize(num_chemical_systems);
}
for (auto& equilibrium_reactant : equilibrium_reactants)
......
......@@ -54,9 +54,18 @@ std::vector<KineticReactant> createKineticReactants(
auto molality = MeshLib::getOrCreateMeshProperty<double>(
mesh, name, MeshLib::MeshItemType::IntegrationPoint, 1);
auto molality_prev = MeshLib::getOrCreateMeshProperty<double>(
mesh, name + "_prev", MeshLib::MeshItemType::IntegrationPoint, 1);
auto volume_fraction = MeshLib::getOrCreateMeshProperty<double>(
mesh, "phi_" + name, MeshLib::MeshItemType::IntegrationPoint, 1);
auto volume_fraction_prev = MeshLib::getOrCreateMeshProperty<double>(
mesh,
"phi_" + name + "_prev",
MeshLib::MeshItemType::IntegrationPoint,
1);
auto mesh_prop_molality = MeshLib::getOrCreateMeshProperty<double>(
mesh, name + "_avg", MeshLib::MeshItemType::Cell, 1);
mesh_prop_molality->resize(mesh.getNumberOfElements());
......@@ -71,7 +80,9 @@ std::vector<KineticReactant> createKineticReactants(
kinetic_reactants.emplace_back(std::move(name),
std::move(chemical_formula),
molality,
molality_prev,
volume_fraction,
volume_fraction_prev,
mesh_prop_molality,
std::move(parameters),
fix_amount);
......
......@@ -27,14 +27,18 @@ struct KineticReactant
KineticReactant(std::string name_,
std::string chemical_formula_,
MeshLib::PropertyVector<double>* molality_,
MeshLib::PropertyVector<double>* molality_prev_,
MeshLib::PropertyVector<double>* volume_fraction_,
MeshLib::PropertyVector<double>* volume_fraction_prev_,
MeshLib::PropertyVector<double>* mesh_prop_molality_,
std::vector<double>&& parameters_,
bool const fix_amount_)
: name(std::move(name_)),
chemical_formula(std::move(chemical_formula_)),
molality(molality_),
molality_prev(molality_prev_),
volume_fraction(volume_fraction_),
volume_fraction_prev(volume_fraction_prev_),
mesh_prop_molality(mesh_prop_molality_),
parameters(std::move(parameters_)),
fix_amount(fix_amount_)
......@@ -46,7 +50,9 @@ struct KineticReactant
std::string const name;
std::string const chemical_formula;
MeshLib::PropertyVector<double>* molality;
MeshLib::PropertyVector<double>* molality_prev;
MeshLib::PropertyVector<double>* volume_fraction;
MeshLib::PropertyVector<double>* volume_fraction_prev;
MeshLib::PropertyVector<double>* mesh_prop_molality;
std::vector<double> const parameters;
bool const fix_amount;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment