|
|
@@ -1,19 +1,24 @@
|
|
|
class coefficients:
|
|
|
- def __init__(self, diff, conv, flux):
|
|
|
+ def __init__(self, diff, conv, flux, porder, nele):
|
|
|
self.diffusion = diff
|
|
|
self.covection = conv
|
|
|
self.flux = flux
|
|
|
+ self.porder = porder
|
|
|
+ self.nele = nele
|
|
|
|
|
|
@classmethod
|
|
|
def from_input(cls):
|
|
|
while True:
|
|
|
try:
|
|
|
- diff = float(input("Diffusion coefficient "))
|
|
|
+ print("Please provide the following coefficients.")
|
|
|
+ diff = float(input("Diffusion coefficient: "))
|
|
|
conv = float(input("Covection coefficient: "))
|
|
|
flux = float(input("Flux: "))
|
|
|
+ porder = int(input("Order of polynomials: "))
|
|
|
+ nele = int(input("Number of elements: "))
|
|
|
except ValueError:
|
|
|
print("Sorry, wrong data type.")
|
|
|
continue
|
|
|
else:
|
|
|
break
|
|
|
- return cls(diff, conv, flux)
|
|
|
+ return cls(diff, conv, flux, porder, nele)
|