>
> I have one more question. If I generate subdomains and a mesh using a
> commercial program, e.g., Trelis, do I need to redefine node numbers and
> subdomains in a libMesh code?
>
> If so, I think it is almost impossible.
>

No, you should not have to redefine anything. If you're using Trelis, then
define the subdomains by defining "blocks" in an ExodusII mesh, and they
will be read into libMesh and stored as subdomain_ids. You should not have
to change node numbers. In general your code should not care what the node
numbering is.

David


----- Original Message -----
From : David Knezevic <david.kneze...@akselos.com>
To : "SKang" <ss.k...@pusan.ac.kr>
Cc : "Libmesh user group" <libmesh-users@lists.sourceforge.net>
Sent : 2018-03-19 21:13:20
Subject : Re: [Libmesh-users] [RB] How to obtain subdomain information from
nodes


On Mon, Mar 19, 2018 at 5:19 AM, SKang <ss.k...@pusan.ac.kr> 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
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to