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 """!
9
10 Patch implementation of a degree of freedom
11
12 Please study the superclass for details.
13
14 @image html dof-class-diagram.png
15
16 """
17
18
19 readme_package_descriptor = """
20"""
21
22
23 def __init__(self, dim, no_of_unknowns, name, float_type="double"):
24 """
25 dim should be a two-tuple or a three-tuple of integers, so a construction
26 could look like
27
28 cell_data = peano4.datamodel.Patch( (6,6,6), "Fluid" )
29
30 """
31 super(Patch, self).__init__(name)
32 self.dim = dim
33 self.no_of_unknowns = no_of_unknowns
34 self.generator = PatchToDoubleArray(self, float_type)
36### Datamodel for """ + name + str(self)
37
38
39 def __str__(self):
40 return """
41Dim: """ + str(self.dim) + """
42Unknowns: """ + str(self.no_of_unknowns) + """
43Generator: """ + str(self.generator) + """
44"""
45
46
47 @property
52 @additional_load_and_store_arguments.setter
53 def additional_load_and_store_arguments(self,new_arguments):
54 for new_argument in new_arguments:
55 self.generator.includes += """
56#include \"""" + new_argument[1].replace("::","/") + """.h"
57"""
59
60
61 # @todo Does this routine hold an MPIAndStorageAspect instance? Would be reasonable. So why do then generators have a load_store_compute_flag
62 # Dann auch @ref tutorials_peano4_mask_out_data_usage Referenzieren!
63
Base class for any degree of freedom object.
Definition DoF.py:56
Very simple converter which maps the patch 1:1 onto a double array.
Patch implementation of a degree of freedom.
Definition Patch.py:7
__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:23
additional_load_and_store_arguments(self)
Definition Patch.py:48