ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
jacobian_type.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010-2022 The ESPResSo project
3 *
4 * This file is part of ESPResSo.
5 *
6 * ESPResSo is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * ESPResSo is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19#ifndef CORE_FIELD_COUPLING_GRADIENT_TYPE_HPP
20#define CORE_FIELD_COUPLING_GRADIENT_TYPE_HPP
21
22#include <utils/Vector.hpp>
23#include <utils/matrix.hpp>
24
25#include <cstddef>
26
27namespace FieldCoupling {
28namespace Fields {
29namespace detail {
30template <class T, std::size_t codim> struct jacobian_type_impl {
32};
33
34template <class T> struct jacobian_type_impl<T, 1> {
35 using type = Utils::Vector<T, 3>;
36};
37
38/**
39 * @brief Deduce type for jacobian from codim.
40 *
41 * Small helper that returns Vector3d if codim = 1,
42 * and Utils::Vector<codim, Utils::Vector<3, T>> otherwise to avoid
43 * using Vectors of size one, where scalars would do.
44 */
45template <class T, std::size_t codim>
46using jacobian_type = typename jacobian_type_impl<T, codim>::type;
47} // namespace detail
48} // namespace Fields
49} // namespace FieldCoupling
50
51#endif
Vector implementation and trait types for boost qvm interoperability.
Matrix implementation and trait types for boost qvm interoperability.
Matrix representation with static size.
Definition matrix.hpp:65