NEML2 2.1.0
Loading...
Searching...
No Matches
assembly.h
1// Copyright 2024, UChicago Argonne, LLC
2// All Rights Reserved
3// Software Name: NEML2 -- the New Engineering material Model Library, version 2
4// By: Argonne National Laboratory
5// OPEN SOURCE LICENSE (MIT)
6//
7// Permission is hereby granted, free of charge, to any person obtaining a copy
8// of this software and associated documentation files (the "Software"), to deal
9// in the Software without restriction, including without limitation the rights
10// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11// copies of the Software, and to permit persons to whom the Software is
12// furnished to do so, subject to the following conditions:
13//
14// The above copyright notice and this permission notice shall be included in
15// all copies or substantial portions of the Software.
16//
17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23// THE SOFTWARE.
24
25#pragma once
26
27#include <vector>
28
29#include "neml2/misc/types.h"
30
31namespace neml2
32{
33class Tensor;
34struct SparseTensorList;
35template <std::size_t N>
36class Derivative;
37
40
43
49
55template <std::size_t N>
57 const std::array<std::size_t, N> & intrsc_intmd_dims,
58 const std::array<TensorShape, N> & base_shapes,
59 const std::string & debug_name = "<anonymous>");
60
66template <std::size_t N>
68 const std::array<std::size_t, N> & intrsc_intmd_dims,
69 const std::array<TensorShape, N> & base_shapes,
70 const std::string & debug_name = "<anonymous>");
71
75template <std::size_t N>
77 const std::array<TensorShape, N> & intmd_shapes,
78 const std::array<TensorShape, N> & base_shapes);
79
83template <std::size_t N>
85 const std::array<TensorShape, N> & intmd_shapes,
86 const std::array<TensorShape, N> & base_shapes);
87
93 const std::optional<std::vector<TensorShape>> & intmd_shapes,
94 const std::vector<TensorShape> & base_shapes);
95
101 const std::optional<std::vector<TensorShape>> & intmd_shapes,
102 const std::vector<TensorShape> & base_shapes);
103
109 const std::optional<std::vector<TensorShape>> & row_intmd_shapes,
110 const std::optional<std::vector<TensorShape>> & col_intmd_shapes,
111 const std::vector<TensorShape> & row_base_shapes,
112 const std::vector<TensorShape> & col_base_shapes);
113
119 const std::optional<std::vector<TensorShape>> & row_intmd_shapes,
120 const std::optional<std::vector<TensorShape>> & col_intmd_shapes,
121 const std::vector<TensorShape> & row_base_shapes,
122 const std::vector<TensorShape> & col_base_shapes);
123
124}
Derivative wrapper.
Definition Derivative.h:66
Definition Tensor.h:49
Definition DiagnosticsInterface.h:31
Tensor push_intrsc_intmd_dim(const Tensor &t, Size dim)
Move the leading dim base dimensions to intermediate dimensions.
Tensor pop_intrsc_intmd_dim(const Tensor &t, Size dim)
Move the trailing dim intermediate dimensions to the base.
Tensor assemble(const SparseTensorList &, const std::optional< std::vector< TensorShape > > &intmd_shapes, const std::vector< TensorShape > &base_shapes)
int64_t Size
Definition types.h:71
Tensor to_assembly(const Tensor &from, const std::array< TensorShape, N > &intmd_shapes, const std::array< TensorShape, N > &base_shapes)
Tensor from_assembly(const Tensor &from, const std::array< TensorShape, N > &intmd_shapes, const std::array< TensorShape, N > &base_shapes)
SparseTensorList disassemble(const Tensor &, const std::optional< std::vector< TensorShape > > &intmd_shapes, const std::vector< TensorShape > &base_shapes)
Alias for a list of Tensors.
Definition SparseTensorList.h:42