## [Libmesh-users] Structured 'solution'

 [Libmesh-users] Structured 'solution' From: Coroian, Cristian - 2005-06-27 19:42:07 Attachments: Message as HTML ```With regards to mapping a real space point back to computational space, what do you think of this idea: =20 In the PointLocatorStructure::init(), build an n-dimentional container where n is the dimension of the Point, containing Elem constant refferences. For example, in a 2D case I would have =20 E :: n-dimensional container where references are stored delta :: n-dimensional container where cell size (a conversion factor) is stored. =20 for all elements =20 E[floor(element.centroid(0)/delta(0))][floor(element.centroid(1)delta(1) )] =3D &element; =20 Then have the point locator operator() function would=20 =20 return E[floor(Point(0)/delta(0))][floor(Point(1)/delta(1))] =20 which is the constant reference to the element.=20 =20 Outside of space inefficiency can you provide any suggestions as far as this method is concerned? =20 Cristian Coroian Software Engineer I Advatech Pacific Inc ```

 [Libmesh-users] Structured 'solution' From: Coroian, Cristian - 2005-06-27 19:42:07 Attachments: Message as HTML ```With regards to mapping a real space point back to computational space, what do you think of this idea: =20 In the PointLocatorStructure::init(), build an n-dimentional container where n is the dimension of the Point, containing Elem constant refferences. For example, in a 2D case I would have =20 E :: n-dimensional container where references are stored delta :: n-dimensional container where cell size (a conversion factor) is stored. =20 for all elements =20 E[floor(element.centroid(0)/delta(0))][floor(element.centroid(1)delta(1) )] =3D &element; =20 Then have the point locator operator() function would=20 =20 return E[floor(Point(0)/delta(0))][floor(Point(1)/delta(1))] =20 which is the constant reference to the element.=20 =20 Outside of space inefficiency can you provide any suggestions as far as this method is concerned? =20 Cristian Coroian Software Engineer I Advatech Pacific Inc ```
 Re: [Libmesh-users] Structured 'solution' From: Roy Stogner - 2005-06-27 22:08:07 ```On Mon, 27 Jun 2005, Coroian, Cristian wrote: > With regards to mapping a real space point back to computational space, > what do you think of this idea: > > In the PointLocatorStructure::init(), build an n-dimentional container > where n is the dimension of the Point, containing Elem constant > refferences. For example, in a 2D case I would have > > E :: n-dimensional container where references are stored > delta :: n-dimensional container where cell size (a conversion factor) > is stored. > > for all elements > > E[floor(element.centroid(0)/delta(0))][floor(element.centroid(1)delta(1) > )] = &element; > > Then have the point locator operator() function would > > return E[floor(Point(0)/delta(0))][floor(Point(1)/delta(1))] > > which is the constant reference to the element. > > Outside of space inefficiency can you provide any suggestions as far as > this method is concerned? I can't think of a better way to provide a time-efficient point locator for a cartesian grid held in the current unstructured Mesh subclass. If you eventually make a new CartesianMesh subclass, though, just make sure your coarse elements are always created in a canonical order and never renumbered and you'll be able to get the correct element with an (i*N*M+j*N+k) type indexing without a lookup table. You could even retain adaptivity in such a class - just make sure the coarse elements aren't renumbered, have the lookup find the containing coarse element first, and iteratively descend down into child elements to find the correct containing active element. --- Roy Stogner ```