NUMCXX  0.13.20181108
Numerical library for small projects and teaching purposes
31-cut.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  {-2,0},
25  {0,0},
26  {2,0},
27  {2,2},
28  {0.5,2},
29  {0,1},
30  {-0.5,2},
31  {-2,2}
32  });
33  pGeometry->set_bfaces({
34  {0,1},
35  {1,2},
36  {2,3},
37  {3,4},
38  {4,5},
39  {5,6},
40  {6,7},
41  {7,0},
42  {5,1},
43  });
44 
45 
46  pGeometry->set_bfaceregions({1,1,2,3,4,4,3,2,5});
47 
48  pGeometry->set_regionpoints({
49  {-0.5,1},
50  {0.5,1}
51  });
52  pGeometry->set_regionnumbers({1,2});
53  pGeometry->set_regionvolumes({0.1,0.01});
54 
55 
56 
57  auto pGrid=numcxx::SimpleGrid::create(pGeometry,"zpaAqV");
58 
59 
60 #ifdef VTKFIG
61  auto griddata=numcxx::vtkfigDataSet(pGrid);
62  auto frame=vtkfig::Frame::New();
63  auto gridview=vtkfig::GridView::New();
64  gridview->SetData(griddata);
65  frame->AddFigure(gridview);
66  frame->Interact();
67 #endif
68 }
69 
70 
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
int main(void)
Definition: 31-cut.cxx:20
static std::shared_ptr< SimpleGrid > create(const Geometry &geometry, const std::string triangle_flags)
Static constructor from reference to geometry.
Definition: simplegrid.hxx:35