Re: [deal.II] Development based on step-25

2021-09-15 Thread Toddy Liu
Hello, professor Wolfgang

Thank you very much for your reply and it really helps me. You explained 
how to deal with the latter case (V'(u) . grad u, phi_i) and I've got the 
point how to solve this. Addtionally. how about the former case -(V(u), 
grad phi_i). Specifically, how to construct the vector V(u) and then 
multiply with grad phi_i or to say fe_values.shape_grad(i,q_point)?

Thank you very much!

Best,
Toddy
在2021年9月16日星期四 UTC+8 上午11:45:40 写道:

> On 9/15/21 6:33 AM, Toddy Liu wrote:
> > 
> > I'm getting trouble in developing new code based on step-25. In step-25, 
> the 
> > equation to be solved is u_tt−∆u=−sin(u) and the tutorial shows me how 
> to 
> > solve such a nonlinear problem.
> > 
> > Specifically, the tutorial tells me how to calculate (sin(u),φ_j)_Ω in 
> detail. 
> > So I 'm wondering how to solve such a problem which is like u_tt−∆u=∇∙V, 
> where 
> > V is a vector and its components(x direction and y direction in 2D) are 
> > dependent on u. So could you please give me some advice about doing this 
> or 
> > any reference in existing dealii examples.
>
> The standard point of departure is always the weak formulation of the 
> problem. 
> In your case, you will have a right hand side of the following form:
>
> (div V(u), phi_i)
>
> for which you can decide whether you want to integrate it by parts to get
>
> -(V(u), grad phi_i) + boundary terms
>
> or whether you want to leave it as is. If the latter, then you have to 
> apply 
> the chain rule and get something along the lines of
>
> (V'(u) . grad u, phi_i)
>
> which you have to deal with in much the same way as if you just had
>
> (sin(u), phi_i)
>
> except that you also have terms that involve derivatives of u.
>
> Does that make sense?
>
> 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/e3ea5c84-8bfc-4133-9989-136fdcba6e2dn%40googlegroups.com.


Re: [deal.II] Development based on step-25

2021-09-15 Thread Wolfgang Bangerth

On 9/15/21 6:33 AM, Toddy Liu wrote:


I'm getting trouble in developing new code based on step-25. In step-25, the 
equation to be solved is u_tt−∆u=−sin(u) and the tutorial shows me how to 
solve such a nonlinear problem.


Specifically, the tutorial tells me how to calculate (sin(u),φ_j)_Ω in detail. 
So I 'm wondering how to solve such a problem which is like u_tt−∆u=∇∙V, where 
V is a vector and its components(x direction and y direction in 2D) are 
dependent on u. So could you please give me some advice about doing this or 
any reference in existing dealii examples.


The standard point of departure is always the weak formulation of the problem. 
In your case, you will have a right hand side of the following form:


  (div V(u), phi_i)

for which you can decide whether you want to integrate it by parts to get

  -(V(u), grad phi_i) + boundary terms

or whether you want to leave it as is. If the latter, then you have to apply 
the chain rule and get something along the lines of


  (V'(u) . grad u, phi_i)

which you have to deal with in much the same way as if you just had

  (sin(u), phi_i)

except that you also have terms that involve derivatives of u.

Does that make sense?

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/aafb0807-fac2-040a-8563-c47ca6835166%40colostate.edu.


[deal.II] Re: What I learned from 20 years of leading open source projects

2021-09-15 Thread Wolfgang Bangerth



in case you wonder what is going on in the heads of the principal developers 
of deal.II: I will be giving a webinar tomorrow on this topic:


https://bssw.io/events/webinar-what-i-learned-from-20-years-of-leading-open-source-projects 

I believe that you have to register (it's free!) but also think that the talk 
will be recorded for later viewing if you can't attend at the time.


That video is now here:
  https://www.youtube.com/watch?v=qIsWdD2BU3g

Best
 Wolfgang

--

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/4b0ce902-19e7-85ee-4c9d-1f07d62bf0c9%40colostate.edu.


Re: [deal.II] MatrixTools::apply_boundary_values for BlockSparseMatrix> and BlockVector> entries

2021-09-15 Thread Daniel Arndt
Mariia,

That's a problem a little more complicated to solve. Basically, we are not
instantiating the template for complex and BlockSparseMatrix.
If you are OK with recompiling deal.II, you should modify source/numerics/
matrix_tools.inst.in so that all overloads are also compiled for complex
numbers.
Otherwise, copy
https://github.com/dealii/dealii/blob/7439f2b0b4d210d237e8df53f12f47c242cfac3f/source/numerics/matrix_tools.cc#L240-L499
somewhere in your source code.

Best,
Daniel

Am Mi., 15. Sept. 2021 um 09:10 Uhr schrieb Мария Бронзова <
masianic...@gmail.com>:

> Dear Daniel,
>
> Thank you a lot for the hint, it makes perfect sense! I also correctted the*
> interpolate_boundary_values* call as follows:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *templateclass DirichletBoundaryValues : public Function std::complex>   {   public:  DirichletBoundaryValues():
> Function>(1)   {}  virtual
> std::complex value(const Point &p, const unsigned int
> component = 1) const override;   };   template 
> std::complex DirichletBoundaryValues::value(const Point &
> p,   const unsigned int /*component*/) const   {  const
> std::complex i = {0,1};  return i;   }*
>
>
>
>
>
>
>
>
>
>
>
>
> * FEValuesExtractors::Scalar pressures(dim);
> std::map> boundary_values;
>   VectorTools::interpolate_boundary_values(dof_handler, 1,
> DirichletBoundaryValues(), boundary_values,
> fe.component_mask(pressures));
> MatrixTools::apply_boundary_values(boundary_values,   system_matrix,
> solution,   system_rhs);*
>
> And now getting the following error:
> undefined reference to 'void
> dealii::MatrixTools::apply_boundary_values
> >(std::map, std::less,
> std::allocator > > >
> const&, dealii::BlockSparseMatrix >&,
> dealii::BlockVector >&,
> dealii::BlockVector >&, bool)'
>
> I am a bit lost, what it could be connected to. Would appreciate any hints!
>
> Thank you a lot for your time!
>
> Kind regards,
> Mariia Bronzova
>
> вторник, 14 сентября 2021 г. в 16:33:44 UTC+2, d.arnd...@gmail.com:
>
>> Mariia,
>>
>> You need to make sure that the std::map also uses values of type
>> std::complex. The compile error you shared shows that you use
>> doubles.
>>
>> Best,
>> Daniel
>>
>> Am Di., 14. Sept. 2021 um 07:30 Uhr schrieb Мария Бронзова <
>> masia...@gmail.com>:
>>
>>> Hi everyone,
>>>
>>> I ran into the following difficulty: I have a vector-valued problem with
>>> complex numbers as entries for my BlockSparseMatrix system_matrix and
>>> BlockVector system_rhs and solution vectors and I am trying to apply
>>> Dirichlet boundary conditions, using the
>>> MatrixTools::apply_boundary_values(boundary_values, system_matrix,
>>> solution, system_rhs) function.
>>>
>>> The compiler is complaining, indicating the error: no matching function
>>> for call to ‘apply_boundary_values(std::map&,
>>> dealii::BlockSparseMatrix >&,
>>> dealii::BlockVector >&,
>>> dealii::BlockVector >&)’.
>>>
>>> Is it not possible to use the function for complex-values systems?
>>>
>>> Thank you!
>>>
>>> Kind regards,
>>> Mariia
>>>
>>> --
>>> 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+un...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/dealii/aa6ad6fa-7404-4617-bff3-3f108d2b6001n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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/4a66ce86-5e20-4a5e-a28b-0073d2cfb185n%40googlegroups.com
> 
> .
>

-- 
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/CAOYDWbLsbfraH%2Bqdt5zptyEYdG1Dk0OS0xYyVwO7D-8t0HNUeQ%40mail.gmail.com.


Re: [deal.II] MatrixTools::apply_boundary_values for BlockSparseMatrix> and BlockVector> entries

2021-09-15 Thread Мария Бронзова
Dear Daniel, 

Thank you a lot for the hint, it makes perfect sense! I also correctted the* 
interpolate_boundary_values* call as follows: 


















*templateclass DirichletBoundaryValues : public Function>   {   public:  DirichletBoundaryValues(): 
Function>(1)   {}  virtual 
std::complex value(const Point &p, const unsigned int 
component = 1) const override;   };   template
std::complex DirichletBoundaryValues::value(const Point & 
p,   const unsigned int /*component*/) const   {  const 
std::complex i = {0,1};  return i;   }*

 










* FEValuesExtractors::Scalar pressures(dim); 
std::map> boundary_values;   
  VectorTools::interpolate_boundary_values(dof_handler, 1, 
DirichletBoundaryValues(), boundary_values, 
fe.component_mask(pressures)); 
MatrixTools::apply_boundary_values(boundary_values,   system_matrix,   
solution,   system_rhs);*

And now getting the following error:
undefined reference to 'void 
dealii::MatrixTools::apply_boundary_values 
>(std::map, std::less, 
std::allocator > > > 
const&, dealii::BlockSparseMatrix >&, 
dealii::BlockVector >&, 
dealii::BlockVector >&, bool)'

I am a bit lost, what it could be connected to. Would appreciate any hints!

Thank you a lot for your time!

Kind regards,
Mariia Bronzova

вторник, 14 сентября 2021 г. в 16:33:44 UTC+2, d.arnd...@gmail.com: 

> Mariia,
>
> You need to make sure that the std::map also uses values of type 
> std::complex. The compile error you shared shows that you use 
> doubles.
>
> Best,
> Daniel
>
> Am Di., 14. Sept. 2021 um 07:30 Uhr schrieb Мария Бронзова <
> masia...@gmail.com>:
>
>> Hi everyone,
>>
>> I ran into the following difficulty: I have a vector-valued problem with 
>> complex numbers as entries for my BlockSparseMatrix system_matrix and 
>> BlockVector system_rhs and solution vectors and I am trying to apply 
>> Dirichlet boundary conditions, using the 
>> MatrixTools::apply_boundary_values(boundary_values, system_matrix, 
>> solution, system_rhs) function. 
>>
>> The compiler is complaining, indicating the error: no matching function 
>> for call to ‘apply_boundary_values(std::map&, 
>> dealii::BlockSparseMatrix >&, 
>> dealii::BlockVector >&, 
>> dealii::BlockVector >&)’.
>>
>> Is it not possible to use the function for complex-values systems?
>>
>> Thank you!
>>
>> Kind regards,
>> Mariia
>>
>> -- 
>> 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+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/dealii/aa6ad6fa-7404-4617-bff3-3f108d2b6001n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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/4a66ce86-5e20-4a5e-a28b-0073d2cfb185n%40googlegroups.com.


[deal.II] Development based on step-25

2021-09-15 Thread Toddy Liu
Dear Deal.II community,

I'm getting trouble in developing new code based on step-25. In step-25, 
the equation to be solved is u_tt−∆u=−sin(u) and the tutorial shows me how 
to solve such a nonlinear problem.

Specifically, the tutorial tells me how to calculate (sin(u),φ_j)_Ω in 
detail. So I 'm wondering how to solve such a problem which is like 
u_tt−∆u=∇∙V, where V is a vector and its components(x direction and y 
direction in 2D) are dependent on u. So could you please give me some 
advice about doing this or any reference in existing dealii examples.

Thank you very much.

-- 
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/62538aad-a516-4c49-a069-c753863752b8n%40googlegroups.com.


[deal.II] Re: Convective Heat Flux Boundary Conditions in deall ii?

2021-09-15 Thread Morris Jowas
Update: Please disregard my last question. I found some guidance on this 
thread from 2013 concerning Robin 
BCs: https://groups.google.com/g/dealii/c/JSWctuiEVoc/m/8Im_ME_8f6wJ

Thanks again,

MJ

On Wednesday, September 15, 2021 at 2:21:10 AM UTC+1 Morris Jowas wrote:

> Hello everyone,
>
>  
>
> I am trying to solve a simple thermal problem  but finding the 
> documentation helpfully detailed yet overwhelming. My problem is on heat 
> conduction within a cubic domain with internal heat generation. 
>
>  I have studied the transient heat transfer problem in step 26, in 
> addition to the laplace problem solved on a 3D domain in step 4, as well as 
> the problem in Step 7 where Neumann boundary conditions are applied. These 
> have gotten me up and running.
>
> However, *I am stuck on how to apply a convective heat flux boundary 
> condition of the form: q = h(T-T_ext) programmatically*, whereby I must 
> choose the external temperature (T_ext) and the heat transfer coefficient 
> *(h)* to define the boundary condition. Is this possible to do in deal 
> ii? If so, how might one go about it? I would appreciate any existing 
> implementation of convective heat flux BCs that I can build up on. 
>
>  
>
> Thank you everyone,
>
>  
>
> Morris
>

-- 
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/3f2d1f74-31e7-4b02-b9e9-72d43cd80102n%40googlegroups.com.


Re: [deal.II] MatrixTools::apply_boundary_values for BlockSparseMatrix> and BlockVector> entries

2021-09-15 Thread Мария Бронзова
Dear Daniel,

Thank you a lot for the hint, makes perfect sense! The 
MatrixTools::apply_boundary_values works well now! But I believe i also 
need to adjust the VectorTools::interpolate_boundary_values accordingly. 
Right now i have defined a template for pressure component boundary values:

template 
class PressureBoundaryValues : public Function
{
public:
virtual std::complex value(const Point &p,
  const 
unsigned int component = 1) const override; //component 1 for the pressure 
block in vector-valued problem
}

template 
std::complex PressureBoundaryValues::value(const Point &p,

const unsigned int /*component*/) const
{
const std::complex i = {0,1};
return i;
}

And later I am using:

VectorTools::interpolate_boundary_values(dof_handler, 

1, 

PressureBoundaryValues(), 

boundary_values, 

fe.component_mask(pressures));

The compiler complains with: 'error: no matching function for call to 
‘interpolate_boundary_values(dealii::DoFHandler<3, 3>&, int, 
Poroacoustics::PressureBoundaryValues<3>, std::map >&, dealii::ComponentMask)’.

Could you please give me a hand on this issue as well? Thank you a lot!

Kind regards,
Mariia


вторник, 14 сентября 2021 г. в 16:33:44 UTC+2, d.arnd...@gmail.com: 

> Mariia,
>
> You need to make sure that the std::map also uses values of type 
> std::complex. The compile error you shared shows that you use 
> doubles.
>
> Best,
> Daniel
>
> Am Di., 14. Sept. 2021 um 07:30 Uhr schrieb Мария Бронзова <
> masia...@gmail.com>:
>
>> Hi everyone,
>>
>> I ran into the following difficulty: I have a vector-valued problem with 
>> complex numbers as entries for my BlockSparseMatrix system_matrix and 
>> BlockVector system_rhs and solution vectors and I am trying to apply 
>> Dirichlet boundary conditions, using the 
>> MatrixTools::apply_boundary_values(boundary_values, system_matrix, 
>> solution, system_rhs) function. 
>>
>> The compiler is complaining, indicating the error: no matching function 
>> for call to ‘apply_boundary_values(std::map&, 
>> dealii::BlockSparseMatrix >&, 
>> dealii::BlockVector >&, 
>> dealii::BlockVector >&)’.
>>
>> Is it not possible to use the function for complex-values systems?
>>
>> Thank you!
>>
>> Kind regards,
>> Mariia
>>
>> -- 
>> 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+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/dealii/aa6ad6fa-7404-4617-bff3-3f108d2b6001n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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/fd8a26df-42e2-4e01-aadf-7061d5f697d0n%40googlegroups.com.