From: David K. <dav...@ak...> - 2018-03-19 12:13:24
|
On Mon, Mar 19, 2018 at 5:19 AM, SKang <ss...@pu...> wrote: > Hello, all.I try to solve an RB problem similar to the RB example 5.Iused > multiple domains with lengthscaling factors.So I need to plot themeshto > match the scaling given by the input value to each subdomain.For the > libmesh code to plot, I will refer to "scale_mesh_and_plot" in the RB > Example 5.However, I don't know how to obtain subdomain information from > nodes.So I want to ask two questions.1. Please let me know if there is a > similar code to the following code for a node.------------------------- > ---------------------------------------------------------------Elem * > elem = &c.get_elem();if(elem -> subdomain_id() == > AREA_ID1)--------------------------------------------------- > --------------------------------------2. If not, I want to know another > way to obtain subdomain information from nodes.Thank you.Best regards,Kang > In libMesh subdomains are for elements, not for nodes. If you want to associate a subdomain ID with nodes, you could define a map from node ID to subdomain ID, and then loop over the elements of the mesh to get the subdomain ID, and then loop over the nodes of each element and fill in the map. Of course, the subdomains in this approach are not unique since elements with different subdomain IDs can link to the same node, so with this approach you would store the subdomain ID for one of the elements that touches each node. David |