Function ImmersX::Vascularization::demand_flow_conditions(const NetworkData&, const std::map<Id, double>&, double, const std::vector<Id>&, MPI_Comm)

Function Documentation

ReferenceConditions ImmersX::Vascularization::demand_flow_conditions(const NetworkData &network, const std::map<Id, double> &port_pressures, double total_flow, const std::vector<Id> &selected_terminals, MPI_Comm communicator)

Prescribe total_flow (m^3/s) through selected tissue terminals, distributed by their relative demand.

Empty selection means all terminals. Arterial sinks and venous sources are normalized independently to the same total. Only the supplied explicit ports receive prescribed pressures; their flows are reactions, so no inlet receives both pressure and flow. Unselected terminals are left for the caller’s boundary conditions. Collective for one or more processes. Only owned terminal records enter the per-system demand sums; output conditions belong to their node owners. Explicit selections and total_flow must match on every rank. Pressure controls may be distributed or repeated identically and must name ports.