simple question on mesh_snap_boundary
Hi all,
I explored the usage of "mesh_snap_
### Beginning of code
mesh=UnitSquare
print mesh.coordinates()
class LeftRegion(
def inside(self, x, on_boundary):
return True if x[0]<=0.5 else False
def snap(self, x):
if x[0]<=0.
left = LeftRegion()
mesh.snap_
print mesh.coordinates()
### End of code
I simply want to push the vertices on the left side of the unit square towards y-axis by a factor of 0.5, so [0.5, y] should become [0.25, y]. However, the output of the code above is, after "snapping",
"""
[[ 0. 0. ]
[ 0.25 0. ]
[ 1. 0. ]
[ 0. 0.5 ]
[ 0.375 0.5 ]
[ 1. 0.5 ]
[ 0. 1. ]
[ 0.25 1. ]
[ 1. 1. ]]
"""
Could anyone tell me why the center vertex became [0.375, 0.5], rather than [0.25, 0.5]?
Thanks a lot!
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Xiaoxian Liu for more information if necessary.