NUMCXX  0.13.20181108
Numerical library for small projects and teaching purposes
30-triangle.cxx
Go to the documentation of this file.
1 #include <cstdio>
7 #include <iostream>
8 #include <ctime>
9 #include <cmath>
10 #include "numcxx/numcxx.hxx"
11 #include "numcxx/simplegrid.hxx"
13 
14 #include "vtkfig/vtkfigFrame.h"
15 #include "vtkfig/vtkfigDataSet.h"
16 #include "vtkfig/vtkfigGridView.h"
17 
18 
19 
20 int main(void)
21 {
22  auto pGeometry=numcxx::Geometry::create();
23  pGeometry->set_points({
24  {0,0},
25  {1,0},
26  {1,1}});
27  pGeometry->set_bfaces({
28  {0,1},
29  {1,2},
30  {2,0}});
31  pGeometry->set_bfaceregions({1,2,3});
32 
33  pGeometry->set_regionpoints({{0.5,0.5}});
34  pGeometry->set_regionnumbers({1});
35  pGeometry->set_regionvolumes({0.01});
36 
37 
38 
39  auto pGrid=numcxx::SimpleGrid::create(pGeometry,"zpaAqV");
40 
41 
42  #ifdef VTKFIG
43  auto griddata=numcxx::vtkfigDataSet(pGrid);
44  auto frame=vtkfig::Frame::New();
45  auto gridview=vtkfig::GridView::New();
46  gridview->SetData(griddata);
47  frame->AddFigure(gridview);
48  frame->Interact();
49  #endif
50 }
51 
52 
int main(void)
Definition: 30-triangle.cxx:20
Header for simple grid data class.
Main header of the library.
Header for adapter beteween vtkfig dataset and simple grid.
static std::shared_ptr< Geometry > create()
Definition: geometry.hxx:73
static std::shared_ptr< SimpleGrid > create(const Geometry &geometry, const std::string triangle_flags)
Static constructor from reference to geometry.
Definition: simplegrid.hxx:35