|
svZeroDSolver
|
Structured-tree impedance boundary condition with periodic memory. More...
#include <ImpedanceBC.h>
Public Member Functions | |
| ImpedanceBC (int id, Model *model) | |
| Construct a new ImpedanceBC object. | |
| void | setup_dofs (DOFHandler &dofhandler) override |
| Set up the algebraic degree of freedom for the impedance BC. | |
| void | update_constant (SparseSystem &system, std::vector< double > ¶meters) override |
| Assemble constant Jacobian contributions. | |
| void | update_time (SparseSystem &system, std::vector< double > ¶meters) override |
| Assemble time-dependent residual contributions. | |
| void | accept_timestep (const Eigen::Matrix< double, Eigen::Dynamic, 1 > &y) override |
| Commit the accepted outlet flow for the next convolution update. | |
| std::vector< double > | get_persistent_state () const override |
| Serialize the convolution history needed for restart/coupling. | |
| void | set_persistent_state (const std::vector< double > &state) override |
| Restore a previously serialized convolution history state. | |
| void | configure (const std::vector< double > &z, double pd, const std::string &convolution_mode, int num_kernel_terms, int points_per_cycle) |
| Configure the impedance kernel and convolution controls. | |
| Public Member Functions inherited from Block | |
| Block (int id, Model *model, BlockType block_type, BlockClass block_class, std::vector< std::pair< std::string, InputParameter > > input_params) | |
| Construct a new Block object. | |
| ~Block () | |
| Destroy the Block object. | |
| Block (const Block &)=delete | |
| Copy the Block object. | |
| std::string | get_name () const |
| Get the name of the block. | |
| void | update_vessel_type (VesselType type) |
| Update vessel type of the block. | |
| void | setup_params_ (const std::vector< int > ¶m_ids) |
| Setup parameter IDs for the block. | |
| void | setup_dofs_ (DOFHandler &dofhandler, int num_equations, const std::list< std::string > &internal_var_names) |
| Set up the degrees of freedom (DOF) of the block. | |
| virtual void | setup_model_dependent_params () |
| Setup parameters that depend on the model. | |
| virtual void | setup_initial_state_dependent_params (State initial_state, std::vector< double > ¶meters) |
| Setup parameters that depend on the initial state. | |
| virtual void | update_solution (SparseSystem &system, std::vector< double > ¶meters, const Eigen::Matrix< double, Eigen::Dynamic, 1 > &y, const Eigen::Matrix< double, Eigen::Dynamic, 1 > &dy) |
| Update the solution-dependent contributions of the element in a sparse system. | |
| virtual void | post_solve (Eigen::Matrix< double, Eigen::Dynamic, 1 > &y) |
| Modify the solution after solving it. | |
| virtual void | update_gradient (Eigen::SparseMatrix< double > &jacobian, Eigen::Matrix< double, Eigen::Dynamic, 1 > &alpha, std::vector< double > &y, std::vector< double > &dy) |
| Set the gradient of the block residual with respect to the parameters. | |
| virtual TripletsContributions | get_num_triplets () |
| Get number of triplets of element. | |
| virtual void | set_activation_function (std::unique_ptr< ActivationFunction > af) |
| Set activation function (for chamber blocks that use one). | |
| virtual void | set_material (std::unique_ptr< SphereMaterial > m) |
| Set wall material (for ChamberSphere blocks). | |
Public Attributes | |
| TripletsContributions | num_triplets {2, 0, 0} |
| Nonzero triplet counts contributed by this block. | |
| Public Attributes inherited from Block | |
| const int | id |
| Global ID of the block. | |
| const Model * | model |
| The model to which the block belongs. | |
| const BlockType | block_type |
| Type of this block. | |
| const BlockClass | block_class |
| Class of this block. | |
| VesselType | vessel_type = VesselType::neither |
| Vessel type of this block. | |
| const std::vector< std::pair< std::string, InputParameter > > | input_params |
| Map from name to input parameter. | |
| std::vector< Node * > | inlet_nodes |
| Inlet nodes. | |
| std::vector< Node * > | outlet_nodes |
| Outlet nodes. | |
| bool | steady = false |
| Toggle steady behavior. | |
| bool | input_params_list = false |
| Are input parameters given as a list? | |
| std::vector< int > | global_param_ids |
| Global IDs for the block parameters. | |
| std::vector< int > | global_var_ids |
| Global variable indices of the local element contributions. | |
| std::vector< int > | global_eqn_ids |
| Global equation indices of the local element contributions. | |
| TripletsContributions | num_triplets |
| Number of triplets of element. | |
Structured-tree impedance boundary condition with periodic memory.
Imposes the outlet pressure as a discrete convolution of the impedance kernel with one cardiac cycle of flow history, following the structured-tree outflow condition of [6].
![\[P_{n+1}=P_d+z_0Q_{n+1}+\sum_{m=1}^{N_k-1}z_mQ_{n+1-m}
\]](form_107.png)
The 


