BELFEM 0.9.4
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
fn_AR_cross.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_AR_CROSS_HPP
13#define BELFEM_FN_AR_CROSS_HPP
14
15#include "assert.hpp"
16#include "cl_AR_Vector.hpp"
17
18namespace belfem
19{
20//------------------------------------------------------------------------------
21
22 template< typename ET >
23 auto
24 cross( const ET & aA, const ET & aB )
25 -> decltype( arma::cross( aA, aB ))
26 {
27 return arma::cross( aA, aB );
28 }
29
30// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
31
32 template< typename T, typename ET >
33 auto
34 cross( const Vector<T> & aA, const ET & aB )
35 -> decltype( arma::cross( aA.vector_data(), aB ))
36 {
37 BELFEM_ASSERT( aA.length() == 3, "cross(): the vector must have a length of 3" );
38 return arma::cross( aA.vector_data(), aB );
39 }
40
41// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
42
43 template< typename ET, typename T >
44 auto
45 cross( const ET & aA, const Vector<T> & aB )
46 -> decltype( arma::cross( aA, aB.vector_data()))
47 {
48 BELFEM_ASSERT( aB.length() == 3, "cross(): the vector must have a length of 3" );
49 return arma::cross( aA, aB.vector_data() );
50 }
51
52//------------------------------------------------------------------------------
53}
54
55#endif //BELFEM_FN_AR_CROSS_HPP
#define BELFEM_ASSERT(aCheck,...)
Definition assert.hpp:244
Column vector.
Definition cl_BZ_Vector.hpp:42
USER GUIDES:
Definition cl_Capacitor.cpp:16
auto cross(const ET &aA, const ET &aB) -> decltype(arma::cross(aA, aB))
Definition fn_AR_cross.hpp:24