Re: [deal.II] Applying boundary masks when using project_boundary_values()

2019-05-17 Thread Wolfgang Bangerth
On 5/16/19 2:41 PM, 'Maxi Miller' via deal.II User Group wrote:
> If I understand that correctly, the correct order for doing that would be:
> -> Interpolate boundary condition without any component mask, giving me a 
> vector
> -> Loop over all elements in the vector, and cross-check with the mask (using 
> extract_dofs()) if they should be interpolated in that way
> -> If yes, copy them to a second vector
> -> Repeat with the next boundary condition and new component mask
> -> After finishing: Replace first vector with second vector (or use a 
> temporary vector as first vector)
> Is that correct?
> In addition: How do I treat different boundary markings, i.e. 
> dirichlet-conditions on 0, neumann-conditions on 1, and similar stuff?

Something of this sort. Of course, if you had sorted your DoFs by component 
(for example if you wanted to put things into a block vector), then the check 
whether a particular DoF belongs to a particular component becomes pretty 
trivial.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/6b4003a6-04cf-9d51-6383-72034f9818ed%40colostate.edu.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Applying boundary masks when using project_boundary_values()

2019-05-16 Thread 'Maxi Miller' via deal.II User Group
If I understand that correctly, the correct order for doing that would be:
-> Interpolate boundary condition without any component mask, giving me a 
vector
-> Loop over all elements in the vector, and cross-check with the mask 
(using extract_dofs()) if they should be interpolated in that way
-> If yes, copy them to a second vector
-> Repeat with the next boundary condition and new component mask
-> After finishing: Replace first vector with second vector (or use a 
temporary vector as first vector)
Is that correct?
In addition: How do I treat different boundary markings, i.e. 
dirichlet-conditions on 0, neumann-conditions on 1, and similar stuff?
Thanks!

Am Donnerstag, 16. Mai 2019 19:20:59 UTC+2 schrieb Wolfgang Bangerth:
>
> On 5/15/19 8:37 AM, 'Maxi Miller' via deal.II User Group wrote: 
> > I have to replace VectorTools::interpolate_boundary_values with 
> > VectorTools::project_boundary_values at several places in my project. I 
> could 
> > apply the boundary values only for certain parts in my FESystem using 
> > component masks, but I can not use those masks in 
> project_boundary_values(). 
> > What would be the best approach for replacing them in this function? 
>
> That's a question that has been asked repeatedly in the recent past. In 
> other 
> words, there is clearly a demand to make this work, but nobody has found 
> the 
> time to implement it. So, if you want to do it right, the best place to 
> implement this is probably in the library itself. 
>
> But if you want to do it cheaply, you can always interpolate *all* 
> components 
> of your solution. You'd then either get a std::map or AffineMatrix object, 
> and 
> you will have to filter out those elements that do not match the 
> components 
> you are interested in. In practice, it's probably easier to just go 
> through 
> all elements of these objects, see which ones you care about (using 
> DoFTools::extracy_dofs()), and copy them to a second object. 
>
> If you want help to get this into the library, let us know! 
>
> Best 
>   W. 
>
> -- 
>  
> Wolfgang Bangerth  email: bang...@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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/0ed11fe9-4ee1-4b91-a86f-5db7b696c419%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Applying boundary masks when using project_boundary_values()

2019-05-16 Thread Wolfgang Bangerth
On 5/15/19 8:37 AM, 'Maxi Miller' via deal.II User Group wrote:
> I have to replace VectorTools::interpolate_boundary_values with 
> VectorTools::project_boundary_values at several places in my project. I could 
> apply the boundary values only for certain parts in my FESystem using 
> component masks, but I can not use those masks in project_boundary_values(). 
> What would be the best approach for replacing them in this function?

That's a question that has been asked repeatedly in the recent past. In other 
words, there is clearly a demand to make this work, but nobody has found the 
time to implement it. So, if you want to do it right, the best place to 
implement this is probably in the library itself.

But if you want to do it cheaply, you can always interpolate *all* components 
of your solution. You'd then either get a std::map or AffineMatrix object, and 
you will have to filter out those elements that do not match the components 
you are interested in. In practice, it's probably easier to just go through 
all elements of these objects, see which ones you care about (using 
DoFTools::extracy_dofs()), and copy them to a second object.

If you want help to get this into the library, let us know!

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/f504e17d-6807-65a0-ebeb-9870266cb0be%40colostate.edu.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Applying boundary masks when using project_boundary_values()

2019-05-15 Thread 'Maxi Miller' via deal.II User Group
I have to replace VectorTools::interpolate_boundary_values with 
VectorTools::project_boundary_values at several places in my project. I 
could apply the boundary values only for certain parts in my FESystem using 
component masks, but I can not use those masks in 
project_boundary_values(). What would be the best approach for replacing 
them in this function?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/a86d0863-20f1-43ca-8742-cefbd81a6db7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.