/[escript]/trunk/modellib/py_src/geometry.py
ViewVC logotype

Diff of /trunk/modellib/py_src/geometry.py

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

revision 400 by gross, Wed Dec 21 07:52:54 2005 UTC revision 401 by gross, Thu Dec 22 06:39:36 2005 UTC
# Line 73  class RectangularDomain(ParameterSet): Line 73  class RectangularDomain(ParameterSet):
73    
74            return self._domain            return self._domain
75    
76    class ConstrainValue(Model):
77           """
78           selects values for a given distribution to be used as a constrain. the location of the
79           constrain are he faces of a rectangular domain. This Model is typically used in
80           time dependend problems to fix the values in a given initial condition.
81           """
82           def __init__(self,debug=False):
83               Model.__init__(self,debug=debug)
84               self.declareParameter(domain=None, \
85                                     value=0,  \
86                                     top=True,  \
87                                     bottom=True,\
88                                     front=False, \
89                                     back=False,\
90                                     left=False,\
91                                     right=False,\
92                                     constrain_value = None,  \
93                                     location_constrained_value=None)
94           def doInitialization(self):
95               """
96               initialize time stepping
97               """
98               x=self.domain.getX()
99               d=self.domain.getDim()
100               self.location_constrained_value=0
101               x0=x[0]
102               if self.left:
103                   self.location_constrained_value=self.location_constrained_value+whereZero(x0-inf(x0))
104               if self.right:
105                   self.location_constrained_value=self.location_constrained_value+whereZero(x0-sup(x0))
106               x0=x[d-1]
107               if self.buttom:
108                   self.location_constrained_value=self.location_constrained_value+whereZero(x0-inf(x0))
109               if self.top:
110                   self.location_constrained_value=self.location_constrained_value+whereZero(x0-sup(x0))
111               if d>2:
112                  x0=x[1]
113                  if self.front:
114                     self.location_constrained_value=self.location_constrained_value+whereZero(x0-inf(x0))
115                  if self.back:
116                     self.location_constrained_value=self.location_constrained_value+whereZero(x0-sup(x0))          
117               self.constrain_value=self.value*self.location_constrained_value
118              
119  class ScalarConstrainer(ParameterSet):  class ScalarConstrainer(ParameterSet):
120       """       """
121       Creates a characteristic function for the location of constraints       Creates a characteristic function for the location of constraints

Legend:
Removed from v.400  
changed lines
  Added in v.401

  ViewVC Help
Powered by ViewVC 1.1.26