On Thu, 2 Dec 2010, Boyce Griffith wrote:

> OK --- attached is a patch.  Most of it is just re-indenting.  (I wasn't 
> always careful about using tabs instead of spaces --- is there a convention 
> that you all prefer to use?)

The ideal thing to do is tabs for indentation, spaces for alignment.
So if you're two nested loops in, you might have

<TAB><TAB>function_call(arg1,
<TAB><TAB><14 SPACES>arg2);

and arg1 and arg2 will line up regardless of people's tab settings,
and all will be right with the world.

It's never done this way in libMesh.  Personally I'm too lazy even to
figure out the proper vim settings to do it automatically, much less
to do it by hand.

Next best is all-spaces.  Annoyingly hard-coded, but at least it
shouldn't break when someone has a tabstop set to 4 instead of 8.
It's what I try to do.

Last best is automatically replacing every 8 spaces with a tab.  This
is worthless.  It's also probably the most or second-most common style
in libMesh.

One of these days we need to figure out how to nicely configure one of
those automatic reformatting tools, then just require everyone to run
a pass of that before committing, to at least avoid those situations
where svn diffs end up bloated by unnoticed whitespace changes.

(where by "one of these days" I mean "probably never"; recall the "too
lazy" discussion above)

> I believe that this patch replaces most calls to BoundaryInfo::boundary_id() 
> in core libMesh with calls to BoundaryInfo::boundary_ids() followed by a loop 
> over the IDs.

This looks good; I just committed it.

> The implementation of MeshTools::Modification::change_boundary_id() is 
> somewhat more complicated.  I wasn't sure whether the boundary ID returned by 
> BoundaryInfo::boundary_id() depended on the order in which the IDs are added 
> to the side, so I took the somewhat paranoid approach of removing all of the 
> IDs, running std::replace on the IDs, and then re-adding all of the IDs.

I believe the current implementation is independent of the order in
which IDs are added, but I'd hate to guarantee that that won't change
in the future; thanks for worrying about the robustness.
---
Roy

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Libmesh-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to