[dune-fem] A question about P1 Lagrange vector-valued function in DUNE-FEM

Andreas Dedner A.S.Dedner at warwick.ac.uk
Tue May 22 17:25:40 CEST 2012


Hi,

you need to use the evaluate method on the local function. The 
coordinates are given by the corners of the reference element, etwa:
       for( IteratorType it = dfSpace.begin(); it != end; ++it )
       {
         const EntityType &entity = *it;
         const Dune::GenericReferenceElement< ctype, dim > &refElement
               = Dune::GenericReferenceElements< ctype, dim >::general(
                 entity.type() );
         for( unsigned int corner = 0; corner < refElement.size(dim);
                        ++corner )
         {
           RangeType y;
           LocalFunctionType lu = u.localFunction( entity );
           lu.evaluate( refElement.position( corner, dim ), y );
          }
        }
Gruss
Andreas

On 22/05/12 15:56, Sacconi, Andrea wrote:
> Hi all,
>
> suppose you have a P1 Lagrange vector-valued function, defined over a
> certain grid in R^3.
> Given a solution of my problem represented by such a function, I need to
> know the value taken by the solution (which is naturally a 3-component
> vector) in each vertex and then calculate the lenght of such a vector.
> I need specifically this vertex-wise information, for experimental
> convergence purposes.
>
> How can I extract such a 3-component vector?
>
> The instance of the solution is the following:
>
> DiscretePositionFunctionType discrete_position_solution (
> "discrete_position_solution", dfpSpace );
>
> where the type is:
>
> typedef Dune::AdaptiveDiscreteFunction <
> DiscretePositionFunctionSpaceType > DiscretePositionFunctionType;
>
> and dfpSpace is an instance of the corresponding space type:
>
> typedef Dune::LagrangeDiscreteFunctionSpace<
> VectorPositionFunctionSpaceType, GridPartType, vectorPolynomialOrder >
> DiscretePositionFunctionSpaceType;
>
>
> Thanks a lot !!!
>
> Andrea
> __________________________________________________________
>
> Andrea Sacconi
> PhD student, Applied Mathematics
> AMMP Section, Department of Mathematics, Imperial College London,
> London SW7 2AZ, UK
> a.sacconi11 at imperial.ac.uk
>
>
> _______________________________________________
> dune-fem mailing list
> dune-fem at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-fem





More information about the dune-fem mailing list