96 |
""" |
""" |
97 |
initialize time stepping |
initialize time stepping |
98 |
""" |
""" |
99 |
|
tol=1.e-8 |
100 |
x=self.domain.getX() |
x=self.domain.getX() |
101 |
d=self.domain.getDim() |
d=self.domain.getDim() |
102 |
self.location_constrained_value=0 |
self.location_constrained_value=0 |
103 |
x0=x[0] |
x0=x[0] |
104 |
|
mx=sup(x0) |
105 |
|
mn=inf(x0) |
106 |
if self.left: |
if self.left: |
107 |
self.location_constrained_value=self.location_constrained_value+whereZero(x0-inf(x0)) |
self.location_constrained_value=self.location_constrained_value+whereZero(x0-mn,tol*(mx-mn)) |
108 |
if self.right: |
if self.right: |
109 |
self.location_constrained_value=self.location_constrained_value+whereZero(x0-sup(x0)) |
self.location_constrained_value=self.location_constrained_value+whereZero(x0-mx,tol*(mx-mn)) |
110 |
x0=x[d-1] |
x0=x[d-1] |
111 |
|
mx=sup(x0) |
112 |
|
mn=inf(x0) |
113 |
if self.bottom: |
if self.bottom: |
114 |
self.location_constrained_value=self.location_constrained_value+whereZero(x0-inf(x0)) |
self.location_constrained_value=self.location_constrained_value+whereZero(x0-mn,tol*(mx-mn)) |
115 |
if self.top: |
if self.top: |
116 |
self.location_constrained_value=self.location_constrained_value+whereZero(x0-sup(x0)) |
self.location_constrained_value=self.location_constrained_value+whereZero(x0-mx,tol*(mx-mn)) |
117 |
if d>2: |
if d>2: |
118 |
x0=x[1] |
x0=x[1] |
119 |
|
mx=sup(x0) |
120 |
|
mn=inf(x0) |
121 |
if self.front: |
if self.front: |
122 |
self.location_constrained_value=self.location_constrained_value+whereZero(x0-inf(x0)) |
self.location_constrained_value=self.location_constrained_value+whereZero(x0-mn,tol*(mx-mn)) |
123 |
if self.back: |
if self.back: |
124 |
self.location_constrained_value=self.location_constrained_value+whereZero(x0-sup(x0)) |
self.location_constrained_value=self.location_constrained_value+whereZero(x0-mx,tol*(mx-mn)) |
125 |
self.constrain_value=self.value*self.location_constrained_value |
self.constrain_value=self.value*self.location_constrained_value |
126 |
|
|
127 |
class ScalarConstrainer(ParameterSet): |
class ScalarConstrainer(ParameterSet): |