/[escript]/trunk/escript/py_src/linearPDEs.py
ViewVC logotype

Diff of /trunk/escript/py_src/linearPDEs.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 345 by gross, Tue Dec 13 05:23:45 2005 UTC revision 348 by gross, Tue Dec 13 07:33:10 2005 UTC
# Line 2250  class AdvectionDiffusion(LinearPDE): Line 2250  class AdvectionDiffusion(LinearPDE):
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    
# Line 2260  class AdvectionDiffusion(LinearPDE): Line 2260  class AdvectionDiffusion(LinearPDE):
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    
# Line 2278  class AdvectionDiffusion(LinearPDE): Line 2280  class AdvectionDiffusion(LinearPDE):
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),
# Line 2294  class AdvectionDiffusion(LinearPDE): Line 2297  class AdvectionDiffusion(LinearPDE):
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}}
# Line 2323  class AdvectionDiffusion(LinearPDE): Line 2328  class AdvectionDiffusion(LinearPDE):
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" :

Legend:
Removed from v.345  
changed lines
  Added in v.348

  ViewVC Help
Powered by ViewVC 1.1.26