[Libmesh-devel] Side key computing method for Prism18

2010-07-17 Thread Liu Kai
Hi,

   I notice the find_neighbors() method seems not to give a correct 
answer when a Prism18 cell is adjacent to a Hex27 cell. When I trace the 
problem, I find for the side composing of same nodes, the two types 
cell's key() method override don't compute the same key value.

   Hex27::key() is a re-implement overriding Hex::key() because it can 
use the quad center node to compute a unique key. But the Prism18::key() 
does not do anything special for the quad side, though they have center 
node as well. So they give difference key.

   I have tried to add a re-implement version for Prism18::key() and it 
seems to work well, I put it at the tail of this mail. Am I right? Any 
suggestion or explanation is appreciated.

Kai

int Prism18::key (int s) const
{
 SEASOLVER_ASSERT (s < this->n_sides());

 switch (s)
 {
 case 0:  // the triangular face at z=0
 {
 return Prism::key(0);
 }
 case 1:  // the quad face at y=0
 {
 return Elem::compute_key (this->node(15));
 }
 case 2:  // the other quad face
 {
 return Elem::compute_key (this->node(16));
 }
 case 3: // the quad face at x=0
 {
 return Elem::compute_key (this->node(17));
 }
 case 4: // the triangular face at z=1
 {
 return Prism::key(4);
 }
 }

 // We'll never get here.
 SEASOLVER_ERROR();
 return 0;
}

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel


[Libmesh-devel] Why not use boost::bimap to implement string_to_enum ?

2009-11-18 Thread Liu Kai
Hi all,

  I find that things like string_to_enum and enum_to_string in src/utils
are exactly bi-direction map, which has been well implemented in boost
library. So why not use the boost::bimap to implement these
functionality, instead of implement the same thing by hand?

  I just want to know if the reason is boost::bimap has some potential
problems, or is it a historical reason?

  Best regards,

Kai


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel