In the (mysterious) future we could make a  
recalculate_n_subdomains()... it would just run through all of the  
elements and get the std::set of subdomain id's then call size().  But  
that's overkill when we really do know the number of subdomains... so  
for now I'm just going to make that public.

Derek

On Jan 23, 2009, at 2:47 PM, Kirk, Benjamin (JSC-EG) wrote:

>> Is there a particular reason why Mesh::set_n_subdomains() is  
>> protected?
>>
>> We just noticed that there's an output bug when writing out xda/xdr
>> format meshes after reading in Exodus meshes with subdomain_id's on
>> them in the form of blocks.... the subdomain_id's don't get written  
>> to
>> the xda/xdr files.
>>
>> The reason appears to be that n_subdomains() is still _0_ on the
>> mesh.... and after looking at it... that's because the only way to  
>> set
>> n_subdomains() is by using a BoundaryMesh/Info object and the sync()
>> method.  But I can't see any reason why ExodusIO shouldn't be able to
>> set the number of subdomains when it reads a mesh in.... so I'm  
>> voting
>> for just making set_n_subdomains() public.
>
> Definition at line 257 of file mesh_base.C.
> unsigned int MeshBase::recalculate_n_partitions      ( )
>
> In a few (very rare) cases, the user may have manually tagged the  
> elements
> with specific processor IDs by hand, without using a partitioner. In  
> this
> case, the Mesh will not know that the total number of partitions,  
> _n_parts,
> has changed, unless you call this function. This is an O(N active  
> elements)
> calculation. The return value is the number of partitions, and  
> _n_parts is
> also set by this function.
>
> Sounds like we could use a corresponding recalculate_n_subdomains()
>
> Or make it public.  Or both...  (I'm feeling agreeable.)
>
> -Ben
>


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to