Do you have any idea on how best to populate that constant monomial field? 

Ideally I'd like that constant monomial field to have the same value
Elem->id() in a serial mesh.  This would help when checkpointing said
external data structure in parallel.  However, I can't fill in the
constant monomial term until the mesh has been partitioned, and once the
mesh has been partitioned Elem->id() changes. 

This is not a problem for the subdomain_id() route, as I can set those
ids serially then distribute them appropriately in parallel.  However
based on my amateur digging in the code base, certain mesh
readers/writers will produce horribly inefficient outputs if
n_subdomains = n_elem.

On 05/21/2013 01:51 PM, Derek Gaston wrote:
> If you don't want to go the subdomain_id route then I would create an
> explicit system with ONE monomial that has it's value set to a key
> value (ie just store an int per element) then use that to index into
> your datastructure.  That value will be prolonged to child elements
> under refinement and work in parallel etc.
>
> A float stores an int just fine.  And constant monomial fields just
> retain their values in AMR.
>
> Derek
>
> Sent from my iPhone
>
> On May 21, 2013, at 11:14 AM, Robert Blake <[email protected]> wrote:
>
>> Does anyone have any advice on this question?  John, maybe?
>>
>>
>> On 04/30/2013 11:29 AM, Robert Blake wrote:
>>> I am trying to run a FEM simulation wherein every element has a
>>> variable-length C data structure defined in an external non-libmesh file
>>> format.  What is the easiest way to get this data into libmesh and use
>>> it in parallel?
>>>
>>> I see only a couple of ways of doing this:
>>>
>>> 1.) I can easily do this using MeshData and foreign_id_for_elem().  This
>>> works serially, but MeshData is deprecated and doesn't work in parallel.
>>>
>>> 2.) I can create my own data structure that indexes off of Elem->id().
>>> Is this possible?  Based on my cursory glance at the code, I fear that
>>> Elem->id() will change after partitioning in parallel.  If this happens,
>>> this technique won't work.  In addition, I'm not sure how this will work
>>> if I decide to use AMR
>>>
>>> 3.) I can give each mesh a unique subdomain_id(), and create my own data
>>> structure that uses that subdomain_id() as an index.  This should work
>>> in parallel and for AMR, but it seems like a horrible abuse of the
>>> subdomain_id() and might cause problems for parts of the code that
>>> assume n_subdomains << n_elems.
>>>
>>> 4.) I can create an ExplicitSystem with a (CONSTANT,MONOMIAL) term, fill
>>> that data with an integer ID, and then use that ID to index into an
>>> external data structure of my choosing.  I know that this is now the
>>> preferred way of storing element data, but
>>> a.) It seems like a hack to use a floating point field to store integer data
>>> b.) I'd have to take extra care to ensure the variable is NOT
>>> interpolated when doing AMR
>>> c.) I'm still not sure how to populate these data values.  All the code
>>> I've seen for populating variables for ExplicitSystems uses
>>> FunctionBase<> which takes point data as it's argument.  I'm not quite
>>> sure how to easily access an element's data using (x,y,z) coordinates as
>>> an argument.
>>>
>>> Is there something I've missed?  Help!
>>>
>>> Rob
>>>
>>>
>>
>> ------------------------------------------------------------------------------
>> Try New Relic Now & We'll Send You this Cool Shirt
>> New Relic is the only SaaS-based application performance monitoring service
>> that delivers powerful full stack analytics. Optimize and monitor your
>> browser, app, & servers with just a few lines of code. Try New Relic
>> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
>> _______________________________________________
>> Libmesh-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/libmesh-users


------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to