[MOAB-dev] A PDE example with MOAB.

Tim Tautges tautges at mcs.anl.gov
Wed Apr 13 15:52:20 CDT 2011



On 04/13/2011 03:15 PM, Vijay S. Mahadevan wrote:
> Tim,
>
> I have used the example MOAB programs to read mesh files (gmsh mostly)
> and load the entities and tags. But the usage for traversing through
> the mesh and querying each node to obtain its neighbors and elements
> that they belong seems a little complicated. Since these operations
> are fundamental building blocks in writing a residual function for a
> PDE, I just wanted to look at how it could be done for a simple
> example.
>

Are you implementing in Fortran or C++ or something else?  In what way does it seem complicated?

I just remembered one of the tests that shows basic mesh traversal, it's the test/perf/perf.cpp (the equivalent code 
that uses the iMesh interface is in tstt_perf.cpp in the same directory).  There are two functions in those tests you'll 
want to look at:

- query_elem_to_vert: gets all the elements in the mesh, then for each element, gets the connectivity, the coordinates 
of those vertices, and averages those coordinates.  That function is about 20 lines long, including the averaging.

- query_vert_to_elem: gets all the vertices, then for each queries the adjacent hexes.  That function is about 12 lines 
long.

> I will definitely look at NEK as per your suggestion but if they only
> use MOAB to read the mesh and convert it to their own mesh data
> structures, it beats the purpose of my question. Thanks for the
> pointer though.

That's essentially what it does, so maybe not that helpful.

- tim

>
> Vijay
>
> On Wed, Apr 13, 2011 at 3:02 PM, Tim Tautges<tautges at mcs.anl.gov>  wrote:
>> Hi Vijay,
>>   Yes, this is the right forum, but no, I don't know of a good example that's
>> self-contained.  An alternative would be to look at the Nek code, which has
>> a working MOAB reader.  That'll show how to pick up the mesh and bc's,
>> though I don't think it writes anything down to the mesh.  Other than that,
>> the tutorial slides on the MOAB wiki have some coding examples, but they're
>> pretty short.
>>
>> - tim
>>
>> On 04/13/2011 02:40 PM, Vijay S. Mahadevan wrote:
>>>
>>> All,
>>>
>>> I was wondering whether there is a simple example on the usage of MOAB
>>> or iMesh for solving a PDE. This could be as trivial as a finite
>>> differenced, 1-d poisson equation but I just wanted to have a look at
>>> a working example in action in order to extend the ideas to more
>>> practical problems. I could not find any such tutorial in the MOAB
>>> repository and so thought that maybe someone in the list can point me
>>> to one.
>>>
>>> Also, if there is a different forum for such questions, I would
>>> appreciate it if you can redirect me to it.
>>>
>>> Thanks,
>>> Vijay
>>>
>>
>> --
>> ================================================================
>> "You will keep in perfect peace him whose mind is
>>   steadfast, because he trusts in you."               Isaiah 26:3
>>
>>              Tim Tautges            Argonne National Laboratory
>>          (tautges at mcs.anl.gov)      (telecommuting from UW-Madison)
>>          phone: (608) 263-8485      1500 Engineering Dr.
>>            fax: (608) 263-4499      Madison, WI 53706
>>
>>
>

-- 
================================================================
"You will keep in perfect peace him whose mind is
   steadfast, because he trusts in you."               Isaiah 26:3

              Tim Tautges            Argonne National Laboratory
          (tautges at mcs.anl.gov)      (telecommuting from UW-Madison)
          phone: (608) 263-8485      1500 Engineering Dr.
            fax: (608) 263-4499      Madison, WI 53706



More information about the moab-dev mailing list