The ring buffer is zero-initialized, so the history terms are omitted entirely until one full cycle has been accepted, after which they switch on at full magnitude. This reproduces the reference implementation, which gates the same sum on t > Period, and makes the pressure discontinuous at the start of the second cycle. The first cycle is therefore not a meaningful solution and should be discarded.
![\[\mathbf{y}^{e}=\left[\begin{array}{ll}P^{e} & Q^{e}\end{array}\right]^{T}
\]](form_104.png)
![\[\mathbf{F}^{e}=\left[\begin{array}{cc}
1 & -z_{0}
\end{array}\right]
\]](form_111.png)
![\[\mathbf{c}^{e}=\left[\begin{array}{c}
-\left(P_{d}+\sum_{m=1}^{N_k-1}z_mQ_{n+1-m}\right)
\end{array}\right]
\]](form_112.png)

"boundary_conditions": [
{
"bc_name": "OUT",
"bc_type": "IMPEDANCE",
"bc_values": {
"Pd": 0.0,
"z": [ ... ],
"convolution_mode": "exact",
"num_kernel_terms": 128
}
}
]
The kernel is discretized at the solver time step, which constrains simulation_parameters:
|
inline |
Construct a new ImpedanceBC object.
| id | Global ID of the block |
| model | The model to which the block belongs |
|
overridevirtual |
Commit the accepted outlet flow for the next convolution update.
| y | Accepted global state vector |
Reimplemented from Block.
| void ImpedanceBC::configure | ( | const std::vector< double > & | z, |
| double | pd, | ||
| const std::string & | convolution_mode, | ||
| int | num_kernel_terms, | ||
| int | points_per_cycle ) |
Configure the impedance kernel and convolution controls.
| z | Time-domain impedance kernel |
| pd | Distal/reference pressure |
| convolution_mode | Convolution mode (exact or truncated) |
| num_kernel_terms | Number of kernel terms for truncated mode |
| points_per_cycle | Sample points spanning one cardiac cycle (simulation_parameters.number_of_time_pts_per_cardiac_cycle). Pass 0 to infer the cycle discretization from cardiac_period / dt instead. |
|
overridevirtual |
Serialize the convolution history needed for restart/coupling.
Reimplemented from Block.
|
overridevirtual |
Restore a previously serialized convolution history state.
| state | Persistent block state |
Reimplemented from Block.
|
overridevirtual |
Set up the algebraic degree of freedom for the impedance BC.
| dofhandler | Global degree-of-freedom handler |
Reimplemented from Block.
|
overridevirtual |
Assemble constant Jacobian contributions.
| system | Global sparse system |
| parameters | Current parameter values |
Reimplemented from Block.
|
overridevirtual |
Assemble time-dependent residual contributions.
| system | Global sparse system |
| parameters | Current parameter values |
Reimplemented from Block.
| TripletsContributions ImpedanceBC::num_triplets {2, 0, 0} |
Nonzero triplet counts contributed by this block.