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

Sacconi, Andrea a.sacconi11 at imperial.ac.uk
Tue May 22 18:06:20 CEST 2012


So, if I'm not mistaken:

1) RangeType should be a vector in R^3;
2) u is the solution of my problem, and it's a vector-valued function in R^3 as well.

Is that right?

Cheers,

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

________________________________________
From: dune-fem-bounces+a.sacconi11=imperial.ac.uk at dune-project.org [dune-fem-bounces+a.sacconi11=imperial.ac.uk at dune-project.org] on behalf of Andreas Dedner [A.S.Dedner at warwick.ac.uk]
Sent: 22 May 2012 16:25
To: dune-fem at dune-project.org
Subject: Re: [dune-fem] A question about P1 Lagrange vector-valued function in DUNE-FEM

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


_______________________________________________
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