-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
108 lines (54 loc) · 1.56 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import base
import numpy as np
import math
import cmath
import matplotlib.pyplot as plt
import matplotlib.tri as tri
from scipy.sparse import csr_matrix
import scipy.sparse.linalg as spla
filename = "carre"
base.constru_maillage(filename,10,10,1,1)
filename = "carre"
base.convertMSHtoMESH(filename)
[Nodes, Element] = base.read(filename + ".mesh")
print(Nodes)
#####################################
# QUESTION N°1
#####################################
#filename = "maillages/maillage3.mesh"
#[Nodes, Element] = base.read(filename)
#print(Nodes)
#print(Element)
#base.PlotMesh(filename)
#####################################
# QUESTION N°2
#####################################
# DONNÉES DU PROBLÈME :
w = 5*math.pi
d = [1,0]
#"0", "1", "2", "3", "4", "5", "6", "7"
for i in []:
filename = "maillages/maillage" + i + ".mesh"
base.FiniteElementP1(filename,w,d,1)
#####################################
# QUESTION N°3
#####################################
#k = 4
#base.RelativeError(k,d)
#####################################
# QUESTION N°4
#####################################
#tab_valp = open("tab_valp.txt", 'w')
for i in [] :
filename = "maillages/maillage" + i + ".mesh"
valp, vectp = base.EigVal(filename)
for k in valp :
tab_valp.write(str(round(k,3)) + "\t")
tab_valp.write("\n")
print(valp)
#####################################
# QUESTION N°5
#####################################
for i in [] :
filename = "maillages/maillage" + i + ".mesh"
base.GenEigVal(filename)