feat: add solver core skeleton
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
#include <fesa/analysis/analysis.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class RecordingAnalysis : public fesa::analysis::Analysis {
|
||||
public:
|
||||
const std::vector<std::string>& calls() const
|
||||
{
|
||||
return calls_;
|
||||
}
|
||||
|
||||
protected:
|
||||
void initialize() override { calls_.push_back("initialize"); }
|
||||
void build_analysis_model() override { calls_.push_back("build_analysis_model"); }
|
||||
void build_dof_map() override { calls_.push_back("build_dof_map"); }
|
||||
void build_sparse_pattern() override { calls_.push_back("build_sparse_pattern"); }
|
||||
void assemble() override { calls_.push_back("assemble"); }
|
||||
void apply_boundary_conditions() override { calls_.push_back("apply_boundary_conditions"); }
|
||||
void solve() override { calls_.push_back("solve"); }
|
||||
void update_state() override { calls_.push_back("update_state"); }
|
||||
void write_results() override { calls_.push_back("write_results"); }
|
||||
|
||||
private:
|
||||
std::vector<std::string> calls_;
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
RecordingAnalysis analysis;
|
||||
analysis.run();
|
||||
const std::vector<std::string> expected{
|
||||
"initialize",
|
||||
"build_analysis_model",
|
||||
"build_dof_map",
|
||||
"build_sparse_pattern",
|
||||
"assemble",
|
||||
"apply_boundary_conditions",
|
||||
"solve",
|
||||
"update_state",
|
||||
"write_results"
|
||||
};
|
||||
return analysis.calls() == expected ? 0 : 1;
|
||||
}
|
||||
Reference in New Issue
Block a user