/[escript]/trunk/modellib/py_src/crustal/setups.py
ViewVC logotype

Diff of /trunk/modellib/py_src/crustal/setups.py

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

revision 1000 by gross, Wed Feb 28 00:34:42 2007 UTC revision 1044 by gross, Mon Mar 19 07:29:31 2007 UTC
# Line 64  class DensityChange(Model): Line 64  class DensityChange(Model):
64    
65      @ivar domain: mining region      @ivar domain: mining region
66      @type domain: L{Domian}      @type domain: L{Domian}
     @ivar tag_map: a tagmap  
     @type tag_map: L{TagMap}  
67      @ivar mass_rate: rate of change mass in a tagged region      @ivar mass_rate: rate of change mass in a tagged region
68      @type mass_rate: C{dict}      @type mass_rate: C{dict}
69      @ivar density_rate: density in each region      @ivar density_rate: density in each region
# Line 76  class DensityChange(Model): Line 74  class DensityChange(Model):
74          """          """
75          super(DensityChange,self).__init__(**kwargs)          super(DensityChange,self).__init__(**kwargs)
76          self.declareParameter(domain=None,          self.declareParameter(domain=None,
                               tag_map=None,  
77                                mass_rate={},                                mass_rate={},
78                                density_rate=None)                                density_rate=None)
79    
# Line 85  class DensityChange(Model): Line 82  class DensityChange(Model):
82          initialize time integration          initialize time integration
83          """          """
84          self.__volumes={}          self.__volumes={}
85          for i in self.tag_map.getNames():          for i in getTagNames(self.domain):
86              c=Scalar(0.,Function(self.domain))              c=integrate(insertTaggedValues(Function(self.domain),**{i : 1.}))
             self.tag_map.insert(c,**{i : 1.})  
             c=integrate(c)  
87              if c>0: self.__volumes[i] = c              if c>0: self.__volumes[i] = c
88    
89      def doStepPreprocessing(self, dt):      def doStepPreprocessing(self, dt):
          self.density_rate=Scalar(0.,Function(self.domain))  
90           d={}           d={}
91           for i in self.__volumes:           for i in self.__volumes:
92              if self.mass_rate.has_key(i): d[i]=-self.mass_rate[i]/self.__volumes[i]              if self.mass_rate.has_key(i): d[i]=-self.mass_rate[i]/self.__volumes[i]
93           self.tag_map.insert(self.density_rate,**d)           self.density_rate=inserTaggedValues(Scalar(0.,Function(self.domain)),**d)
94    
95  class LinearElasticStressChange(Model):  class LinearElasticStressChange(Model):
96      """      """
# Line 109  class LinearElasticStressChange(Model): Line 103  class LinearElasticStressChange(Model):
103    
104      @ivar domain: mining region      @ivar domain: mining region
105      @type domain: L{Domian}      @type domain: L{Domian}
     @ivar tag_map: a tagmap  
     @type tag_map: L{TagMap}  
106      @ivar displacement: displacement field      @ivar displacement: displacement field
107      @type displacement: L{Vector} or C{None}      @type displacement: L{Vector} or C{None}
108      @ivar stress: displacement field      @ivar stress: displacement field
# Line 131  class LinearElasticStressChange(Model): Line 123  class LinearElasticStressChange(Model):
123          """          """
124          super(LinearElasticStressChange,self).__init__(**kwargs)          super(LinearElasticStressChange,self).__init__(**kwargs)
125          self.declareParameter(domain=None,          self.declareParameter(domain=None,
                               tag_map=None,  
126                                displacement=None, \                                displacement=None, \
127                                stress=None, \                                stress=None, \
128                                density=1., \                                density=1., \
# Line 212  class CoulombFailureStress(ParameterSet) Line 203  class CoulombFailureStress(ParameterSet)
203    
204      @ivar domain: mining region      @ivar domain: mining region
205      @type domain: L{Domian}      @type domain: L{Domian}
     @ivar tag_map: a tagmap  
     @type tag_map: L{TagMap}  
206      @ivar displacement: displacement field      @ivar displacement: displacement field
207      @type displacement: L{Vector} or C{None}      @type displacement: L{Vector} or C{None}
208      @ivar stress: displacement field      @ivar stress: displacement field

Legend:
Removed from v.1000  
changed lines
  Added in v.1044

  ViewVC Help
Powered by ViewVC 1.1.26