Re: [deal.II] SymmetricTensor rank 6 implementation issue

2019-05-03 Thread Wolfgang Bangerth
On 5/3/19 3:34 PM, Hamed Babaei wrote:
> 
> I believe it will be less time-consuming if I simply avoid using the 
> SymmetricTensor class and use the Tensor class instead and insert the 
> symmetric elements manually.

For sure. And for once I'm not even going to argue that this might be a nice 
idea to contribute a patch -- because you might be the first in approximately 
15 years who has needed symmetric tensors of rank 6, and it sounds unlikely 
that there is a large contingent of people just waiting for this to be 
implemented ;-)

Cheers
  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.


Re: [deal.II] SymmetricTensor rank 6 implementation issue

2019-05-03 Thread Hamed Babaei
Dear Wolfgang,

I believe it will be less time-consuming if I simply avoid using the 
SymmetricTensor class and use the Tensor class instead and insert the 
symmetric elements manually. 

Thanks anyway for your incredible support!


-- 
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.


Re: [deal.II] SymmetricTensor rank 6 implementation issue

2019-05-03 Thread Wolfgang Bangerth
On 5/3/19 2:07 PM, Hamed Babaei wrote:
> 
> $ *SymmetricTensor<6, dim> C; *
> 
> 
> The error is:
> 
> /home/hbabaei/deal.ii-candi/deal.II-v9.0.1/include/deal.II/base/symmetric_tensor.h:563:29:
>  
> error: incomplete type 
> ‘dealii::internal::SymmetricTensorAccessors::StorageType<6, 3, double>’ used 
> in nested name specifier
>     static const unsigned int n_independent_components
>                               ^
> /home/hbabaei/deal.ii-candi/deal.II-v9.0.1/include/deal.II/base/symmetric_tensor.h:1046:1:
>  
> error: size of array is not an integral constant-expression
>   SymmetricTensor::SymmetricTensor (const Number () 
> [n_independent_components])
>   ^
> /home/hbabaei/deal.ii-candi/deal.II-v9.0.1/include/deal.II/base/symmetric_tensor.h:1046:100:
>  
> error: size of array is not an integral constant-expression
>   SymmetricTensor::SymmetricTensor (const Number () 
> [n_independent_components])
>   
>  
>                        ^
> /home/hbabaei/deal.ii-candi/deal.II-v9.0.1/include/deal.II/base/symmetric_tensor.h:861:61:
>  
> error: invalid use of incomplete type ‘struct 
> dealii::internal::SymmetricTensorAccessors::StorageType<6, 3, double>’
>     typedef typename base_tensor_descriptor::base_tensor_type 
> base_tensor_type;
>                                                               ^
> /home/hbabaei/deal.ii-candi/deal.II-v9.0.1/include/deal.II/base/symmetric_tensor.h:188:12:
>  
> error: declaration of ‘struct 
> dealii::internal::SymmetricTensorAccessors::StorageType<6, 3, double>’
>       struct StorageType;
>              ^
> 
> It seems that I need to specify n_independent_components, but I do not know 
> how and where I can do so.
> 
> I appreciate it if you could give me any clue how to implement a rank-6 
> tensor 
> successfully.

Rank-6 are not currently implemented. The pieces that relate to storage are 
not available right now, and may other things as well. The way you define the 
symmetry of the tensors implies that you are thinking of a rank-6 tensor in a 
way so that it could be stored as a symmetric dxd matrix in which each element 
is a dxdxd tensor. This is consistent with a rank-2 symmetric tensor being a 
symmetric matrix of numbers (rank-0 tensors), and a rank-4 symmetric tensor as 
a symmetric matrix in which each element is a dxd (rank-2) tensor.

You will want to go through the implementation in the file and see which parts 
are missing for your case. In particular, we are missing how the 
base_tensor_type needs to be defined. It should not be very difficult for you 
to implement this if you want to!

As always, we're there to help!
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.
For more options, visit https://groups.google.com/d/optout.


[deal.II] SymmetricTensor rank 6 implementation issue

2019-05-03 Thread Hamed Babaei
Hello,

I am planning to use a symmetric tensor rank-6 for third-order elastic 
constants in a nonlinear elasticity code. The tensor is supposed to be 
symmetric within each three pair indices as well as all possible orders of 
pair permutations. 
Namely, C_ijklmn = C_jiklmn = C_ijlkmn = C_ijklnm = C_klijmn = C_mnijkl 
,.This tensor without any material symmetry will have 56 independent 
elements. 

The SymmetricTensor class provides the symmetry within the pairs without 
the symmetry obtained by permutation of pairs and it will be totally fine 
and I can take care of the extra symmetry I need by writing the equal 
elements as many times as required.  

However, the problem is that I can not even initialize a rank-6 tensor. 
Interestingly it works for rank-4 though. It seems that I am missing 
something in the instruction of the tensor. Only the following simplest 
line of code gives me an error.

$ *SymmetricTensor<6, dim> C; *   


The error is:

/home/hbabaei/deal.ii-candi/deal.II-v9.0.1/include/deal.II/base/symmetric_tensor.h:563:29:
 
error: incomplete type 
‘dealii::internal::SymmetricTensorAccessors::StorageType<6, 3, double>’ 
used in nested name specifier
   static const unsigned int n_independent_components
 ^
/home/hbabaei/deal.ii-candi/deal.II-v9.0.1/include/deal.II/base/symmetric_tensor.h:1046:1:
 
error: size of array is not an integral constant-expression
 SymmetricTensor::SymmetricTensor (const Number () 
[n_independent_components])
 ^
/home/hbabaei/deal.ii-candi/deal.II-v9.0.1/include/deal.II/base/symmetric_tensor.h:1046:100:
 
error: size of array is not an integral constant-expression
 SymmetricTensor::SymmetricTensor (const Number () 
[n_independent_components])

^
/home/hbabaei/deal.ii-candi/deal.II-v9.0.1/include/deal.II/base/symmetric_tensor.h:861:61:
 
error: invalid use of incomplete type ‘struct 
dealii::internal::SymmetricTensorAccessors::StorageType<6, 3, double>’
   typedef typename base_tensor_descriptor::base_tensor_type 
base_tensor_type;
 ^
/home/hbabaei/deal.ii-candi/deal.II-v9.0.1/include/deal.II/base/symmetric_tensor.h:188:12:
 
error: declaration of ‘struct 
dealii::internal::SymmetricTensorAccessors::StorageType<6, 3, double>’
 struct StorageType;
^

It seems that I need to specify n_independent_components, but I do not know 
how and where I can do so.

I appreciate it if you could give me any clue how to implement a rank-6 
tensor successfully.

Thanks and regards,

-- 
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.