-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 21/08/15 11:52, David Ham wrote:
class PointDirichletBC(DirichletBC): @utils.cached_property def nodes(self): # Find the array of coordinate values. x = self.function_space().mesh().coordinates.dat.data_ro # Find the location of the zero rows in that return np.where(~x.any(axis=1))[0]
I believe David is fixing the error in using this kind of idea. However, I note in passing that this exact form may not do exactly what you want. It assumes that the function space that you're wanting to apply the boundary condition to is the same space that is holding the coordinate field (namely piecewise linears, P1 on simplices, Q1 on quads). If the space you want to pin is not P1, you'll have to work harder (this is the subdomain problem David alluded to). If you want to have a boundary marker that applies to a small subset of the boundary of a mesh, I recommend, rather than using the built in utility meshes, to build the mesh using Gmsh. There you can provide physical IDs to whatever subset of the boundary you like and then use these ID numbers in your boundary condition objects. Lawrence -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJV3bdwAAoJECOc1kQ8PEYvJbEH/j3pgwIdWig5IHQqVGSI+OUf xsu1XZMGhf4MCRzXYlqlQQZ3HGNTO7tCOXHN/DATeKW4ZYB21bSrBQEsPUr3P+iL EteoaXYv5nDbMBJzQcxnXI/VQyPRhVbSd2mORK8pf/6xyVUceVrBgBCxaG5hbI8e Axubo+ugrg/32NkX1CXISaMCn7fdF2qkZKJA2YZhoZqmiW0v1n3TiYuzDUlhRoC+ vrdAVUOCfyEvU/5Q/GMSlq76YVvGIBgwcpnzvUYK3gPPnNrj1PCMeNty1LyHqThJ zPZX1ijUfXtjsz37LkDJxu4bWUkD5tXJfKUJXex3YfoqIYpyRiDs8IPBRcXsEl0= =1qnA -----END PGP SIGNATURE-----