Finite volume method for stationary heat equation
#include <cstdio>
#include <iostream>
#include <ctime>
#include <cmath>
#ifdef VTKFIG
#endif
#include "vtkfigFrame.h"
#include "vtkfigDataSet.h"
#include "vtkfigGridView.h"
#include "vtkfigScalarView.h"
{
{-2,0},
{0,0},
{2,0},
{2,2},
{0.5,2},
{0,1},
{-0.5,2},
{-2,2}
});
{0,1},
{1,2},
{2,3},
{3,4},
{4,5},
{5,6},
{6,7},
{7,0},
{5,1},
});
{-0.5,1},
{0.5,1}
});
bcfac=0;
bcval=0;
bcval(4)=1.0;
bcval(0)=0.0;
kappa=1;
source=0;
#ifdef VTKFIG
auto griddata=numcxx::vtkfigDataSet(grid);
griddata->SetPointScalar(Sol ,"Sol");
auto frame=vtkfig::Frame::New();
frame->SetSize(800,400);
frame->SetLayout(2,1);
auto gridview=vtkfig::GridView::New();
gridview->SetData(griddata);
frame->AddFigure(gridview,0);
auto solview=vtkfig::ScalarView::New();
solview->SetData(griddata,"Sol");
frame->AddFigure(solview,1);
frame->Interact();
#endif
}