Skip to content

Commit 028477c

Browse files
committed
renamed from diffusion to poisson, several first changes in files
1 parent 3aded1f commit 028477c

File tree

8 files changed

+549
-170
lines changed

8 files changed

+549
-170
lines changed

examples/Diffusion/diffusion_example.py

Whitespace-only changes.

examples/Diffusion/options.py

Lines changed: 0 additions & 170 deletions
This file was deleted.

examples/Poisson/options.py

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
gismo_options = [
2+
{
3+
'tag': 'Function',
4+
'attributes': {'type': 'FunctionExpr', 'id': '1', 'dim': '2'},
5+
'text': '2*pi^2*sin(pi*x)*sin(pi*y)',
6+
'children': []
7+
},
8+
{'tag': 'boundaryConditions',
9+
'attributes': {'id': '2', 'multipatch': '0'},
10+
'text': '\n ',
11+
'children': [
12+
{
13+
'tag': 'Function',
14+
'attributes': {
15+
'type': 'FunctionExpr',
16+
'dim': '2',
17+
'index': '0'},
18+
'text': 'sin(pi*x) * sin(pi*y)', 'children': []
19+
},
20+
{
21+
'tag': 'Function',
22+
'attributes': {
23+
'type': 'FunctionExpr',
24+
'dim': '2',
25+
'index': '1',
26+
'c': '2'
27+
},
28+
'text': '\n ',
29+
'children': [
30+
{
31+
'tag': 'c',
32+
'attributes': {'index': '0'},
33+
'text': 'pi*cos(pi*x) * sin(pi*y)',
34+
'children': []
35+
},
36+
{
37+
'tag': 'c',
38+
'attributes': {'index': '1'},
39+
'text': 'pi*sin(pi*x) * cos(pi*y)',
40+
'children': []
41+
}
42+
]
43+
},
44+
{
45+
'tag': 'Function',
46+
'attributes': {
47+
'type': 'FunctionExpr',
48+
'dim': '2',
49+
'index': '2'
50+
},
51+
'text': '0',
52+
'children': []
53+
},
54+
{
55+
'tag': 'bc',
56+
'attributes': {
57+
'type': 'Dirichlet',
58+
'function': '0',
59+
'unknown': '0',
60+
'name': 'dirichlet'
61+
},
62+
'text': '\n ',
63+
'children': []
64+
},
65+
{'tag': 'bc',
66+
'attributes': {
67+
'unknown': '0',
68+
'type': 'Neumann',
69+
'function': '1',
70+
'name': 'neumann'
71+
},
72+
'text': '\n ',
73+
'children': []
74+
}
75+
]
76+
},
77+
{'tag': 'Function',
78+
'attributes': {'type': 'FunctionExpr', 'id': '3', 'dim': '2'},
79+
'text': 'sin(pi*x) * sin(pi*y)', 'children': []
80+
},
81+
{
82+
'tag': 'OptionList',
83+
'attributes': {'id': '4'},
84+
'text': '\n ',
85+
'children': [
86+
{
87+
'tag': 'int',
88+
'attributes':
89+
{'label': 'DirichletStrategy',
90+
'desc': 'Method for enforcement of Dirichlet BCs [11..14]',
91+
'value': '11'},
92+
'text': None,
93+
'children': []
94+
},
95+
{
96+
'tag': 'int',
97+
'attributes': {
98+
'label': 'DirichletValues',
99+
'desc': 'Method for computation of Dirichlet DoF values [100..103]',
100+
'value': '101'
101+
},
102+
'text': None,
103+
'children': []
104+
},
105+
{
106+
'tag': 'int',
107+
'attributes': {
108+
'label': 'InterfaceStrategy',
109+
'desc': 'Method of treatment of patch interfaces [0..3]',
110+
'value': '1'
111+
},
112+
'text': None,
113+
'children': []
114+
},
115+
{'tag': 'real',
116+
'attributes': {
117+
'label': 'bdA',
118+
'desc': 'Estimated nonzeros per column of the matrix: bdA*deg + bdB',
119+
'value': '2'
120+
},
121+
'text': None,
122+
'children': []
123+
},
124+
{'tag': 'int',
125+
'attributes': {
126+
'label': 'bdB',
127+
'desc': 'Estimated nonzeros per column of the matrix: bdA*deg + bdB',
128+
'value': '1'
129+
},
130+
'text': None,
131+
'children': []
132+
},
133+
{
134+
'tag': 'real',
135+
'attributes': {
136+
'label': 'bdO',
137+
'desc': 'Overhead of sparse mem. allocation: (1+bdO)(bdA*deg + bdB) [0..1]',
138+
'value': '0.333'},
139+
'text': None,
140+
'children': []
141+
},
142+
{'tag': 'real',
143+
'attributes': {
144+
'label': 'quA',
145+
'desc': 'Number of quadrature points: quA*deg + quB',
146+
'value': '1'
147+
},
148+
'text': None,
149+
'children': []
150+
},
151+
{'tag': 'int',
152+
'attributes': {
153+
'label': 'quB',
154+
'desc': 'Number of quadrature points: quA*deg + quB',
155+
'value': '1'
156+
},
157+
'text': None,
158+
'children': []
159+
},
160+
{
161+
'tag': 'int',
162+
'attributes': {
163+
'label': 'quRule',
164+
'desc': 'Quadrature rule [1:GaussLegendre,2:GaussLobatto]',
165+
'value': '1'},
166+
'text': None, 'children': []
167+
}
168+
]
169+
}
170+
]
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import splinepy as sp
2+
from options import gismo_options
3+
import pygadjoints
4+
5+
geometry = sp.BSpline(
6+
degrees=[2, 2],
7+
control_points=[
8+
[0.0, 0.0],
9+
[1.0, 0.5],
10+
[2.0, 0.2],
11+
[0.5, 1.5],
12+
[1.0, 1.5],
13+
[1.5, 1.5],
14+
[0.0, 3.0],
15+
[1.0, 2.5],
16+
[2.0, 3.0],
17+
],
18+
knot_vectors=[[0, 0, 0, 1, 1, 1], [0, 0, 0, 1, 1, 1]],
19+
)
20+
21+
22+
23+
def main():
24+
# Set the number of available threads (will be passed to splinepy and
25+
# pygdjoints)
26+
sp.io.gismo.export(fname="poisson",
27+
multipatch=geometry,
28+
options=gismo_options,
29+
export_fields=True,
30+
as_base64=True,
31+
)
32+
n_threads = 12
33+
34+
linear_solver = pygadjoints.PoissonProblem()
35+
linear_solver.set_number_of_threads(n_threads)
36+
linear_solver.assemble()
37+
linear_solver.solve_linear_system()
38+
linear_solver.export_paraview("solution", False, 100, True)
39+
40+
exit()
41+
42+
43+
if "__main__" == __name__:
44+
main()

src/pygadjoints/py_diffusion.cpp

Whitespace-only changes.

src/pygadjoints/py_diffusion.hpp

Whitespace-only changes.

0 commit comments

Comments
 (0)