Re: [deal.II] Question about how to get the Stiffness matrix partial derivative with respect to density

2023-08-10 Thread blais...@gmail.com
Dear Lance,
It would be easier if you posted the PDE you wish to solve and it's weak 
form. This would enable us to help you write the Jacobian for it.
Currently, it is difficult to fully understand what you are trying to 
achieve.
Best
Bruno

On Monday, July 24, 2023 at 4:13:21 p.m. UTC-4 dim...@gmail.com wrote:

> Hello Wolfgang,
>
> thanks for your reply.
>
> Currently,I would like to get the sensitivity by using gradient of 
> objective function with respect to density.
>
> The Objective function is a vector of movement which is calculated from 
> Ax=b.
>
> J=|x|norm1 is the objective function.
> dJ(x,Θ)/dΘ is the gradient that we will obtain in the end.
>
> We use adjoint method written in previous emails to calculate dJ(x,Θ)/dΘ.
>
> Best regards
> Lance
>
>
>
>
> Wolfgang Bangerth  于 2023年7月24日周一 21:49写道:
>
>> On 7/24/23 11:24, Lance Zhang wrote:
>> > 
>> > One moire question,how could I get  ∂A(θ)/∂θx,because I did not find 
>> any 
>> > information about density vector like  θ=[θ1,θ2,...,θm],may I know if I 
>> have 
>> > to set density vector value in this finite element?
>>
>> Lance -- I have no idea. I don't know the program, but looking at it, I 
>> see no 
>> mention of the word "density" anywhere. Apparently, the person who wrote 
>> the 
>> program implemented an equation in which density does not appear. If you 
>> want 
>> that the density is part of the formulation, you should first write down 
>> what 
>> the specific problem is you want to solve. We can't know what it is you 
>> want 
>> to do. You should then compare what you want to do with what the existing 
>> program does, and change it so that it matches to what you want it to do.
>>
>> 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 a topic in the 
>> Google Groups "deal.II User Group" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/dealii/5IN4HUV1UhY/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> dealii+un...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/dealii/8819fb69-2fc9-a80c-d37d-a45411d0a89b%40colostate.edu
>> .
>>
>

-- 
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/a7dd3648-4eac-47b4-acf3-eab6180aafd0n%40googlegroups.com.


Re: [deal.II] Question about how to get the Stiffness matrix partial derivative with respect to density

2023-07-24 Thread Lance Zhang
Hello Wolfgang,

thanks for your reply.

Currently,I would like to get the sensitivity by using gradient of
objective function with respect to density.

The Objective function is a vector of movement which is calculated from
Ax=b.

J=|x|norm1 is the objective function.
dJ(x,Θ)/dΘ is the gradient that we will obtain in the end.

We use adjoint method written in previous emails to calculate dJ(x,Θ)/dΘ.

Best regards
Lance




Wolfgang Bangerth  于 2023年7月24日周一 21:49写道:

> On 7/24/23 11:24, Lance Zhang wrote:
> >
> > One moire question,how could I get  ∂A(θ)/∂θx,because I did not find any
> > information about density vector like  θ=[θ1,θ2,...,θm],may I know if I
> have
> > to set density vector value in this finite element?
>
> Lance -- I have no idea. I don't know the program, but looking at it, I
> see no
> mention of the word "density" anywhere. Apparently, the person who wrote
> the
> program implemented an equation in which density does not appear. If you
> want
> that the density is part of the formulation, you should first write down
> what
> the specific problem is you want to solve. We can't know what it is you
> want
> to do. You should then compare what you want to do with what the existing
> program does, and change it so that it matches to what you want it to do.
>
> 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 a topic in the
> Google Groups "deal.II User Group" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/dealii/5IN4HUV1UhY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> dealii+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/8819fb69-2fc9-a80c-d37d-a45411d0a89b%40colostate.edu
> .
>

-- 
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/CADwW6PmT1dR%2B_ni60J-oYC792qDpWsimgX%3D5Gacs%3DJK6j0aftQ%40mail.gmail.com.


Re: [deal.II] Question about how to get the Stiffness matrix partial derivative with respect to density

2023-07-24 Thread Wolfgang Bangerth

On 7/24/23 11:24, Lance Zhang wrote:


One moire question,how could I get  ∂A(θ)/∂θx,because I did not find any 
information about density vector like  θ=[θ1,θ2,...,θm],may I know if I have 
to set density vector value in this finite element?


Lance -- I have no idea. I don't know the program, but looking at it, I see no 
mention of the word "density" anywhere. Apparently, the person who wrote the 
program implemented an equation in which density does not appear. If you want 
that the density is part of the formulation, you should first write down what 
the specific problem is you want to solve. We can't know what it is you want 
to do. You should then compare what you want to do with what the existing 
program does, and change it so that it matches to what you want it to do.


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/8819fb69-2fc9-a80c-d37d-a45411d0a89b%40colostate.edu.


Re: [deal.II] Question about how to get the Stiffness matrix partial derivative with respect to density

2023-07-24 Thread Lance Zhang
Hello Wolfgang,

The value of  A^-1(θ))(-∂A(θ)/∂θ)x is what I would like to obtain.

Thanks in advance!
Best regards
Lance

On Monday, July 24, 2023 at 7:24:53 PM UTC+2 Lance Zhang wrote:

