[petsc-users] How to refine the Vertex Sets in DMPlex

Rongliang Chen rl.chen at siat.ac.cn
Tue Jun 7 23:45:56 CDT 2016


Hi Matt,

I tried your suggestions but I still can not get the refined Vertex 
Sets. What I am doing looks like this:
-----------------------------------------------------------------------
if (!rank) {
   DMPlexSetLabelValue(dm, "Vertex Sets", xx, xx)
   DMPlexSetLabelValue(dm, "Face Sets", xx, xx)
}

DMPlexDistribute(dm, xx, xx)

DMPlexGetStratumIS(dm, "Vertex Sets", xx, &vertexIS)
ISGetLocalSize(vertexIS, &numVertexes1)

DMRefine(dm, xx)

DMPlexGetLabel(dm, "Face Sets", &facelabel)
DMPlexLabelComplete(dm, facelabel)

DMPlexGetStratumIS(dm, "Vertex Sets", xx, &vertexIS)
ISGetLocalSize(vertexIS, &numVertexes2)
-------------------------------------------------------------------

I got "numVertexes1 == numVertexes2". But I expect to get "numVertexes2 
 > numVertexes1". Did I miss something?

Thanks,
Rongliang



On 06/08/2016 08:13 AM, Rongliang Chen wrote:
> Hi Matt,
>
> Thank you very much.
>
> Best,
> Rongliang
>
>
> On 06/08/2016 01:53 AM, Matthew Knepley wrote:
>> On Tue, Jun 7, 2016 at 5:18 PM, Rongliang Chen <rl.chen at siat.ac.cn 
>> <mailto:rl.chen at siat.ac.cn>> wrote:
>>
>>     Hi Matt,
>>
>>     I know how to label vertex (ex_get_node_set) and face
>>     (ex_get_side_set), but do not know how to label the edge for a 3D
>>     mesh. Can you give me an example for that?
>>
>>
>> You can label the faces, and then call DMPlexLabelComplete().
>>
>>   Thanks,
>>
>>     Matt
>>
>>     Thanks,
>>     Rongliang
>>
>>     ---------------------
>>     Rongliang Chen,   PhD
>>     Associate Professor
>>
>>     Laboratory for Engineering and Scientific Computing
>>     Shenzhen Institutes of Advanced Technology
>>     Chinese Academy of Sciences
>>     Address: 1068 Xueyuan Avenue, Shenzhen University Town, Shenzhen, Guangdong (518055), P. R. China
>>     E-mail:rl.chen at siat.ac.cn  <mailto:rl.chen at siat.ac.cn>
>>     Phone:+86-755-86392312  <tel:%2B86-755-86392312>
>>
>>     On 06/07/2016 10:06 PM, Matthew Knepley wrote:
>>>     On Tue, Jun 7, 2016 at 3:05 PM, Rongliang Chen
>>>     <rl.chen at siat.ac.cn <mailto:rl.chen at siat.ac.cn>> wrote:
>>>
>>>         Hi Matt,
>>>
>>>         Thanks for your reply.
>>>
>>>         Yes, I only labels the vertex because I am doing the finite
>>>         element method where I only need the vertex label. Do you
>>>         mean that I need to label the faces and get the vertex label
>>>         from the  face label?
>>>
>>>
>>>     You need to label vertices and edges.
>>>
>>>       Thanks,
>>>
>>>         Matt
>>>
>>>         Thanks,
>>>         Rongliang
>>>
>>>
>>>
>>>         On 06/07/2016 09:51 PM, Matthew Knepley wrote:
>>>>         On Tue, Jun 7, 2016 at 10:09 AM, Rongliang Chen
>>>>         <rl.chen at siat.ac.cn <mailto:rl.chen at siat.ac.cn>> wrote:
>>>>
>>>>             Dear All,
>>>>
>>>>             I am using the DMRefine_Plex to refine a mesh. In the
>>>>             coarse mesh, it has a label "Vertex Sets" to mark the
>>>>             boundary nodes. I found that the DMRefine_Plex did not
>>>>             refine this label.
>>>>
>>>>             For example, in the coarse mesh, there are 100 nodes on
>>>>             the boundary, that is the number of nodes in the label
>>>>             is 100. In the refined mesh (uniformly refined), the
>>>>             number of nodes in the label should be larger than 100,
>>>>             but I found that this number is still 100, which means
>>>>             the newly added nodes on the boundary were not added to
>>>>             the label.
>>>>
>>>>             But I need a refined label to set the boundary
>>>>             conditions. Anyone can tell me how to get a refined
>>>>             Vertex Sets label?
>>>>
>>>>
>>>>         All operations are topological in Plex, not geometric. When
>>>>         we refine, we split edges (for instance) and the new vertex
>>>>         inserted
>>>>         inherits the labels from the edge that was split. I am
>>>>         guessing that you only labels the vertices.
>>>>
>>>>           Thanks,
>>>>
>>>>             Matt
>>>>
>>>>             Best regards,
>>>>             Rongliang
>>>>
>>>>
>>>>
>>>>
>>>>         -- 
>>>>         What most experimenters take for granted before they begin
>>>>         their experiments is infinitely more interesting than any
>>>>         results to which their experiments lead.
>>>>         -- Norbert Wiener
>>>
>>>
>>>
>>>
>>>     -- 
>>>     What most experimenters take for granted before they begin their
>>>     experiments is infinitely more interesting than any results to
>>>     which their experiments lead.
>>>     -- Norbert Wiener
>>
>>
>>
>>
>> -- 
>> What most experimenters take for granted before they begin their 
>> experiments is infinitely more interesting than any results to which 
>> their experiments lead.
>> -- Norbert Wiener
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160608/34c9cbee/attachment.html>


More information about the petsc-users mailing list