Matthew Knepley <knep...@gmail.com> 於 2023年5月31日 週三 下午1:02寫道:
> On Wed, May 31, 2023 at 1:53 PM YuSh Lo <ysjosh...@gmail.com> wrote: > >> Hi Matthew, >> >> Matthew Knepley <knep...@gmail.com> 於 2023年5月31日 週三 上午5:08寫道: >> >>> On Wed, May 31, 2023 at 1:25 AM YuSh Lo <ysjosh...@gmail.com> wrote: >>> >>>> Hi, >>>> >>>> I have some multiple points constraint input as follows, >>>> >>>> A_1 a_4 >>>> B_2 b_5 >>>> C_3 c_6 >>>> >>>> each columns are stored in different IS. >>>> >>> >>> So one IS lists the capital letter and one lists the lowercase? >>> >> Yes. >> >>> >>> >>>> After dmplex distribute, they will be renumbered and distribution to >>>> certain processors. >>>> >>> >>> Plex does normally renumber and send ISes, so you are doing this >>> yourself? >>> >> No, Plex does the distribution. >> > > I do not understand this. How does the DM know about this IS? Are you > calling DMDistributeFieldIS()? > I first create a serial DM and use DMLabel to mark those nodes, and store them in IS. Then I call DMPlexDistribute. > > >> >>> >>>> I have two questions: >>>> >>>> (1) I need both complete ISs are all the processors. Can I just do >>>> ISALLGather()? >>>> >>> >>> I think so. I cannot tell what you want to do. >>> >>> >>>> (2) Although renumbered, will the original order remain(ABC and abc)? >>>> If the number is the node number, after distribution and I do an >>>> ISALLGather() >>>> will I have the following on each processor? >>>> >>>> A_3 a_1 >>>> B_4 b_2 >>>> C_6 c_5 >>>> (I randomly renumber them) >>>> >>>> >>>> This is what I can come up with now. Is there any better way to do it? >>>> >>> >>> Can you tell me what you want to use this for? Maybe there is an easier >>> way. For example, >>> if we want to impose a constraint on a mesh point, usually I mark that >>> point with a DMLabel. >>> These are propagated during distribution so you do not have to think >>> about it. >>> >> >> So I have to impose constraint between two nodes. The upper case node >> is controlled by the lower case node, and there can be many pairs of >> constraint. When looping over elements if one node is controlled by the >> other then the corresponding entry has to be added to a different location >> e.x. [an index][A_3] to [an index][a_1]. I know how to use DMLabel, but I >> have used it on one node at a time only. I used DMLabel to mark those nodes >> with BCs. Now I must know the info of two nodes at the same time. The >> operations only have to done in assembling and calculating the element >> stiffness matrix of the elements that contain the upper case node, but I >> must know the info of the corresponding lower case node so I know where to >> assemble the entry. >> > > Oh, if you want to associate two mesh points, use a PetscSF. These can > also be remapped. > > Thanks, > > Matt > > >> Thanks, >> Josh >> >> >>> >>> Thanks, >>> >>> Matt >>> >>> >>>> Thanks, >>>> Josh >>>> >>> >>> >>> -- >>> 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 >>> >>> https://www.cse.buffalo.edu/~knepley/ >>> <http://www.cse.buffalo.edu/~knepley/> >>> >> > > -- > 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 > > https://www.cse.buffalo.edu/~knepley/ > <http://www.cse.buffalo.edu/~knepley/> >