Dear prof. Bangerth,

Thanks. I have decided to implement my problem using the alternate 
approach. However, I am now facing another issue, somewhat different from 
the above but related to the Differentiation::SD class.

I am trying to compute the fourth-order elasticity tensor in the spatial 
description using the formula Jc = 4*b*d2W_db_db*b (as in step-44). I am 
using symbolic differentiation to compute all of the quantities in the 
formula. Finally, I would like to have Jc of the type SymmetricTensor<4, 
dim, NumberType>. This is where I run into a problem, which I explain below.

Since all the quantities in the rhs are SymmetricTensors, the operator*() 
recognises the multiplication as a double contraction. However, we want it 
to be a single contraction. So I must first convert 'b' to the type Tensor 
and then apply the formula. This will lead to Jc being of the type Tensor 
and not SymmetricTensor. Now there's a function symmetrize() to symmetrize 
the type Tensor<2,dim>, but not for higher-order tensor types. One could 
manually do this, but is there a better way?  If not, would it be a good 
idea to extend the symmetrize() function to Tensor<4,dim> since this type 
is often used to represent many quantities, such as the elasticity tensors?

Thanks & regards
Vinayak
On Thursday, July 18, 2024 at 11:31:51 PM UTC+5:30 Wolfgang Bangerth wrote:

> On 7/18/24 00:22, Vinayak Vijay wrote:
> > 
> > But here, it looks like the information about the composition of the 
> functions 
> > is not being stored somehow, maybe because it reduces the expressions to 
> the 
> > independent variables ("x" in this case). What change should I make to 
> obtain 
> > dg_dy? The independent variable remains "x" of course.
>
> I do not actually know enough about SD to help with this. The way I read 
> the 
> code is that you declare x to be an independent variable, whereas y is 
> not. 
> Intuitively, I would have expected the underlying library to raise an 
> exception when you try to compute the derivative with regard to anything 
> other 
> than an independent variable.
>
> I think you'll have to find out what underlying SD library your example is 
> using, and then read through the documentation of that library to see how 
> to 
> approach the issue. Alternatively, you can of course define a function 
> g_of_x 
> and another g_of_y, and depending on whether you want to compute the 
> derivative with regard to x or y, you choose one or the other.
>
> Best
> W.
>
> -- 
> ------------------------------------------------------------------------
> Wolfgang Bangerth email: [email protected]
> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/52b33f72-c5e1-4672-9879-84848334268cn%40googlegroups.com.

Reply via email to