Peano
Loading...
Searching...
No Matches
CreateRegularGrid.py
Go to the documentation of this file.
1# This file is part of the Peano project. For conditions of distribution and
2# use, please see the copyright notice at www.peano-framework.org
3from peano4.solversteps.ActionSet import ActionSet
4
5
6
8 def __init__(self,maximum_cell_width):
9 """
10 maximum_cell_width
11 """
12 super( CreateRegularGrid, self ).__init__()
13 self.d = {}
14 self.d[ "H_MAX" ] = str(maximum_cell_width)
15
16
18 return ""
19
20
22 return ""
23
24
25 __Template_GridControlEvents = """
26 std::vector< peano4::grid::GridControlEvent > result;
27 peano4::grid::GridControlEvent newEntry;
28 newEntry.setRefinementControl( peano4::grid::GridControlEvent::RefinementControl::Refine );
29 newEntry.setOffset(tarch::la::Vector<Dimensions,double>( -std::numeric_limits<double>::max()/2.0/3.0 ));
30 newEntry.setWidth(tarch::la::Vector<Dimensions,double>( std::numeric_limits<double>::max()/2.0 ));
31 newEntry.setH(tarch::la::Vector<Dimensions,double>( {H_MAX} ));
32 result.push_back(newEntry);
33 return result;
34"""
35
36
38 return self.__Template_GridControlEvents.format(**self.d)
39
40
42 return __name__.replace(".py", "").replace(".", "_")
43
44
46 return False
47
48
49 def get_body_of_operation(self,operation_name):
50 result = "\n"
51 return result
52
53
54 def get_attributes(self):
55 return ""
56
57
58 def get_includes(self):
59 return ""
60
Action set (reactions to events)
Definition ActionSet.py:6
get_constructor_body(self)
Define a tailored constructor body.
get_attributes(self)
Return attributes as copied and pasted into the generated class.
user_should_modify_template(self)
Is the user allowed to modify the output.
__init__(self, maximum_cell_width)
maximum_cell_width
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.
get_action_set_name(self)
Return unique action set name.
get_includes(self)
Return include statements that you need.