2250 |
""" |
""" |
2251 |
Class to define PDE equation of the unisotropic advection-diffusion problem, which is genear L{LinearPDE} of the form |
Class to define PDE equation of the unisotropic advection-diffusion problem, which is genear L{LinearPDE} of the form |
2252 |
|
|
2253 |
M{S{omega}*u + inner(v,grad(u))- grad(matrixmult(k,grad(u))[j])[j] = f} |
M{S{omega}*u + inner(v,grad(u))- grad(matrixmult(k_bar,grad(u))[j])[j] = f} |
2254 |
|
|
2255 |
with natural boundary conditons |
with natural boundary conditons |
2256 |
|
|
2260 |
|
|
2261 |
M{u=r} where M{q>0} |
M{u=r} where M{q>0} |
2262 |
|
|
2263 |
@remark: no upwinding is applied yet. |
and |
2264 |
|
|
2265 |
|
M{k_bar[i,j]=k[i,j]+upwind[i]*upwind[j]} |
2266 |
|
|
2267 |
""" |
""" |
2268 |
|
|
2280 |
"k": PDECoefficient(PDECoefficient.INTERIOR,(PDECoefficient.BY_DIM,PDECoefficient.BY_DIM),PDECoefficient.OPERATOR), |
"k": PDECoefficient(PDECoefficient.INTERIOR,(PDECoefficient.BY_DIM,PDECoefficient.BY_DIM),PDECoefficient.OPERATOR), |
2281 |
"f": PDECoefficient(PDECoefficient.INTERIOR,(PDECoefficient.BY_EQUATION,),PDECoefficient.RIGHTHANDSIDE), |
"f": PDECoefficient(PDECoefficient.INTERIOR,(PDECoefficient.BY_EQUATION,),PDECoefficient.RIGHTHANDSIDE), |
2282 |
"v": PDECoefficient(PDECoefficient.INTERIOR,(PDECoefficient.BY_DIM,),PDECoefficient.OPERATOR), |
"v": PDECoefficient(PDECoefficient.INTERIOR,(PDECoefficient.BY_DIM,),PDECoefficient.OPERATOR), |
2283 |
|
"upwind": PDECoefficient(PDECoefficient.INTERIOR,(PDECoefficient.BY_DIM,),PDECoefficient.OPERATOR), |
2284 |
"alpha": PDECoefficient(PDECoefficient.BOUNDARY,(PDECoefficient.BY_EQUATION,),PDECoefficient.OPERATOR), |
"alpha": PDECoefficient(PDECoefficient.BOUNDARY,(PDECoefficient.BY_EQUATION,),PDECoefficient.OPERATOR), |
2285 |
"g": PDECoefficient(PDECoefficient.BOUNDARY,(PDECoefficient.BY_EQUATION,),PDECoefficient.RIGHTHANDSIDE), |
"g": PDECoefficient(PDECoefficient.BOUNDARY,(PDECoefficient.BY_EQUATION,),PDECoefficient.RIGHTHANDSIDE), |
2286 |
"r": PDECoefficient(PDECoefficient.SOLUTION,(PDECoefficient.BY_EQUATION,),PDECoefficient.BOTH), |
"r": PDECoefficient(PDECoefficient.SOLUTION,(PDECoefficient.BY_EQUATION,),PDECoefficient.BOTH), |
2297 |
@type k: any type that can be casted to L{Tensor<escript.Tensor>} object on L{Function<escript.Function>}. |
@type k: any type that can be casted to L{Tensor<escript.Tensor>} object on L{Function<escript.Function>}. |
2298 |
@keyword v: value for coefficient M{v} |
@keyword v: value for coefficient M{v} |
2299 |
@type v: any type that can be casted to L{Vector<escript.Vector>} object on L{Function<escript.Function>}. |
@type v: any type that can be casted to L{Vector<escript.Vector>} object on L{Function<escript.Function>}. |
2300 |
|
@keyword upwind: value for upwind term M{upwind} |
2301 |
|
@type upwind: any type that can be casted to L{Vector<escript.Vector>} object on L{Function<escript.Function>}. |
2302 |
@keyword f: value for right hand side M{f} |
@keyword f: value for right hand side M{f} |
2303 |
@type f: any type that can be casted to L{Scalar<escript.Scalar>} object on L{Function<escript.Function>}. |
@type f: any type that can be casted to L{Scalar<escript.Scalar>} object on L{Function<escript.Function>}. |
2304 |
@keyword alpha: value for right hand side M{S{alpha}} |
@keyword alpha: value for right hand side M{S{alpha}} |
2328 |
@note: This method is called by the assembling routine to map the Possion equation onto the general PDE. |
@note: This method is called by the assembling routine to map the Possion equation onto the general PDE. |
2329 |
""" |
""" |
2330 |
if name == "A" : |
if name == "A" : |
2331 |
return escript.Data(numarray.identity(self.getDim()),escript.Function(self.getDomain()))*self.getCoefficient("k") |
return self.getCoefficient("k")+outer(self.getCoefficient("upwind"),self.getCoefficient("upwind")) |
2332 |
elif name == "B" : |
elif name == "B" : |
2333 |
return escript.Data() |
return escript.Data() |
2334 |
elif name == "C" : |
elif name == "C" : |