BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
fn_crossmat.hpp File Reference

Cross product of a normal vector with every column of a matrix. More...

#include "cl_Vector.hpp"
#include "cl_Matrix.hpp"
#include "fn_norm.hpp"
#include "assert.hpp"
Include dependency graph for fn_crossmat.hpp:

Go to the source code of this file.

Namespaces

namespace  belfem
 USER GUIDES:

Functions

void belfem::crossmat (const Vector< real > &aN, const Matrix< real > &aA, Vector< real > &aNxA)
 Crosses a normal vector with every column of a matrix, 2D.
void belfem::crossmat (const Vector< real > &aN, const Matrix< real > &aA, const real aScale, Vector< real > &aNxA)
 Crosses a normal vector with every column of a matrix, 2D, scaled.
void belfem::crossmat (const Vector< real > &aN, const Matrix< real > &aA, Matrix< real > &aNxA)
 Crosses a normal vector with every column of a matrix, 3D.
void belfem::crossmat (const Vector< real > &aN, const Matrix< real > &aA, const real aScale, Matrix< real > &aNxA)
 Crosses a normal vector with every column of a matrix, 3D, scaled.

Detailed Description

Cross product of a normal vector with every column of a matrix.

Each overload treats every column of aA as one input vector and computes aN x column(k). The 2D overloads store one scalar z-component per column in a Vector; the 3D overloads store one 3-vector per column in a Matrix.

Two conventions differ between the overloads and are easy to get wrong:

  • the overloads without aScale assign to aNxA; those with it accumulate into it, so the caller must initialise aNxA first;
  • only the 2D overloads finish by zeroing result entries whose magnitude is below BELFEM_EPSILON relative to the norm of the result. That is cosmetic suppression of rounding dust in what should be exact zeros. The 3D overloads do not do it.