On Tue, Mar 9, 2010 at 10:05 AM, Roy Stogner <[email protected]> wrote:
>
> On Tue, 9 Mar 2010, Vikram Garg wrote:
>
>> Roy/John,
>
> I'll Cc: to libmesh-users, too, in case someone else has any ideas.
>
>>               I am trying to create a mesh and specify its boundary
>> ids for a rectangular domain. I had previously done this with an
>> unstructured grid and everything had worked fine. But now when I try
>> to do the same for a structured grids, I am getting an assertion
>> failure while writing out the mesh in xda format.
>>
>> Assertion `n_bcs == n_bcs_out' failed.
>> [0] src/mesh/xdr_io.C, line 735, compiled Mar  2 2010 at 09:52:55
>> terminate called after throwing an instance of 'libMesh::LogicError'
>>   what():  Error in libMesh internal logic
>> Aborted
>>
>> The code works when I just create and write out the mesh without
>> trying to set boundary ids. I am guessing that there must be
>> something wrong in boundary id setting on structured grids. Is there
>> anything different about setting ids for a structured mesh ? Any
>> suggestions ?
>
> The only difference I can think of is that a structured mesh output
> from build_square/build_cube/whatever already has some boundary ids
> set.  Is it possible that you're setting new boundary ids without
> clearing the old?  IIRC we wanted to support multiple ids on a single
> boundary side, but the support isn't all there yet, so perhaps you're
> successfully adding an additional id but we're not able to write it
> out.

Hmm... looks like line 698 of xdr_io.C

            const short int bc_id =
              boundary_info.boundary_id (elem, s);

and the boundary_id() function itself assumes only 1 ID per side.  The
BoundaryInfo::_boundary_side_id multimap is general enough to store
multiple element-side-id tuples, though, which is why you were able to
add it.

We might be able to generalize to multiple boundary IDs by reworking
boundary_id(elem,s) to fill a passed vector with ID values.  This
implies we'd have to add support for reading multiple side IDs as well
though...

-- 
John

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to