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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1388 - (show annotations)
Fri Jan 11 07:45:58 2008 UTC (11 years, 10 months ago) by trankine
File MIME type: text/x-python
File size: 28439 byte(s)
And get the *(&(*&(* name right
1 #
2 # $Id$
3 #
4 #######################################################
5 #
6 # Copyright 2003-2007 by ACceSS MNRF
7 # Copyright 2007 by University of Queensland
8 #
9 # http://esscc.uq.edu.au
10 # Primary Business: Queensland, Australia
11 # Licensed under the Open Software License version 3.0
12 # http://www.opensource.org/licenses/osl-3.0.php
13 #
14 #######################################################
15 #
16
17
18 __copyright__=""" Copyright (c) 2006 by ACcESS MNRF
19 http://www.access.edu.au
20 Primary Business: Queensland, Australia"""
21 __license__="""Licensed under the Open Software License version 3.0
22 http://www.opensource.org/licenses/osl-3.0.php"""
23
24
25 from esys.escript import *
26 from esys.escript.modelframe import Model,ParameterSet
27 from esys import finley
28
29 class FinleyReader(ParameterSet):
30 """
31 reads finley mesh file.
32
33 @ivar source: mesh file in finley or gmsh format
34 @type source: C{DataSource}
35 @ivar intergrationOrder: integration order, default -1 (in).
36 @type intergrationOrder: C{int}
37 @ivar reducedIntegrationOrder: reduced integration order, default -1 (in).
38 @type reducedIntegrationOrder: C{int}
39 @ivar optimizeLabeling: switches on optimization of the labeling of the nodes
40 @type optimizeLabeling: C{bool}
41 """
42 def __init__(self,**kwargs):
43 """
44 initializes the object
45 """
46 super(FinleyReader,self).__init__(**kwargs)
47 self.declareParameter(source="none",
48 dim=None,
49 optimizeLabeling=True,
50 reducedIntegrationOrder=-1,
51 integrationOrder=-1)
52 self.__domain=None
53
54
55 def domain(self):
56 """
57 returns the domain
58
59 @return: the domain
60 @rtype: L{Domain}
61 """
62 if self.__domain == None:
63 if self.source.fileformat == "fly":
64 self.__domain=finley.ReadMesh(self.source.getLocalFileName(),self.integrationOrder)
65 elif self.source.fileformat == "gmsh":
66 if self.dim==None:
67 dim=3
68 else:
69 dim=self.dim
70 self.__domain=finley.ReadGmsh(self.source.getLocalFileName(),dim,self.integrationOrder,self.reducedIntegrationOrder, self.optimizeLabeling)
71 else:
72 raise TypeError("unknown mesh file format %s."%self.source.fileformat)
73 self.trace("mesh read from %s in %s format."%(self.source.getLocalFileName(), self.source.fileformat))
74 return self.__domain
75 class RectangularDomain(ParameterSet):
76 """
77 Generates a mesh over a rectangular domain finley.
78
79 @ivar dim: spatial dimension, default =2 (in).
80 @type dim: spatial dimension
81 @ivar l: spatial lengths, default [1.,1.,1.] (in).
82 @type l: C{list} of C{floats}s
83 @ivar n: number of elements, default [10,10,10] (in).
84 @type n: C{list} of C{int}s
85 @ivar order: element order, default 1 (in).
86 @type order: C{int}
87 @ivar periodic: flags for periodicity, default [False,False,False] (in).
88 @type periodic: C{list} of C{bool}s
89 @ivar intergrationOrder: integration order, default -1 (in).
90 @type intergrationOrder: C{int}
91 """
92 def __init__(self,**kwargs):
93 """
94 initializes the object
95 """
96 super(RectangularDomain,self).__init__(**kwargs)
97 self.declareParameter(dim=2,\
98 l=[1.,1.,1.],\
99 n=[10,10,10], \
100 order=1,\
101 periodic=[False,False,False],
102 integrationOrder=-1)
103 self.__domain=None
104
105 def domain(self):
106 """
107 returns the domain
108
109 @return: the domain
110 @rtype: L{Domain}
111 """
112 if self.__domain==None:
113 if self.dim==2:
114 self.__domain=finley.Rectangle(n0=self.n[0],\
115 n1=self.n[2],\
116 l0=self.l[0],\
117 l1=self.l[2],\
118 order=self.order, \
119 periodic0=self.periodic[0], \
120 periodic1=self.periodic[2], \
121 integrationOrder=self.integrationOrder)
122 else:
123 self.__domain=finley.Brick(n0=self.n[0],\
124 n1=self.n[1],\
125 n2=self.n[2],\
126 l0=self.l[0],\
127 l1=self.l[1],\
128 l2=self.l[2],\
129 order=self.order, \
130 periodic0=self.periodic[0], \
131 periodic1=self.periodic[1], \
132 periodic2=self.periodic[2], \
133 integrationOrder=self.integrationOrder)
134 return self.__domain
135
136 class UpdateGeometry(Model):
137 """
138 applies a displacement field to a domain
139
140 @ivar displacement: displacements applied to the original mesh coordinates (in).
141 @type displacement: L{escript.Vector}
142 @ivar domain: domain
143 @type domain: L{escript.Domain}
144 """
145 def __init__(self,**kwargs):
146 """
147 set-up the object
148 """
149 super(UpdateGeometry, self).__init__(**kwargs)
150 self.declareParameter(domain=None,\
151 displacement=None)
152
153
154 def doInitialization(self):
155 """
156 initialize model
157 """
158 self.__x=self.domain.getX()
159 self.__reset=True
160
161 def doStepPreprocessing(self,dt):
162 """
163 applies the current L{displacement} to mesh nodes if required.
164 """
165 if self.__reset:
166 self.trace("mesh nodes updated.")
167 self.domain.setX(self.__x+self.displacement)
168 self.__reset=False
169
170 def doStep(self,dt):
171 """
172 applies the current L{displacement} to mesh nodes.
173 """
174 self.trace("mesh nodes updated.")
175 self.domain.setX(self.__x+self.displacement)
176 self.__reset=True
177
178 def doStepPostprocessing(self,dt):
179 """
180 marks nodes as beeing updated.
181 """
182 self.__reset=False
183
184 class ConstrainerOverBox(Model):
185 """
186 Creates a characteristic function for the location of constraints
187 for all components of a value and selects the value from an initial value
188 ate these locations.
189
190 In the case that the spatial dimension is two, the arguments front and back are ignored.
191
192 @ivar domain: domain (in).
193 @ivar left: True to set a constraint at the left face of the domain (x[0]=min x[0]), default False (in).
194 @ivar right: True to set a constraint at the left face of the domain (x[0]=max x[0]), default False (in).
195 @ivar top: True to set a constraint at the left face of the domain (x[1]=min x[1]), default False (in).
196 @ivar bottom: True to set a constraint at the left face of the domain (x[1]=max x[1]), default False (in).
197 @ivar front: True to set a constraint at the left face of the domain (x[2]=min x[2]), default False (in).
198 @ivar back: True to set a constraint at the left face of the domain (x[2]=max x[2]), default False (in).
199 @ivar tol: absolute tolerance for "x=max x" condition, default 1.e-8 (in).
200 """
201 def __init__(self,**kwargs):
202 super(ConstrainerOverBox, self).__init__(**kwargs)
203 self.declareParameter(domain=None, \
204 value=None, \
205 left=False, \
206 right=False, \
207 top=False, \
208 bottom=False, \
209 front=False, \
210 back=False, \
211 tol=1.e-8)
212 self.__value_of_constraint = None
213 self.__location_of_constraint=None
214 def location_of_constraint(self):
215 """
216 return the values used to constrain a solution
217
218 @return: the mask marking the locations of the constraints
219 @rtype: L{escript.Scalar}
220 """
221 if self.__location_of_constraint == None: self.__setOutput()
222 return self.__location_of_constraint
223
224 def value_of_constraint(self):
225 """
226 return the values used to constrain a solution
227
228 @return: values to be used at the locations of the constraints. If
229 L{value} is not given C{None} is rerturned.
230 @rtype: L{escript.Scalar}
231 """
232 if self.__location_of_constraint == None: self.__setOutput()
233 return self.__value_of_constraint
234
235 def __setOutput(self):
236 if self.__location_of_constraint == None:
237 x=self.domain.getX()
238 val=self.value
239 if isinstance(val, int) or isinstance(val, float):
240 shape=()
241 elif isinstance(val, list) or isinstance(val, tuple) :
242 shape=(len(val),)
243 elif isinstance(val, numarray.NumArray):
244 shape=val.shape
245 elif val == None:
246 shape=()
247 else:
248 shape=val.getShape()
249 self.__location_of_constraint=Data(0,shape,x.getFunctionSpace())
250 if self.domain.getDim()==3:
251 x0,x1,x2=x[0],x[1],x[2]
252 if self.left: self.__location_of_constraint+=whereZero(x0-inf(x0),self.tol)
253 if self.right: self.__location_of_constraint+=whereZero(x0-sup(x0),self.tol)
254 if self.front: self.__location_of_constraint+=whereZero(x1-inf(x1),self.tol)
255 if self.back: self.__location_of_constraint+=whereZero(x1-sup(x1),self.tol)
256 if self.bottom: self.__location_of_constraint+=whereZero(x2-inf(x2),self.tol)
257 if self.top: self.__location_of_constraint+=whereZero(x2-sup(x2),self.tol)
258 else:
259 x0,x1=x[0],x[1]
260 if self.left: self.__location_of_constraint+=whereZero(x0-inf(x0),self.tol)
261 if self.right: self.__location_of_constraint+=whereZero(x0-sup(x0),self.tol)
262 if self.bottom: self.__location_of_constraint+=whereZero(x1-inf(x1),self.tol)
263 if self.top: self.__location_of_constraint+=whereZero(x1-sup(x1),self.tol)
264 if not self.value == None:
265 self.__value_of_constraint=self.__location_of_constraint*self.value
266 class ScalarConstrainerOverBox(Model):
267 """
268 Creates a characteristic function for the location of constraints
269 for a scalar value and selects the value from an initial value
270 ate these locations.
271
272 In the case that the spatial dimension is two, the arguments front and back are ignored.
273
274 @ivar domain: domain (in).
275 @ivar left: True to set a constraint at the left face of the domain (x[0]=min x[0]), default False (in).
276 @ivar right: True to set a constraint at the left face of the domain (x[0]=max x[0]), default False (in).
277 @ivar top: True to set a constraint at the left face of the domain (x[1]=min x[1]), default False (in).
278 @ivar bottom: True to set a constraint at the left face of the domain (x[1]=max x[1]), default False (in).
279 @ivar front: True to set a constraint at the left face of the domain (x[2]=min x[2]), default False (in).
280 @ivar back: True to set a constraint at the left face of the domain (x[2]=max x[2]), default False (in).
281 @ivar tol: absolute tolerance for "x=max x" condition, default 1.e-8 (in).
282 """
283 def __init__(self,**kwargs):
284 super(ScalarConstrainerOverBox, self).__init__(**kwargs)
285 self.declareParameter(domain=None, \
286 value=None, \
287 left=False, \
288 right=False, \
289 top=False, \
290 bottom=False, \
291 front=False, \
292 back=False, \
293 tol=1.e-8)
294 self.__value_of_constraint = None
295 self.__location_of_constraint=None
296 def location_of_constraint(self):
297 """
298 return the values used to constrain a solution
299
300 @return: the mask marking the locations of the constraints
301 @rtype: L{escript.Scalar}
302 """
303 if self.__location_of_constraint == None: self.__setOutput()
304 return self.__location_of_constraint
305
306 def value_of_constraint(self):
307 """
308 return the values used to constrain a solution
309
310 @return: values to be used at the locations of the constraints. If
311 L{value} is not given C{None} is rerturned.
312 @rtype: L{escript.Scalar}
313 """
314 if self.__location_of_constraint == None: self.__setOutput()
315 return self.__value_of_constraint
316
317 def __setOutput(self):
318 x=self.domain.getX()
319 self.__location_of_constraint=Scalar(0,x.getFunctionSpace())
320 if self.domain.getDim()==3:
321 x0,x1,x2=x[0],x[1],x[2]
322 if self.left: self.__location_of_constraint+=whereZero(x0-inf(x0),self.tol)
323 if self.right: self.__location_of_constraint+=whereZero(x0-sup(x0),self.tol)
324 if self.front: self.__location_of_constraint+=whereZero(x1-inf(x1),self.tol)
325 if self.back: self.__location_of_constraint+=whereZero(x1-sup(x1),self.tol)
326 if self.bottom: self.__location_of_constraint+=whereZero(x2-inf(x2),self.tol)
327 if self.top: self.__location_of_constraint+=whereZero(x2-sup(x2),self.tol)
328 else:
329 x0,x1=x[0],x[1]
330 if self.left: self.__location_of_constraint+=whereZero(x0-inf(x0),self.tol)
331 if self.right: self.__location_of_constraint+=whereZero(x0-sup(x0),self.tol)
332 if self.bottom: self.__location_of_constraint+=whereZero(x1-inf(x1),self.tol)
333 if self.top: self.__location_of_constraint+=whereZero(x1-sup(x1),self.tol)
334 if not self.value == None:
335 self.__value_of_constraint=self.__location_of_constraint*self.value
336
337 class VectorConstrainerOverBox(Model):
338 """
339 Creates a characteristic function for the location of constraints vector value.
340 In the case that the spatial dimension is two, the arguments front and
341 back as well as the third component of each argument is ignored.
342
343 @ivar domain: domain
344 @ivar left: list of three boolean. left[i]==True sets a constraint for the i-th component at the left face of the domain (x[0]=min x[0]),
345 default [False,False,False] (in).
346 @ivar right: list of three boolean. left[i]==True sets a constraint for the i-th component at the right face of the domain (x[0]=max x[0]),
347 default [False,False,False] (in).
348 @ivar top: list of three boolean. left[i]==True sets a constraint for the i-th component at the top face of the domain (x[1]=min x[1]),
349 default [False,False,False] (in).
350 @ivar bottom: list of three boolean. left[i]==True sets a constraint for the i-th component at the bottom face of the domain (x[1]=min x[1]),
351 default [False,False,False] (in).
352 @ivar front: list of three boolean. left[i]==True sets a constraint for the i-th component at the front face of the domain (x[2]=min x[2]),
353 default [False,False,False] (in).
354 @ivar back: list of three boolean. left[i]==True sets a constraint for the i-th component at the back face of the domain (x[2]=max x[2]),
355 default [False,False,False] (in).
356 @ivar tol: absolute tolerance for "x=max x" condition, default 1.e-8 (in).
357 """
358 def __init__(self, **kwargs):
359 super(VectorConstrainerOverBox, self).__init__(**kwargs)
360 self.declareParameter(domain=None, \
361 value=None, \
362 left=[False ,False ,False ], \
363 right=[False ,False ,False ], \
364 top=[False ,False ,False ], \
365 bottom=[False ,False ,False ], \
366 front=[False ,False ,False ], \
367 back=[False ,False ,False ], \
368 tol=1.e-8)
369 self.__value_of_constraint = None
370 self.__location_of_constraint=None
371
372 def location_of_constraint(self):
373 """
374 return the values used to constrain a solution
375
376 @return: the mask marking the locations of the constraints
377 @rtype: L{escript.Vector}
378 """
379 if self.__location_of_constraint == None: self.__setOutput()
380 return self.__location_of_constraint
381
382 def value_of_constraint(self):
383 """
384 return the values used to constrain a solution
385
386 @return: values to be used at the locations of the constraints. If
387 L{value} is not given C{None} is rerturned.
388 @rtype: L{escript.Vector}
389 """
390 if self.__location_of_constraint == None: self.__setOutput()
391 return self.__value_of_constraint
392
393 def __setOutput(self):
394 x=self.domain.getX()
395 self.__location_of_constraint=Vector(0,x.getFunctionSpace())
396 if self.domain.getDim()==3:
397 x0,x1,x2=x[0],x[1],x[2]
398 left_mask=whereZero(x0-inf(x0),self.tol)
399 if self.left[0]: self.__location_of_constraint+=left_mask*[1.,0.,0.]
400 if self.left[1]: self.__location_of_constraint+=left_mask*[0.,1.,0.]
401 if self.left[2]: self.__location_of_constraint+=left_mask*[0.,0.,1.]
402 right_mask=whereZero(x0-sup(x0),self.tol)
403 if self.right[0]: self.__location_of_constraint+=right_mask*[1.,0.,0.]
404 if self.right[1]: self.__location_of_constraint+=right_mask*[0.,1.,0.]
405 if self.right[2]: self.__location_of_constraint+=right_mask*[0.,0.,1.]
406 front_mask=whereZero(x1-inf(x1),self.tol)
407 if self.front[0]: self.__location_of_constraint+=front_mask*[1.,0.,0.]
408 if self.front[1]: self.__location_of_constraint+=front_mask*[0.,1.,0.]
409 if self.front[2]: self.__location_of_constraint+=front_mask*[0.,0.,1.]
410 back_mask=whereZero(x1-sup(x1),self.tol)
411 if self.back[0]: self.__location_of_constraint+=back_mask*[1.,0.,0.]
412 if self.back[1]: self.__location_of_constraint+=back_mask*[0.,1.,0.]
413 if self.back[2]: self.__location_of_constraint+=back_mask*[0.,0.,1.]
414 bottom_mask=whereZero(x2-inf(x2),self.tol)
415 if self.bottom[0]: self.__location_of_constraint+=bottom_mask*[1.,0.,0.]
416 if self.bottom[1]: self.__location_of_constraint+=bottom_mask*[0.,1.,0.]
417 if self.bottom[2]: self.__location_of_constraint+=bottom_mask*[0.,0.,1.]
418 top_mask=whereZero(x2-sup(x2),self.tol)
419 if self.top[0]: self.__location_of_constraint+=top_mask*[1.,0.,0.]
420 if self.top[1]: self.__location_of_constraint+=top_mask*[0.,1.,0.]
421 if self.top[2]: self.__location_of_constraint+=top_mask*[0.,0.,1.]
422 if not self.value == None:
423 self.__value_of_constraint=self.__location_of_constraint*self.value
424 else:
425 x0,x1=x[0],x[1]
426 left_mask=whereZero(x0-inf(x0),self.tol)
427 if self.left[0]: self.__location_of_constraint+=left_mask*[1.,0.]
428 if self.left[1]: self.__location_of_constraint+=left_mask*[0.,1.]
429 right_mask=whereZero(x0-sup(x0),self.tol)
430 if self.right[0]: self.__location_of_constraint+=right_mask*[1.,0.]
431 if self.right[1]: self.__location_of_constraint+=right_mask*[0.,1.]
432 bottom_mask=whereZero(x1-inf(x1),self.tol)
433 if self.bottom[0]: self.__location_of_constraint+=bottom_mask*[1.,0.]
434 if self.bottom[1]: self.__location_of_constraint+=bottom_mask*[0.,1.]
435 top_mask=whereZero(x1-sup(x1),self.tol)
436 if self.top[0]: self.__location_of_constraint+=top_mask*[1.,0.]
437 if self.top[1]: self.__location_of_constraint+=top_mask*[0.,1.]
438 if not self.value == None:
439 self.__value_of_constraint=self.__location_of_constraint*self.value[:2]
440
441 class ConstrainerAtBoxVertex(Model):
442 """
443 Creates a characteristic function for the location of constraints
444 for all components of a value and selects the value from an initial value
445 ate these locations.
446
447 In the case that the spatial dimension is two, the arguments front and back are ignored.
448
449 @ivar domain: domain (in).
450 @ivar tol: absolute tolerance for "x=left, front, bottom vertex" condition, default 1.e-8 (in).
451 """
452 def __init__(self,**kwargs):
453 super(ConstrainerAtBoxVertex, self).__init__(**kwargs)
454 self.declareParameter(domain=None, \
455 value=None, \
456 tol=1.e-8)
457 self.__value_of_constraint = None
458 self.__location_of_constraint=None
459 def location_of_constraint(self):
460 """
461 return the values used to constrain a solution
462
463 @return: the mask marking the locations of the constraints
464 @rtype: L{escript.Scalar}
465 """
466 if self.__location_of_constraint == None: self.__setOutput()
467 return self.__location_of_constraint
468
469 def value_of_constraint(self):
470 """
471 return the values used to constrain a solution
472
473 @return: values to be used at the locations of the constraints. If
474 L{value} is not given C{None} is rerturned.
475 @rtype: L{escript.Scalar}
476 """
477 if self.__location_of_constraint == None: self.__setOutput()
478 return self.__value_of_constraint
479
480 def __setOutput(self):
481 if self.__location_of_constraint == None:
482 x=self.domain.getX()
483 val=self.value
484 if isinstance(val, int) or isinstance(val, float):
485 shape=()
486 elif isinstance(val, list) or isinstance(val, tuple) :
487 shape=(len(val),)
488 elif isinstance(val, numarray.NumArray):
489 shape=val.shape
490 elif val == None:
491 shape=()
492 else:
493 shape=val.getShape()
494 if self.domain.getDim()==3:
495 vertex=[inf(x[0]),inf(x[1]),inf(x[2])]
496 else:
497 vertex=[inf(x[0]),inf(x[1])]
498 self.__location_of_constraint=whereZero(length(x-vertex),self.tol)*numarray.ones(shape)
499 if not self.value == None:
500 self.__value_of_constraint=self.__location_of_constraint*self.value
501 class ScalarConstrainerAtBoxVertex(Model):
502 """
503 Creates a characteristic function for the location of constraints
504 for a scalar value and selects the value from an initial value
505 ate these locations.
506
507 In the case that the spatial dimension is two, the arguments front and back are ignored.
508
509 @ivar domain: domain (in).
510 @ivar tol: absolute tolerance for "x=left, front, bottom vertex" condition, default 1.e-8 (in).
511 """
512 def __init__(self,**kwargs):
513 super(ScalarConstrainerAtBoxVertex, self).__init__(**kwargs)
514 self.declareParameter(domain=None, \
515 value=None, \
516 tol=1.e-8)
517 self.__value_of_constraint = None
518 self.__location_of_constraint=None
519 def location_of_constraint(self):
520 """
521 return the values used to constrain a solution
522
523 @return: the mask marking the locations of the constraints
524 @rtype: L{escript.Scalar}
525 """
526 if self.__location_of_constraint == None: self.__setOutput()
527 return self.__location_of_constraint
528
529 def value_of_constraint(self):
530 """
531 return the values used to constrain a solution
532
533 @return: values to be used at the locations of the constraints. If
534 L{value} is not given C{None} is rerturned.
535 @rtype: L{escript.Scalar}
536 """
537 if self.__location_of_constraint == None: self.__setOutput()
538 return self.__value_of_constraint
539
540 def __setOutput(self):
541 x=self.domain.getX()
542 self.__location_of_constraint=Scalar(0,x.getFunctionSpace())
543 if self.domain.getDim()==3:
544 vertex=[inf(x[0]),inf(x[1]),inf(x[2])]
545 else:
546 vertex=[inf(x[0]),inf(x[1])]
547 self.__location_of_constraint=whereZero(length(x-vertex),self.tol)
548 if not self.value == None:
549 self.__value_of_constraint=self.__location_of_constraint*self.value
550
551 class VectorConstrainerAtBoxVertex(Model):
552 """
553 Creates a characteristic function for the location of constraints vector value.
554 In the case that the spatial dimension is two, the arguments front and
555 back as well as the third component of each argument is ignored.
556
557 @ivar domain: domain
558 @ivar comp_mask: list of three boolean. comp_mask[i]==True sets a constraint for the i-th component at the left, front, bottom vertex, default [False,False,False] (in).
559 @ivar tol: absolute tolerance for "x=left, front, bottom vertex" condition, default 1.e-8 (in).
560 """
561 def __init__(self, **kwargs):
562 super(VectorConstrainerAtBoxVertex, self).__init__(**kwargs)
563 self.declareParameter(domain=None, \
564 value=None, \
565 comp_mask=[False, False, False],
566 tol=1.e-8)
567 self.__value_of_constraint = None
568 self.__location_of_constraint=None
569
570 def location_of_constraint(self):
571 """
572 return the values used to constrain a solution
573
574 @return: the mask marking the locations of the constraints
575 @rtype: L{escript.Vector}
576 """
577 if self.__location_of_constraint == None: self.__setOutput()
578 return self.__location_of_constraint
579
580 def value_of_constraint(self):
581 """
582 return the values used to constrain a solution
583
584 @return: values to be used at the locations of the constraints. If
585 L{value} is not given C{None} is rerturned.
586 @rtype: L{escript.Vector}
587 """
588 if self.__location_of_constraint == None: self.__setOutput()
589 return self.__value_of_constraint
590
591 def __setOutput(self):
592 x=self.domain.getX()
593 self.__location_of_constraint=Vector(0,x.getFunctionSpace())
594 if self.domain.getDim()==3:
595 vertex=[inf(x[0]),inf(x[1]),inf(x[2])]
596 msk=numarray.zeros((3,))
597 if self.comp_mask[0]: msk[0]=1
598 if self.comp_mask[1]: msk[1]=1
599 if self.comp_mask[2]: msk[2]=1
600 else:
601 vertex=[inf(x[0]),inf(x[1])]
602 msk=numarray.zeros((2,))
603 if self.comp_mask[0]: msk[0]=1
604 if self.comp_mask[1]: msk[1]=1
605 self.__location_of_constraint=whereZero(length(x-vertex),self.tol)*numarray.ones(shape)
606 if not self.value == None:
607 self.__value_of_constraint=self.__location_of_constraint*self.value
608

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26