38 |
""" |
""" |
39 |
self.__x=self.domain.getX() |
self.__x=self.domain.getX() |
40 |
if self.displacement: |
if self.displacement: |
41 |
|
self.trace("mesh nodes updated in initialization.") |
42 |
self.domain.setX(self.__x+self.displacement) |
self.domain.setX(self.__x+self.displacement) |
43 |
|
|
44 |
def doStepPreprocessing(self,dt): |
def doStepPreprocessing(self,dt): |
45 |
""" |
""" |
46 |
applies the final L{displacement} to mesh nodes. |
applies the final L{displacement} to mesh nodes. |
47 |
""" |
""" |
48 |
self.__updated=False |
self.__do_final_update=True |
49 |
|
|
50 |
def doStep(self,dt): |
def doStep(self,dt): |
51 |
""" |
""" |
52 |
applies the current L{displacement} to mesh nodes. |
applies the current L{displacement} to mesh nodes. |
53 |
""" |
""" |
54 |
if self.displacement: |
if self.displacement: |
55 |
|
self.trace("mesh nodes updated in update.") |
56 |
self.domain.setX(self.__x+self.displacement) |
self.domain.setX(self.__x+self.displacement) |
57 |
self.__update=False |
self.__do_final_update=False |
58 |
|
|
59 |
def doStepPostprocessing(self,dt): |
def doStepPostprocessing(self,dt): |
60 |
""" |
""" |
61 |
applies the final L{displacement} to mesh nodes. |
applies the final L{displacement} to mesh nodes. |
62 |
""" |
""" |
63 |
if self.displacement: |
if self.displacement and self.__do_final_update: |
64 |
|
self.trace("final mesh nodes update.") |
65 |
self.domain.setX(self.__x+self.displacement) |
self.domain.setX(self.__x+self.displacement) |
66 |
self.__update=False |
self.__update=False |
67 |
|
|
167 |
tol=1.e-8, \ |
tol=1.e-8, \ |
168 |
value_of_constraint = None, \ |
value_of_constraint = None, \ |
169 |
location_of_constraint=None) |
location_of_constraint=None) |
|
self.location_of_constraint=None |
|
|
|
|
170 |
def doInitialization(self): |
def doInitialization(self): |
171 |
""" |
""" |
172 |
Returns the mask of the location of constraint. |
Returns the mask of the location of constraint. |
216 |
def __init__(self,debug=False): |
def __init__(self,debug=False): |
217 |
ParameterSet.__init__(self,debug=debug) |
ParameterSet.__init__(self,debug=debug) |
218 |
self.declareParameter(domain=None, \ |
self.declareParameter(domain=None, \ |
219 |
value=0, \ |
value=[0,0,0], \ |
220 |
left=[0,0,0], \ |
left=[0,0,0], \ |
221 |
right=[0,0,0], \ |
right=[0,0,0], \ |
222 |
top=[0,0,0], \ |
top=[0,0,0], \ |
223 |
bottom=[0,0,0], \ |
bottom=[0,0,0], \ |
224 |
front=[0,0,0], \ |
front=[0,0,0], \ |
225 |
ack=[0,0,0], \ |
back=[0,0,0], \ |
226 |
tol=1.e-8, \ |
tol=1.e-8, \ |
227 |
value_of_constraint = None, \ |
value_of_constraint = None, \ |
228 |
location_of_constraint=None) |
location_of_constraint=None) |
|
self.location_of_constraint=None |
|
229 |
def doInitialization(self): |
def doInitialization(self): |
230 |
""" |
""" |
231 |
sets the location_of_constraint and value_of_constraint to be kept throughout the simulation. |
sets the location_of_constraint and value_of_constraint to be kept throughout the simulation. |
259 |
if self.top[0]: self.location_of_constraint+=top_mask*[1.,0.,0.] |
if self.top[0]: self.location_of_constraint+=top_mask*[1.,0.,0.] |
260 |
if self.top[1]: self.location_of_constraint+=top_mask*[0.,1.,0.] |
if self.top[1]: self.location_of_constraint+=top_mask*[0.,1.,0.] |
261 |
if self.top[2]: self.location_of_constraint+=top_mask*[0.,0.,1.] |
if self.top[2]: self.location_of_constraint+=top_mask*[0.,0.,1.] |
262 |
|
self.value_of_constraint=self.location_of_constraint*self.value |
263 |
else: |
else: |
264 |
x0,x1=x[0],x[1] |
x0,x1=x[0],x[1] |
265 |
left_mask=whereZero(x0-inf(x0),self.tol) |
left_mask=whereZero(x0-inf(x0),self.tol) |
274 |
top_mask=whereZero(x1-sup(x1),self.tol) |
top_mask=whereZero(x1-sup(x1),self.tol) |
275 |
if self.top[0]: self.location_of_constraint+=top_mask*[1.,0.] |
if self.top[0]: self.location_of_constraint+=top_mask*[1.,0.] |
276 |
if self.top[1]: self.location_of_constraint+=top_mask*[0.,1.] |
if self.top[1]: self.location_of_constraint+=top_mask*[0.,1.] |
277 |
self.value_of_constraint=self.location_of_constraint*self.value |
self.value_of_constraint=self.location_of_constraint*self.value[:2] |
278 |
|
|
279 |
# vim: expandtab shiftwidth=4: |
# vim: expandtab shiftwidth=4: |