7#ifndef SVZERODSOLVER_MODEL_IMPEDANCEBC_HPP_
8#define SVZERODSOLVER_MODEL_IMPEDANCEBC_HPP_
123 void setup_dofs(DOFHandler& dofhandler)
override;
132 std::vector<double>& parameters)
override;
141 std::vector<double>& parameters)
override;
149 const Eigen::Matrix<double, Eigen::Dynamic, 1>& y)
override;
176 void configure(
const std::vector<double>& z,
double pd,
177 const std::string& convolution_mode,
int num_kernel_terms,
178 int points_per_cycle);
186 enum class ConvolutionMode { exact = 0, truncated = 1 };
191 static constexpr size_t kNumStateHeaderFields = 5;
193 void ensure_initialized();
194 double lagged_flow(
int lag)
const;
196 std::vector<double> kernel;
198 ConvolutionMode mode = ConvolutionMode::exact;
199 int num_kernel_terms_input = -1;
202 int points_per_cycle_input = 0;
203 bool configured =
false;
206 bool initialized =
false;
208 int num_period_steps = -1;
209 int num_kernel_terms = -1;
213 long long num_accepted_steps = 0;
214 std::vector<double> flow_history;
BlockType
The types of blocks supported by the solver.
Definition BlockType.h:15
BlockClass
The classes/categories of blocks supported. Some classes require special handling (e....
Definition BlockType.h:45
SparseSystem source file.
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.
Definition Block.h:102
const int id
Global ID of the block.
Definition Block.h:79
const Model * model
The model to which the block belongs.
Definition Block.h:80
void accept_timestep(const Eigen::Matrix< double, Eigen::Dynamic, 1 > &y) override
Commit the accepted outlet flow for the next convolution update.
Definition ImpedanceBC.cpp:41
TripletsContributions num_triplets
Nonzero triplet counts contributed by this block.
Definition ImpedanceBC.h:183
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.
Definition ImpedanceBC.cpp:126
void setup_dofs(DOFHandler &dofhandler) override
Set up the algebraic degree of freedom for the impedance BC.
Definition ImpedanceBC.cpp:13
void update_time(SparseSystem &system, std::vector< double > ¶meters) override
Assemble time-dependent residual contributions.
Definition ImpedanceBC.cpp:22
std::vector< double > get_persistent_state() const override
Serialize the convolution history needed for restart/coupling.
Definition ImpedanceBC.cpp:51
void update_constant(SparseSystem &system, std::vector< double > ¶meters) override
Assemble constant Jacobian contributions.
Definition ImpedanceBC.cpp:17
ImpedanceBC(int id, Model *model)
Construct a new ImpedanceBC object.
Definition ImpedanceBC.h:110
void set_persistent_state(const std::vector< double > &state) override
Restore a previously serialized convolution history state.
Definition ImpedanceBC.cpp:69
Model of 0D elements.
Definition Model.h:56
The number of triplets that the element contributes to the global system.
Definition Block.h:28