Dear Prof. Bangerth,

Thank you very much! 
FEFieldFunction<dim> fe_function_finest (dof_handler_finest, solution_finest
);
And I can use the fe_function_finest in function:  VectorTools::
integrate_difference 

And now I have another question: I want to compute numerical solutions in 
different widths of meshgrid, so I need different triangulations, 
dof_handlers, solution vectors. And I need to compute the finest one at 
first because I need to use the solution_finest as the 'exact solution'. 
The question is how to coarse the meshgrid after getting the 
solution_finest? If I want to refine the mesh, I will use 
'triangulation.refine(1)'. But I don't know how to coarse the mesh. Or 
maybe I have to define different triangulations, dof_handlers at first, and 
compute different solution vectors. If so, the code will be very long. 
Thank you very much!

Best,
Chucui

>
> You can't do this directly -- the function just wants an object that can 
> be evaluated at arbitrary points. Passing a vector by itself will not 
> help: a vector is just a bunch of numbers, but it does not by itself 
> explain how it is to be interepreted. Indeed, a vector by itself is 
> meaningless unless you also specify a DoFHandler that makes the 
> connection between nodal values, where these nodes are located in 
> physical space, and how the shape functions are defined. 
>
> But there is a class that combines all of this knowledge and that then 
> represents a finite element field (=DoFHandler + Vector) as a function: 
> FEFieldFunction. Take a look at that class, as it implements the 
> interface of a Function object that can be passed in the place you point 
> out. It is not particularly fast, but should allow you to do what you 
> want. 
>
> Of course, you have to make sure that both the 'dof' and 'fe_function' 
> arguments to the VectorTools::integrate_difference() function match 
> (i.e., you can't just save a solution vector, and then refine the 
> triangulation and thereby change the DoFHandler), as well as the 
> DoFHandler and Vector objects you pass to FEFieldFunction. 
>
> Best 
>   W. 
>
>
> -- 
> ------------------------------------------------------------------------ 
> Wolfgang Bangerth          email:                 bang...@colostate.edu 
> <javascript:> 
>                             www: http://www.math.colostate.edu/~bangerth/ 
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to