> Hello Wolfgang,
>
> thanks for your reply.
>
> I will follow your point to see if I could find the solution.
>
> One moire question,how could I get  ∂A(θ)/∂θx,because I did not find any 
> information about density vector like  θ=[θ1,θ2,...,θm],may I know if I 
> have to set density vector value in this finite element?
>
> Code Link:
> https://www.dealii.org/current/doxygen/code-gallery/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc
>
> mu is invoked from prm file at the position of line 252
> Best regards
> Lance
> On Monday, July 24, 2023 at 6:49:12 PM UTC+2 Wolfgang Bangerth wrote:
>
>> > The given conditions are stiffness matrix,destination function and x 
>> from 
>> > Ax=b,x is movement ,b is force,A is global stiffness matrix. 
>> > J(x)=||x||norm-1 
>>
>> This is a questionable choice because dJ/dx is not defined at x=0. 
>>
>> > There is one equation: 
>> > 
>> > dJ(x,θ)/dθ=∂J(x,θ)/∂θ+∂J(x,θ)/∂x 
>> > *∂x/∂θ=∂J(x,θ)/∂θ+∂J(x,θ)/∂x*[A^-1(θ))(-∂A(θ)/∂θ)x],because b has no 
>> relation 
>> > with density. 
>> > 
>> > I don't know how to get [A^-1(θ))(-∂A(θ)/∂θ)x],A is matrix with nxn,if 
>> θ is 
>> > mx1 vector,∂A(θ)/∂θ is nxnxm matrix. 
>>
>> ∂A(θ)/∂θ)x is an nxm matrix. You want to apply A^{-1} to it. The way you 
>> do 
>> that is to call the result 
>> Y = A^{-1} [∂A(θ)/∂θ)x] 
>> and then each column of Y, call it y_k (k=1...m) is computed as 
>> y_k = A^{-1} {[∂A(θ)/∂θ)x]_k} 
>> which requires solving a linear system 
>> A y_k = {[∂A(θ)/∂θ)x]_k} 
>>
>> You never need A^{-1} explicitly. 
>>
>> 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/385ed5b7-2f0e-4343-b3c9-be3c8b5a73d9n%40googlegroups.com.


Re: [deal.II] Question about how to get the Stiffness matrix partial derivative with respect to density

2023-07-24 Thread Lance Zhang
Hello Wolfgang,

thanks for your reply.

I will follow your point to see if I could find the solution.

One moire question,how could I get  ∂A(θ)/∂θx,because I did not find any 
information about density vector like  θ=[θ1,θ2,...,θm],may I know if I 
have to set density vector value in this finite element?

Code 
Link:https://www.dealii.org/current/doxygen/code-gallery/Quasi_static_Finite_strain_Compressible_Elasticity/cook_membrane.cc

mu is invoked from prm file at the position of line 252
Best regards
Lance
On Monday, July 24, 2023 at 6:49:12 PM UTC+2 Wolfgang Bangerth wrote:

> > The given conditions are stiffness matrix,destination function and x 
> from 
> > Ax=b,x is movement ,b is force,A is global stiffness matrix.
> > J(x)=||x||norm-1
>
> This is a questionable choice because dJ/dx is not defined at x=0.
>
> > There is one equation:
> > 
> > dJ(x,θ)/dθ=∂J(x,θ)/∂θ+∂J(x,θ)/∂x 
> > *∂x/∂θ=∂J(x,θ)/∂θ+∂J(x,θ)/∂x*[A^-1(θ))(-∂A(θ)/∂θ)x],because b has no 
> relation 
> > with density.
> > 
> > I don't know how to get [A^-1(θ))(-∂A(θ)/∂θ)x],A is matrix with nxn,if θ 
> is 
> > mx1 vector,∂A(θ)/∂θ is nxnxm matrix.
>
> ∂A(θ)/∂θ)x is an nxm matrix. You want to apply A^{-1} to it. The way you 
> do 
> that is to call the result
> Y = A^{-1} [∂A(θ)/∂θ)x]
> and then each column of Y, call it y_k (k=1...m) is computed as
> y_k = A^{-1} {[∂A(θ)/∂θ)x]_k}
> which requires solving a linear system
> A y_k = {[∂A(θ)/∂θ)x]_k}
>
> You never need A^{-1} explicitly.
>
> 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/0a3ade68-cbed-4551-8cba-67e49970217en%40googlegroups.com.


Re: [deal.II] Question about how to get the Stiffness matrix partial derivative with respect to density

2023-07-24 Thread Wolfgang Bangerth
The given conditions are stiffness matrix,destination function and x from 
Ax=b,x is movement ,b is force,A is global stiffness matrix.

J(x)=||x||norm-1


This is a questionable choice because dJ/dx is not defined at x=0.


There is one equation:

dJ(x,θ)/dθ=∂J(x,θ)/∂θ+∂J(x,θ)/∂x 
*∂x/∂θ=∂J(x,θ)/∂θ+∂J(x,θ)/∂x*[A^-1(θ))(-∂A(θ)/∂θ)x],because b has no relation 
with density.


I don't know how to get [A^-1(θ))(-∂A(θ)/∂θ)x],A is matrix with nxn,if θ is 
mx1 vector,∂A(θ)/∂θ is nxnxm matrix.


∂A(θ)/∂θ)x is an nxm matrix. You want to apply A^{-1} to it. The way you do 
that is to call the result

  Y = A^{-1} [∂A(θ)/∂θ)x]
and then each column of Y, call it y_k (k=1...m) is computed as
  y_k = A^{-1} {[∂A(θ)/∂θ)x]_k}
which requires solving a linear system
  A y_k = {[∂A(θ)/∂θ)x]_k}

You never need A^{-1} explicitly.

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/4d803770-52bf-779a-e3cd-74b0a9b0e928%40colostate.edu.