Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90918541
voigt_conversion.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Nov 5, 23:54
Size
5 KB
Mime Type
text/x-c
Expires
Thu, Nov 7, 23:54 (2 d)
Engine
blob
Format
Raw Data
Handle
22156949
Attached To
rMUSPECTRE µSpectre
voigt_conversion.cc
View Options
/**
* @file voigt_conversion.cc
*
* @author Till Junge <till.junge@epfl.ch>
*
* @date 04 May 2017
*
* @brief specializations for static members of voigt converter
*
* Copyright © 2017 Till Junge
*
* µSpectre is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3, or (at
* your option) any later version.
*
* µSpectre is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Emacs; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "common/voigt_conversion.hh"
namespace
muSpectre
{
//! voigt vector indices for non-symmetric tensors
template
<>
const
Eigen
::
Matrix
<
Dim_t
,
1
,
1
>
VoigtConversion
<
1
>::
mat
=
(
Eigen
::
Matrix
<
Dim_t
,
1
,
1
>
()
<<
0
).
finished
();
//! voigt vector indices for non-symmetric tensors
template
<>
const
Eigen
::
Matrix
<
Dim_t
,
2
,
2
>
VoigtConversion
<
2
>::
mat
=
(
Eigen
::
Matrix
<
Dim_t
,
2
,
2
>
()
<<
0
,
2
,
3
,
1
).
finished
();
//! voigt vector indices for non-symmetric tensors
template
<>
const
Eigen
::
Matrix
<
Dim_t
,
3
,
3
>
VoigtConversion
<
3
>::
mat
=
(
Eigen
::
Matrix
<
Dim_t
,
3
,
3
>
()
<<
0
,
5
,
4
,
8
,
1
,
3
,
7
,
6
,
2
).
finished
();
//! voigt vector indices
template
<>
const
Eigen
::
Matrix
<
Dim_t
,
1
,
1
>
VoigtConversion
<
1
>::
sym_mat
=
(
Eigen
::
Matrix
<
Dim_t
,
1
,
1
>
()
<<
0
).
finished
();
//! voigt vector indices
template
<>
const
Eigen
::
Matrix
<
Dim_t
,
2
,
2
>
VoigtConversion
<
2
>::
sym_mat
=
(
Eigen
::
Matrix
<
Dim_t
,
2
,
2
>
()
<<
0
,
2
,
2
,
1
).
finished
();
//! voigt vector indices
template
<>
const
Eigen
::
Matrix
<
Dim_t
,
3
,
3
>
VoigtConversion
<
3
>::
sym_mat
=
(
Eigen
::
Matrix
<
Dim_t
,
3
,
3
>
()
<<
0
,
5
,
4
,
5
,
1
,
3
,
4
,
3
,
2
).
finished
();
//! matrix indices from voigt vectors
template
<>
const
Eigen
::
Matrix
<
Dim_t
,
1
*
1
,
2
>
VoigtConversion
<
1
>::
vec
=
(
Eigen
::
Matrix
<
Dim_t
,
1
*
1
,
2
>
()
<<
0
,
0
).
finished
();
//! matrix indices from voigt vectors
template
<>
const
Eigen
::
Matrix
<
Dim_t
,
2
*
2
,
2
>
VoigtConversion
<
2
>::
vec
=
(
Eigen
::
Matrix
<
Dim_t
,
2
*
2
,
2
>
()
<<
0
,
0
,
1
,
1
,
0
,
1
,
1
,
0
).
finished
();
//! matrix indices from voigt vectors
template
<>
const
Eigen
::
Matrix
<
Dim_t
,
3
*
3
,
2
>
VoigtConversion
<
3
>::
vec
=
(
Eigen
::
Matrix
<
Dim_t
,
3
*
3
,
2
>
()
<<
0
,
0
,
1
,
1
,
2
,
2
,
1
,
2
,
0
,
2
,
0
,
1
,
2
,
1
,
2
,
0
,
1
,
0
).
finished
();
//! factors for shear components in voigt notation
template
<>
const
Eigen
::
Matrix
<
Real
,
vsize
(
1
),
1
>
VoigtConversion
<
1
>::
factors
=
(
Eigen
::
Matrix
<
Real
,
vsize
(
1
),
1
>
()
<<
1
).
finished
();
//! factors for shear components in voigt notation
template
<>
const
Eigen
::
Matrix
<
Real
,
vsize
(
2
),
1
>
VoigtConversion
<
2
>::
factors
=
(
Eigen
::
Matrix
<
Real
,
vsize
(
2
),
1
>
()
<<
1
,
1
,
2
).
finished
();
//! factors for shear components in voigt notation
template
<>
const
Eigen
::
Matrix
<
Real
,
vsize
(
3
),
1
>
VoigtConversion
<
3
>::
factors
=
(
Eigen
::
Matrix
<
Real
,
vsize
(
3
),
1
>
()
<<
1
,
1
,
1
,
2
,
2
,
2
).
finished
();
}
// muSpectre
Event Timeline
Log In to Comment