Peano
Loading...
Searching...
No Matches
Patch.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 .PatchToDoubleArray import PatchToDoubleArray
4from .DoF import DoF
5
6
7class Patch(DoF):
8 readme_package_descriptor = """
9"""
10
11
12 def __init__(self, dim, no_of_unknowns, name, float_type="double"):
13 """
14 dim should be a two-tuple or a three-tuple of integers, so a construction
15 could look like
16
17 cell_data = peano4.datamodel.Patch( (6,6,6), "Fluid" )
18
19 """
20 super(Patch, self).__init__(name)
21 self.dim = dim
22 self.no_of_unknowns = no_of_unknowns
23 self.generator = PatchToDoubleArray(self, float_type)
25### Datamodel for """ + name + str(self)
26
27
28 def __str__(self):
29 return """
30Dim: """ + str(self.dim) + """
31Unknowns: """ + str(self.no_of_unknowns) + """
32Generator: """ + str(self.generator) + """
33"""
34
35
36 @property
41 @additional_load_and_store_arguments.setter
42 def additional_load_and_store_arguments(self,new_arguments):
43 for new_argument in new_arguments:
44 self.generator.includes += """
45#include \"""" + new_argument[1].replace("::","/") + """.h"
46"""
48
49
_additional_load_and_store_arguments
Definition DoF.py:96
Very simple converter which maps the patch 1:1 onto a double array.
__init__(self, dim, no_of_unknowns, name, float_type="double")
dim should be a two-tuple or a three-tuple of integers, so a construction could look like
Definition Patch.py:12
additional_load_and_store_arguments(self)
Definition Patch.py:37