17#include "strangsplitting.h"
21int main(
int ,
char ** ) {
23 auto mesh_factory = std::make_unique<lf::mesh::hybrid2d::MeshFactory>(2);
24 std::filesystem::path here = __FILE__;
27 auto mesh_file = (here.parent_path() /
"/meshes/circle.msh").
string();
29 std::shared_ptr<const lf::mesh::Mesh> mesh_p = reader.mesh();
31 std::shared_ptr<lf::uscalfe::UniformScalarFESpace<double>> fe_space =
32 std::make_shared<lf::uscalfe::FeSpaceLagrangeO1<double>>(mesh_p);
37 std::cout <<
"N_dofs :" << N_dofs << std::endl;
40 Eigen::VectorXd u0(N_dofs);
50 std::cout <<
"norm u0 " << u0.norm() << std::endl;
53 auto c = [](
const Eigen::Vector2d & ) ->
double {
60 double lambda = 0.008;
65 auto h = [](
const Eigen::Vector2d & ) ->
double {
return 0.0; };
66 Eigen::MatrixXd L(N_dofs, N_dofs);
80 Eigen::VectorXd cap(N_dofs);
82 cap = 0.8 * Eigen::VectorXd::Ones(N_dofs);
85 StrangSplit StrangSplitter(fe_space, T, m, lambda, c, h, L);
87 Eigen::MatrixXd sol(N_dofs, 20);
89 sol.col(0) = StrangSplitter.Evolution(cap, u0);
90 std::cout <<
"sol1" << std::endl;
91 sol.col(1) = StrangSplitter.Evolution(cap, sol.col(0));
92 std::cout <<
"sol2" << std::endl;
93 sol.col(2) = StrangSplitter.Evolution(cap, sol.col(1));
94 std::cout <<
"sol3" << std::endl;
95 sol.col(3) = StrangSplitter.Evolution(cap, sol.col(2));
96 std::cout <<
"sol4" << std::endl;
97 sol.col(4) = StrangSplitter.Evolution(cap, sol.col(3));
98 std::cout <<
"sol5" << std::endl;
102 for (
int k = 1; k < 6; k++) {
103 std::stringstream filename;
104 filename <<
"sol" << k <<
".vtk";
107 auto nodal_data = lf::mesh::utils::make_CodimMeshDataSet<double>(mesh_p, 2);
108 for (
int global_idx = 0; global_idx < N_dofs; global_idx++) {
109 nodal_data->operator()(dofh.Entity(global_idx)) =
110 sol.col(k - 1)[global_idx];
113 vtk_writer.WritePointData(
"sol", *nodal_data);
A general (interface) class for DOF handling, see Lecture Document Paragraph 2.7.4....
Reads a Gmsh *.msh file into a mesh::MeshFactory and provides a link between mesh::Entity objects and...
Write a mesh along with mesh data into a vtk file.
lf::assemble::size_type size_type