MeshBase & my_mesh = getMesh(); for (unsigned int e=0; e<my_mesh.n_elem(); e++)
my_mesh.elem(e)->subdomain_id() = _bids[e];
I'm trying to create my own generated mesh with MOOSE, and can't figure out how to set the element block ID for the elements that I'm creating. I need to create two blocks of different element types, so they can't be in the same block. Is that possible, and if so, how do you do it?-Ben
--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.
Visit this group at http://groups.google.com/group/moose-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/moose-users/CANcsQPfAyEfztmbbpM7K_N-TZgkyt1QNujMEs59g1f36H-agHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
I'm trying to create my own generated mesh with MOOSE, and can't figure out how to set the element block ID for the elements that I'm creating. I need to create two blocks of different element types, so they can't be in the same block. Is that possible, and if so, how do you do it?-Ben
To view this discussion on the web visit https://groups.google.com/d/msgid/moose-users/CABk6%3D%2BbmF%3Du2yvLnThkzeMCzOtUrLx5D8xf1EbmHeZRc%2BwEH%3Dw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/moose-users/CAK06EuWs2VFyAYKz6u%3DW_9SHGgV_4bRjjZUL1WRtHjfK3SsTgg%40mail.gmail.com.
Ben,Not sure if you have access to Yak. There is one generator derived from GeneratedMesh https://hpcgitlab.inl.gov/idaholab/yak/blob/devel/src/common/mesh/GeneratedBIDMesh.C.It has an extra parameter specifying the block IDs of all elements, then in its buildMesh(), the following is there:MeshBase & my_mesh = getMesh();for (unsigned int e=0; e<my_mesh.n_elem(); e++) my_mesh.elem(e)->subdomain_id() = _bids[e];
MeshBase::element_iterator el = mesh.elements_begin();
const MeshBase::element_iterator end_el = mesh.elements_end();
for ( ; el != end_el; ++el)
{
Elem* elem = *el;
elem->subdomain_id() = _bids[elem->id()];
}