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
3
from
.PatchToDoubleArray
import
PatchToDoubleArray
4
from
.DoF
import
DoF
5
6
7
class
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)
24
self.
readme_descriptor
=
"""
25
### Datamodel for """
+ name + str(self)
26
27
28
def
__str__
(self):
29
return
"""
30
Dim: """
+ str(self.
dim
) +
"""
31
Unknowns: """
+ str(self.
no_of_unknowns
) +
"""
32
Generator: """
+ str(self.
generator
) +
"""
33
"""
34
35
36
@property
37
def
additional_load_and_store_arguments
(self):
38
return
self.
_additional_load_and_store_arguments
_additional_load_and_store_arguments
39
40
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
"""
47
self.
_additional_load_and_store_arguments
_additional_load_and_store_arguments
= new_arguments
48
49
peano4.datamodel.DoF.DoF
Definition
DoF.py:56
peano4.datamodel.DoF.DoF._additional_load_and_store_arguments
_additional_load_and_store_arguments
Definition
DoF.py:96
peano4.datamodel.PatchToDoubleArray.PatchToDoubleArray
Very simple converter which maps the patch 1:1 onto a double array.
Definition
PatchToDoubleArray.py:42
peano4.datamodel.Patch.Patch
Definition
Patch.py:7
peano4.datamodel.Patch.Patch.dim
dim
Definition
Patch.py:21
peano4.datamodel.Patch.Patch.__init__
__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
peano4.datamodel.Patch.Patch.generator
generator
Definition
Patch.py:23
peano4.datamodel.Patch.Patch.readme_descriptor
readme_descriptor
Definition
Patch.py:24
peano4.datamodel.Patch.Patch.additional_load_and_store_arguments
additional_load_and_store_arguments(self)
Definition
Patch.py:37
peano4.datamodel.Patch.Patch.no_of_unknowns
no_of_unknowns
Definition
Patch.py:22
peano4.datamodel.Patch.Patch.__str__
__str__(self)
Definition
Patch.py:28
peano4.datamodel.Patch.Patch._additional_load_and_store_arguments
_additional_load_and_store_arguments
Definition
Patch.py:47
python
peano4
datamodel
Patch.py
Generated on Tue Mar 18 2025 20:03:07 for Peano by
1.10.0