39 |
import math |
import math |
40 |
import escript |
import escript |
41 |
import util |
import util |
42 |
import numarray |
import numpy |
43 |
|
|
44 |
__author__="Lutz Gross, l.gross@uq.edu.au" |
__author__="Lutz Gross, l.gross@uq.edu.au" |
45 |
|
|
1393 |
elif hasattr(d,"getShape"): |
elif hasattr(d,"getShape"): |
1394 |
s=d.getShape() |
s=d.getShape() |
1395 |
else: |
else: |
1396 |
s=numarray.array(d).shape |
s=numpy.array(d).shape |
1397 |
if s!=None: |
if s!=None: |
1398 |
# get number of equations and number of unknowns: |
# get number of equations and number of unknowns: |
1399 |
res=self.__COEFFICIENTS[i].estimateNumEquationsAndNumSolutions(self.getDomain(),s) |
res=self.__COEFFICIENTS[i].estimateNumEquationsAndNumSolutions(self.getDomain(),s) |
1786 |
d_reduced=self.getCoefficient("d_reduced") |
d_reduced=self.getCoefficient("d_reduced") |
1787 |
if not D.isEmpty(): |
if not D.isEmpty(): |
1788 |
if self.getNumSolutions()>1: |
if self.getNumSolutions()>1: |
1789 |
D_times_e=util.matrix_mult(D,numarray.ones((self.getNumSolutions(),))) |
D_times_e=util.matrix_mult(D,numpy.ones((self.getNumSolutions(),))) |
1790 |
else: |
else: |
1791 |
D_times_e=D |
D_times_e=D |
1792 |
else: |
else: |
1793 |
D_times_e=escript.Data() |
D_times_e=escript.Data() |
1794 |
if not d.isEmpty(): |
if not d.isEmpty(): |
1795 |
if self.getNumSolutions()>1: |
if self.getNumSolutions()>1: |
1796 |
d_times_e=util.matrix_mult(d,numarray.ones((self.getNumSolutions(),))) |
d_times_e=util.matrix_mult(d,numpy.ones((self.getNumSolutions(),))) |
1797 |
else: |
else: |
1798 |
d_times_e=d |
d_times_e=d |
1799 |
else: |
else: |
1801 |
|
|
1802 |
if not D_reduced.isEmpty(): |
if not D_reduced.isEmpty(): |
1803 |
if self.getNumSolutions()>1: |
if self.getNumSolutions()>1: |
1804 |
D_reduced_times_e=util.matrix_mult(D_reduced,numarray.ones((self.getNumSolutions(),))) |
D_reduced_times_e=util.matrix_mult(D_reduced,numpy.ones((self.getNumSolutions(),))) |
1805 |
else: |
else: |
1806 |
D_reduced_times_e=D_reduced |
D_reduced_times_e=D_reduced |
1807 |
else: |
else: |
1808 |
D_reduced_times_e=escript.Data() |
D_reduced_times_e=escript.Data() |
1809 |
if not d_reduced.isEmpty(): |
if not d_reduced.isEmpty(): |
1810 |
if self.getNumSolutions()>1: |
if self.getNumSolutions()>1: |
1811 |
d_reduced_times_e=util.matrix_mult(d_reduced,numarray.ones((self.getNumSolutions(),))) |
d_reduced_times_e=util.matrix_mult(d_reduced,numpy.ones((self.getNumSolutions(),))) |
1812 |
else: |
else: |
1813 |
d_reduced_times_e=d_reduced |
d_reduced_times_e=d_reduced |
1814 |
else: |
else: |
2240 |
""" |
""" |
2241 |
if name == "A" : |
if name == "A" : |
2242 |
if self.getCoefficient("k").isEmpty(): |
if self.getCoefficient("k").isEmpty(): |
2243 |
return escript.Data(numarray.identity(self.getDim()),escript.Function(self.getDomain())) |
return escript.Data(numpy.identity(self.getDim()),escript.Function(self.getDomain())) |
2244 |
else: |
else: |
2245 |
return escript.Data(numarray.identity(self.getDim()),escript.Function(self.getDomain()))*self.getCoefficient("k") |
return escript.Data(numpy.identity(self.getDim()),escript.Function(self.getDomain()))*self.getCoefficient("k") |
2246 |
elif name == "D" : |
elif name == "D" : |
2247 |
return self.getCoefficient("omega") |
return self.getCoefficient("omega") |
2248 |
elif name == "Y" : |
elif name == "Y" : |