svMultiPhysics
Loading...
Searching...
No Matches
Vector.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Stanford University, The Regents of the University of California, and others.
2// SPDX-License-Identifier: BSD-3-Clause
3
4#ifndef SVMP_FE_MATH_VECTOR_H
5#define SVMP_FE_MATH_VECTOR_H
6
7/**
8 * @file Vector.h
9 * @brief Fixed-size vector types for FE computations, backed by Eigen.
10 *
11 * The FE library standardizes on Eigen for linear algebra. These aliases give
12 * element-level code a stable vocabulary type without re-exporting all of
13 * Eigen. Note that, unlike the previous in-house implementation, Eigen types
14 * are NOT zero-initialized by default construction; use Vector::Zero() where a
15 * zeroed value is required.
16 *
17 * This is a small, fixed-size (compile-time length) vector for element-level FE
18 * kernels in namespace svmp::FE::math. It is distinct from, and not a replacement
19 * for, the legacy dynamically sized container in solver/Vector.h: the two differ
20 * in namespace, size model (compile-time vs runtime), and memory management, and
21 * coexist deliberately.
22 */
23
24#include <Eigen/Core>
25
26#include <cstddef>
27
28/**
29 * @defgroup FE_Math Math
30 * @ingroup FE
31 * @brief Linear algebra vocabulary types and dense utilities for finite-element computations.
32 *
33 * @details The Math module defines the fixed-size vector and matrix types
34 * used in element-level kernels (as aliases of Eigen types) and dense linear
35 * algebra utilities used by basis construction and local transforms.
36 *
37 * @defgroup FE_VectorMath Vector
38 * @ingroup FE_Math
39 * @brief Fixed-size vector type aliases.
40 */
41
42namespace svmp::FE::math {
43
44/**
45 * @brief Fixed-size column vector for element-level computations
46 * @ingroup FE_VectorMath
47 * @tparam T Scalar type (float, double)
48 * @tparam N Vector dimension
49 */
50template<typename T, std::size_t N>
51using Vector = Eigen::Matrix<T, static_cast<int>(N), 1>;
52
53} // namespace svmp::FE::math
54
55#endif // SVMP_FE_MATH_VECTOR_H
The Vector template class is used for storing int and double data.
Definition Vector.h:26