Dear Michael,

The classes that better serve your purpose are the Tensor and SymmetricTensor 
classes:
https://dealii.org/current/doxygen/deal.II/classTensor.html 
<https://dealii.org/current/doxygen/deal.II/classTensor.html>
https://dealii.org/current/doxygen/deal.II/classSymmetricTensor.html 
<https://dealii.org/current/doxygen/deal.II/classSymmetricTensor.html>
These classes have a number of member and non-member functions that make 
performing the sort of operations that you listed much easier.
There is also the unit_symmetric_tensor() function that returns the rank-2 
identity tensor.
https://dealii.org/current/doxygen/deal.II/classSymmetricTensor.html#a1e8821eb23f5416543aa98cf4e0f1aab
 
<https://dealii.org/current/doxygen/deal.II/classSymmetricTensor.html#a1e8821eb23f5416543aa98cf4e0f1aab>

Furthermore, we have a function that will compute the Green-Lagrange strain 
tensor from a given deformation gradient tensor:
https://dealii.org/current/doxygen/deal.II/namespacePhysics_1_1Elasticity_1_1Kinematics.html#ae607c6743e1481e02d0eb75cd4e32e78
 
<https://dealii.org/current/doxygen/deal.II/namespacePhysics_1_1Elasticity_1_1Kinematics.html#ae607c6743e1481e02d0eb75cd4e32e78>

I hope that this helps.

Best,
Jean-Paul

> On 22. Jul 2021, at 00:39, Michael Lee <lianxi...@gmail.com> wrote:
> 
> Dear dealii users,
> 
> I want to construct a matrix . My approach is as follows.
> 
> FullMatrix<double> F(3,3) = 0.0; // deformation gradient
> FullMatrix<double> E(3,3) = 0.0; // Green strain
> FullMatrix<double> I (IdentityMatrix(3));
> F.Tmmult(E, F);
> E.add(-1, I);
> E.add(2, E);
> 
> I wonder if there is an more elegant or easier way to do the matrix 
> construction as I need to do other similar operations.
> 
> Best,
> Michael
> 
> -- 
> The deal.II project is located at http://www.dealii.org/ 
> <http://www.dealii.org/>
> For mailing list/forum options, see 
> https://groups.google.com/d/forum/dealii?hl=en 
> <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 
> <mailto:dealii+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/CAEyr2zhNC9RpZVjD%2B4ggHp-PCBCRz9YCtBLSyxxqqeCDE-giSA%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/dealii/CAEyr2zhNC9RpZVjD%2B4ggHp-PCBCRz9YCtBLSyxxqqeCDE-giSA%40mail.gmail.com?utm_medium=email&utm_source=footer>.

-- 
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/6A8D385C-1E4F-4F9A-87DA-9DC57966D289%40gmail.com.

Reply via email to