Skip to content
Snippets Groups Projects
Commit 3d48423d authored by wenqing's avatar wenqing
Browse files

[ComponentTransport] Moved process ID data to the process data struct and

add a member of getNumberOfProcesses()
parent 9db0f0a4
No related branches found
No related tags found
No related merge requests found
......@@ -85,16 +85,6 @@ template <typename ShapeFunction, typename IntegrationMethod,
unsigned GlobalDim>
class LocalAssemblerData : public ComponentTransportLocalAssemblerInterface
{
// When staggered scheme is adopted, nodal pressure and nodal concentration
// are accessed by process id.
static const int hydraulic_process_id = 0;
// TODO (renchao-lu): This variable is used in the calculation of the
// fluid's density and flux, indicating the transport process id. For now it
// is assumed that these quantities depend on the first occurring transport
// process only. The density and flux calculations have to be extended to
// all processes.
static const int first_transport_process_id = 1;
// When monolithic scheme is adopted, nodal pressure and nodal concentration
// are accessed by vector index.
static const int pressure_index = 0;
......@@ -428,7 +418,7 @@ public:
std::vector<double>& local_K_data, std::vector<double>& local_b_data,
LocalCoupledSolutions const& coupled_xs) override
{
if (process_id == hydraulic_process_id)
if (process_id == _process_data.hydraulic_process_id)
{
assembleHydraulicEquation(t, dt, local_x, local_M_data,
local_K_data, local_b_data, coupled_xs);
......
......@@ -27,26 +27,20 @@ namespace ComponentTransport
{
struct ComponentTransportProcessData
{
ComponentTransportProcessData(
std::unique_ptr<MaterialPropertyLib::MaterialSpatialDistributionMap>&&
media_map_,
Eigen::VectorXd const& specific_body_force_, bool const has_gravity_,
bool const non_advective_form_,
std::unique_ptr<ChemicalProcessData>&& chemical_process_data_)
: media_map(std::move(media_map_)),
specific_body_force(specific_body_force_),
has_gravity(has_gravity_),
non_advective_form(non_advective_form_),
chemical_process_data(std::move(chemical_process_data_))
{
}
std::unique_ptr<MaterialPropertyLib::MaterialSpatialDistributionMap>
media_map;
Eigen::VectorXd const specific_body_force;
bool const has_gravity;
bool const non_advective_form;
std::unique_ptr<ChemicalProcessData> chemical_process_data;
const int hydraulic_process_id;
// TODO (renchao-lu): This variable is used in the calculation of the
// fluid's density and flux, indicating the transport process id. For now it
// is assumed that these quantities depend on the first occurring transport
// process only. The density and flux calculations have to be extended to
// all processes.
const int first_transport_process_id;
};
} // namespace ComponentTransport
......
......@@ -131,6 +131,8 @@ std::unique_ptr<Process> createComponentTransportProcess(
it->get().getName(),
it->get().getNumberOfGlobalComponents());
}
int const hydraulic_process_id = 0;
int const first_transport_process_id = use_monolithic_scheme ? 0 : 1;
// Allocate the collected process variables into a two-dimensional vector,
// depending on what scheme is adopted
......@@ -225,9 +227,13 @@ std::unique_ptr<Process> createComponentTransportProcess(
auto chemical_process_data =
createChemicalProcessData(chemical_solver_interface);
ComponentTransportProcessData process_data{
std::move(media_map), specific_body_force, has_gravity,
non_advective_form, std::move(chemical_process_data)};
ComponentTransportProcessData process_data{std::move(media_map),
specific_body_force,
has_gravity,
non_advective_form,
std::move(chemical_process_data),
hydraulic_process_id,
first_transport_process_id};
SecondaryVariableCollection secondary_variables;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment