Hi James, actually you'd have to exchange the cases Wolfgang gave below, see the documentation of GeometryInfo<dim>.
Furthermore, you might also consider the following alternative approach: a) Compute the volume/area of the cell by numerical quadrature (using FEValues). b) Compute the area/length of the faces of the cell by numerical quadrature (using FEFaceValues). c) Obtain an estimate of the length in one direction by dividing the cell volume by the mean value of the area of the two faces that are orthogonal to that direction (faces 0 and 1 for direction x(or 0)). Best, Tobias -----Ursprüngliche Nachricht----- Von: [email protected] im Auftrag von Wolfgang Bangerth Gesendet: Mi 05.05.2010 19:21 An: [email protected] Cc: James Avery Betreff: Re: [deal.II] Measuring aspect ratios of cells for anisotropicrefinement James, > However, I have been unable to find out how to find the cell > dimensions, specifically the length along each axis, in order to get > the aspect ratio and thus decide how the cell should be divided. Can > someone tell me how this is done? We don't have a function that does that right now, but it should be relatively easy to add one. For example, in 2d, you'd have a function like this: double TriaAccessor::extent_in_direction (const unsigned int direction) const { switch (direction) { case 0: return std::max(this->line(0)->diameter(), this->line(1)->diameter()); case 1: return std::max(this->line(2)->diameter(), this->line(3)->diameter()); default: Assert (false, ExcIndexRange (direction, 0, 2)); } 3d would be similar. If you wanted to implement a function like this, we'd be happy to add it to the library! Best W. _______________________________________________ dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
