v0.14.0
Tensor1_divide_generic.hpp
Go to the documentation of this file.
1 /* Divides a Tensor1 by a generic, yielding a Tensor1. Usually used
2  for doubles, but could be used for complex, etc. All that it
3  requires is that you can add an element of the Tensor1 to it. */
4 
5 /* A(i) / d0 -> Tensor1 */
6 
7 #pragma once
8 
9 namespace FTensor
10 {
11  template <class A, class T, class U, int Dim, char i>
13  {
15  U d;
16 
17  public:
18  typename promote<T, U>::V operator()(const int N) const
19  {
20  return iterA(N) / d;
21  }
22 
24  : iterA(a), d(d0)
25  {}
26  };
27 
28  template <class A, class T, class U, int Dim, char i>
30  typename promote<T, U>::V, Dim, i>
32  {
33  using TensorExpr = Tensor1_divide_generic<A, T, U, Dim, i>;
35  TensorExpr(a, d0));
36  }
37 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Tensor1_divide_generic::Tensor1_divide_generic
Tensor1_divide_generic(const Tensor1_Expr< A, T, Dim, i > &a, const U &d0)
Definition: Tensor1_divide_generic.hpp:23
FTensor::Tensor1_divide_generic
Definition: Tensor1_divide_generic.hpp:12
FTensor::operator/
auto operator/(const Ddg_Expr< A, T, Dim01, Dim23, i, j, k, l > &a, const U &d0)
Definition: Ddg_times_generic.hpp:36
FTensor::Tensor1_Expr
Definition: Tensor1_Expr.hpp:27
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::Tensor1_divide_generic::iterA
Tensor1_Expr< A, T, Dim, i > iterA
Definition: Tensor1_divide_generic.hpp:14
FTensor::promote::V
T1 V
Definition: promote.hpp:17
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
N
const int N
Definition: speed_test.cpp:3
Tensor1_Expr
Definition: single.cpp:11
FTensor::Tensor1_divide_generic::operator()
promote< T, U >::V operator()(const int N) const
Definition: Tensor1_divide_generic.hpp:18
FTensor::Tensor1_divide_generic::d
U d
Definition: Tensor1_divide_generic.hpp:15
EshelbianPlasticity::U
@ U
Definition: EshelbianContact.cpp:197