On 12/10/18 10:17 AM, Hamed Babaei wrote:
> 
> I would like to forcefully determine the solution at some regions of my 
> domain 
> in which I solve an initial value problem. Therefore, I chose to 
> use VectorTools::interpolate_based_on_material_id function to implement the 
> desired constant value for solution vector within particular regions for 
> which 
> I designate different material_ID. However, the problem is that despite the 
> function description saying:
> 
> "If a material id of some group of cells is missed in |function_map|, then 
> |dst| will not be updated in the respective degrees of freedom of the output 
> vector For example, if |dst| was successfully initialized to capture the 
> degrees of freedom of the |dof_handler| of the problem with all zeros in it, 
> then those zeros which correspond to the missed material ids will still 
> remain 
> in |dst| even after calling this function."
> 
> I receive -nan value for the cells whose material id is not included in 
> function_map when using the interpolate_based_on_material_idfunction.  
> However, if I include all the material ids in the function_map it works as 
> expected for the entire domain. This is not what I need because I would like 
> to keep solution constant only for a small part of the domain, not the entire 
> domain.
> 
> I really appreciate it if you could give me any clue about where I am making 
> mistake using this function. Please find attached the minimal code for your 
> review.

Hamed,
when I run your little program (nice job reducing it, by the way!) then I get 
the following output:


  Initial values:
0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 
0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 
0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 
0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 
0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 
0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 
0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 
0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 
0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 
0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 
0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 
0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 
0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 
0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 
0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 
0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 
0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 
0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00
  Final values:
1.000e+00 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1.000e+00 
1.000e+00 1.500e+00 1.500e+00 1.500e+00 1.500e+00 2.000e+00 2.000e+00 
2.000e+00 2.000e+00 2.000e+00 2.000e+00 2.000e+00 2.000e+00 1.000e+00 
1.000e+00 1.000e+00 1.000e+00 1.500e+00 1.500e+00 2.000e+00 2.000e+00 
2.000e+00 2.000e+00 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1.500e+00 
1.500e+00 2.000e+00 2.000e+00 2.000e+00 2.000e+00 1.000e+00 1.000e+00 
1.000e+00 1.000e+00 1.500e+00 1.500e+00 2.000e+00 2.000e+00 2.000e+00 
2.000e+00 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1.500e+00 1.500e+00 
2.000e+00 2.000e+00 2.000e+00 2.000e+00 1.000e+00 1.000e+00 1.500e+00 
2.000e+00 2.000e+00 1.000e+00 1.000e+00 1.500e+00 2.000e+00 2.000e+00 
1.000e+00 1.000e+00 1.500e+00 2.000e+00 2.000e+00 1.000e+00 1.000e+00 
1.000e+00 1.000e+00 1.500e+00 1.500e+00 2.000e+00 2.000e+00 2.000e+00 
2.000e+00 1.000e+00 1.000e+00 1.500e+00 2.000e+00 2.000e+00 1.000e+00 
1.000e+00 1.500e+00 2.000e+00 2.000e+00 1.000e+00 1.000e+00 1.500e+00 
2.000e+00 2.000e+00 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1.500e+00 
1.500e+00 2.000e+00 2.000e+00 2.000e+00 2.000e+00 1.000e+00 1.000e+00 
1.500e+00 2.000e+00 2.000e+00 1.000e+00 1.000e+00 1.500e+00 2.000e+00 
2.000e+00 1.000e+00 1.000e+00 1.500e+00 2.000e+00 2.000e+00

In other words, there are no NaNs for me. What do you get? And what version of 
deal.II are you using?

Best
  W.


-- 
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 bange...@colostate.edu
                            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