BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
fn_rotate.hpp
Go to the documentation of this file.
1/*
2 * BELFEM -- The Berkeley Lab Finite Element Framework
3 * Copyright (c) 2026, The Regents of the University of California,
4 * through Lawrence Berkeley National Laboratory (subject to receipt of any required
5 * approvals from the U.S. Dept. of Energy). All rights reserved.
6 *
7 * Developers: Christian Messe, Gregory Giard
8 *
9 * See the top-level LICENSE file for the complete license and disclaimer.
10 */
11
12#ifndef BELFEM_FN_ROTATE_HPP
13#define BELFEM_FN_ROTATE_HPP
14
15#include "cl_Matrix.hpp"
16#include "fn_TR_rotate42.hpp"
17#include "cl_Tensor.hpp"
18
19
20namespace belfem
21{
22//----------------------------------------------------------------------------
23
24 template < typename T >
25 void
26 rotate( const Tensor< T > & aB, const Matrix< T > & aR, Tensor< T > & aA )
27 {
28 BELFEM_ASSERT( aB.is_3333(), "Tensor A must be of type 3x3x3x3" );
29 BELFEM_ASSERT( aR.n_rows() == 3 && aR.n_cols() == 3,
30 "Matrix B must be of size 3x3" );
31 BELFEM_ASSERT( aA.is_3333(), "Tensor C must be of type 3x3x3x3" );
32
33 tensor::rotate42( aB.data(), aR, aA.data() );
34 }
35
36//----------------------------------------------------------------------------
37}
38#endif //BELFEM_FN_ROTATE_HPP
#define BELFEM_ASSERT(aCheck,...)
Definition assert.hpp:244
Dense column-major matrix.
Definition cl_BZ_Matrix.hpp:28
size_t n_rows() const
Definition cl_AR_Matrix.hpp:205
size_t n_cols() const
Definition cl_AR_Matrix.hpp:213
Third- or fourth-order tensor container; the constitutive helpers (contraction, rotation,...
Definition cl_Tensor.hpp:43
T * data()
expose the underlying raw pointer
Definition cl_Tensor.hpp:211
bool is_3333() const
returns true if this is a 3x3x3x3 tensor
Definition cl_Tensor.hpp:319
void rotate42(const T *B, const T *R, T *A)
tensor rotation A_mnop = B_ijkl * R_im * R_jn * R_ko * R_lp
Definition fn_TR_rotate42_arma.hpp:27
USER GUIDES:
Definition cl_Capacitor.cpp:16
void rotate(const Tensor< T > &aB, const Matrix< T > &aR, Tensor< T > &aA)
Definition fn_rotate.hpp:26