Re: [Libmesh-users] szabab shape function: possible error

2016-10-19 Thread Roy Stogner


On Wed, 19 Oct 2016, John Peterson wrote:


On Wed, Oct 19, 2016 at 7:19 AM, Roy Stogner  wrote:

  On Tue, 18 Oct 2016, Manav Bhatia wrote:

Seems like this was added in “65cde6a” on 5/17/14.
Was this intended?

  Intended, but not correctly, I believe.  It looks like John was going
  through the code looking for switch statements with no default (which

Nice try, Roy.  You added that default case in fb94e262.


Ha!  Sorry; I just did a quick "git log 65cde6a"; wasn't trying to
dodge blame.


Furthermore, "git log -p fb94e262 -- src/fe/fe_szabab_shape_2D.C"
shows that 10 similar default cases were added in the same commit,
so we probably want to remove all of them...


Will do.  I'll put up a PR soon.
---
Roy--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users


Re: [Libmesh-users] szabab shape function: possible error

2016-10-19 Thread John Peterson
On Wed, Oct 19, 2016 at 7:19 AM, Roy Stogner 
wrote:

>
> On Tue, 18 Oct 2016, Manav Bhatia wrote:
>
> Seems like this was added in “65cde6a” on 5/17/14.
>> Was this intended?
>>
>
> Intended, but not correctly, I believe.  It looks like John was going
> through the code looking for switch statements with no default (which
>

Nice try, Roy.  You added that default case in fb94e262.

Furthermore, "git log -p fb94e262 -- src/fe/fe_szabab_shape_2D.C" shows
that 10 similar default cases were added in the same commit, so we probably
want to remove all of them...

-- 
John
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users


Re: [Libmesh-users] szabab shape function: possible error

2016-10-19 Thread Roy Stogner


On Tue, 18 Oct 2016, Manav Bhatia wrote:

Seems like this was added in “65cde6a” on 5/17/14. 


Was this intended?


Intended, but not correctly, I believe.  It looks like John was going
through the code looking for switch statements with no default (which
in many parts of the FE code would imply a silent error if no case
statement was hit) and adding a default error message to catch those
errors.

In the code you're tripping, though, the correct default behavior was
already there: the switch statement does a sign flip for
reverse-oriented edge dofs, but should do nothing for non-edge DoFs!

I'll wait for John's input but it looks like we ought to just delete
the default statement and add some test coverage for SZABAB.  You
could do the former yourself to get up and running quickly.
---
Roy--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users


Re: [Libmesh-users] szabab shape function: possible error

2016-10-18 Thread Manav Bhatia
Seems like this was added in “65cde6a” on 5/17/14. 

Was this intended? 

-Manav

> On Oct 18, 2016, at 9:40 PM, Manav Bhatia  wrote:
> 
> Hi, 
> 
>I am using SZABAB shape functions with QUAD9 element, and am tripping the 
> error in the "default:” case for the enum in lines 208-228 in 
> fe_szabab_shape_2D.C (shown below). 
> 
>I had successfully used this combination about 3 years ago, so I am not 
> sure what, if anything, has changed in libMesh for this. 
> 
>Could someone please comment on the intent of the error message? 
> 
> Thanks,
> Manav
> 
> 
> 
> 
>  switch(i)
> {
> case  5: // edge 0 points
>   if (elem->point(0) > elem->point(1))f = -1.;
>   break;
> case  7: // edge 1 points
>   if (elem->point(1) > elem->point(2))f = -1.;
>   break;
> case  9: // edge 2 points
>   if (elem->point(3) > elem->point(2))f = -1.;
>   break;
> case 11: // edge 3 points
>   if (elem->point(0) > elem->point(3))f = -1.;
>   break;
> 
> default:
>   libmesh_error_msg("Invalid shape function index i = " << i);
> }
> 
>   return f*(FE<1,SZABAB>::shape(EDGE3, totalorder, i0[i], xi)*
> FE<1,SZABAB>::shape(EDGE3, totalorder, i1[i], eta));
> 

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users