Skip to content

Commit df4d50a

Browse files
committed
removed float64
1 parent 380608c commit df4d50a

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

src/TensorAlgebra/Operations.jl

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,28 @@ function (*)(Ten1::TensorValue, Ten2::TensorValue)
1010
end
1111

1212

13-
@generated function (+)(A::TensorValue{D,D,Float64}, B::TensorValue{D,D,Float64}) where {D}
13+
@generated function (+)(A::TensorValue{D,D}, B::TensorValue{D,D}) where {D}
1414
str = ""
1515
for i in 1:D*D
1616
str *= "A.data[$i] + B.data[$i], "
1717
end
18-
Meta.parse("TensorValue{D,D, Float64}($str)")
18+
Meta.parse("TensorValue{D,D}($str)")
1919
end
2020

2121

22-
function Gridap.TensorValues.outer(A::TensorValue{D,D,Float64}, B::TensorValue{D,D,Float64}) where {D}
22+
function Gridap.TensorValues.outer(A::TensorValue{D,D}, B::TensorValue{D,D}) where {D}
2323
return (A ₁₂³⁴ B)
2424
end
2525

26-
function Gridap.TensorValues.outer(A::VectorValue{D,Float64}, B::VectorValue{D,Float64}) where {D}
26+
function Gridap.TensorValues.outer(A::VectorValue{D}, B::VectorValue{D}) where {D}
2727
return (A ₁² B)
2828
end
2929

30-
function Gridap.TensorValues.outer(A::TensorValue{4,2,Float64}, B::VectorValue{2,Float64})
30+
function Gridap.TensorValues.outer(A::TensorValue{4,2}, B::VectorValue{2})
3131
return (A ₁₂₃⁴ B)
3232
end
3333

34-
function Gridap.TensorValues.outer(A::TensorValue{9,3,Float64}, B::VectorValue{3,Float64})
34+
function Gridap.TensorValues.outer(A::TensorValue{9,3}, B::VectorValue{3})
3535
return (A ₁₂₃⁴ B)
3636
end
3737

@@ -41,14 +41,14 @@ end
4141
4242
Outer product of two first-order tensors (vectors), returning a second-order tensor (matrix).
4343
"""
44-
@generated function (₁²)(A::VectorValue{D,Float64}, B::VectorValue{D,Float64}) where {D}
44+
@generated function (₁²)(A::VectorValue{D}, B::VectorValue{D}) where {D}
4545
str = ""
4646
for iB in 1:D
4747
for iA in 1:D
4848
str *= "A.data[$iA] * B.data[$iB], "
4949
end
5050
end
51-
Meta.parse("TensorValue{D,D, Float64}($str)")
51+
Meta.parse("TensorValue{D,D}($str)")
5252
end
5353

5454

@@ -58,14 +58,14 @@ end
5858
Outer product of two second-order tensors (matrices), returning a fourth-order tensor
5959
represented in a `D² x D²` flattened matrix using combined indices.
6060
"""
61-
@generated function (₁₂³⁴)(A::TensorValue{D,D,Float64}, B::TensorValue{D,D,Float64}) where {D}
61+
@generated function (₁₂³⁴)(A::TensorValue{D,D}, B::TensorValue{D,D}) where {D}
6262
str = ""
6363
for iB in 1:D*D
6464
for iA in 1:D*D
6565
str *= "A.data[$iA] * B.data[$iB], "
6666
end
6767
end
68-
Meta.parse("TensorValue{D*D,D*D, Float64}($str)")
68+
Meta.parse("TensorValue{D*D,D*D}($str)")
6969
end
7070

7171

@@ -117,14 +117,14 @@ end
117117
Outer product of a first-order and second-order tensors (vector and matrix),
118118
returning a third-order tensor represented in a `D x D²` flattened matrix using combined indices.
119119
"""
120-
@generated function (₁²³)(V::VectorValue{D,Float64}, A::TensorValue{D,D,Float64}) where {D}
120+
@generated function (₁²³)(V::VectorValue{D}, A::TensorValue{D,D}) where {D}
121121
str = ""
122122
for iA in 1:D*D
123123
for iV in 1:D
124124
str *= "A.data[$iA] * V.data[$iV], "
125125
end
126126
end
127-
Meta.parse("TensorValue{D,D*D, Float64, D*D*D}($str)")
127+
Meta.parse("TensorValue{D,D*D}($str)")
128128
end
129129

130130

@@ -134,14 +134,14 @@ end
134134
Outer product of a second-order and first-order tensors (matrix and vector),
135135
returning a third-order tensor represented in a `D x D²` flattened matrix using combined indices.
136136
"""
137-
@generated function (₁₂³)(A::TensorValue{D,D,Float64}, V::VectorValue{D,Float64}) where {D}
137+
@generated function (₁₂³)(A::TensorValue{D,D}, V::VectorValue{D}) where {D}
138138
str = ""
139139
for iV in 1:D
140140
for iA in 1:D*D
141141
str *= "A.data[$iA] * V.data[$iV], "
142142
end
143143
end
144-
Meta.parse("TensorValue{D,D*D, Float64,D*D*D}($str)")
144+
Meta.parse("TensorValue{D,D*D}($str)")
145145
end
146146

147147

@@ -187,9 +187,9 @@ returning a fourth-order tensor represented in a `D² x D²` flattened matrix us
187187
end
188188

189189

190-
function (×ᵢ⁴)(A::TensorValue{3,3,Float64})
190+
function (×ᵢ⁴)(A::TensorValue{3,3})
191191

192-
TensorValue(0.0, 0.0, 0.0, 0.0, A[9], -A[8], 0.0, -A[6], A[5], 0.0, 0.0, 0.0, -A[9],
192+
TensorValue{9,9}(0.0, 0.0, 0.0, 0.0, A[9], -A[8], 0.0, -A[6], A[5], 0.0, 0.0, 0.0, -A[9],
193193
0.0, A[7], A[6], 0.0, -A[4], 0.0, 0.0, 0.0, A[8], -A[7], 0.0, -A[5], A[4], 0.0, 0.0, -A[9],
194194
A[8], 0.0, 0.0, 0.0, 0.0, A[3], -A[2], A[9], 0.0, -A[7], 0.0, 0.0, 0.0, -A[3], 0.0,
195195
A[1], -A[8], A[7], 0.0, 0.0, 0.0, 0.0, A[2], -A[1], 0.0, 0.0, A[6], -A[5], 0.0,
@@ -200,7 +200,7 @@ end
200200

201201
function Gridap.TensorValues.cross(A::TensorValue{3,3,T1}, B::TensorValue{3,3,T2}) where {T1,T2}
202202

203-
TensorValue(A[5] * B[9] - A[6] * B[8] - A[8] * B[6] + A[9] * B[5],
203+
TensorValue{3,3}(A[5] * B[9] - A[6] * B[8] - A[8] * B[6] + A[9] * B[5],
204204
A[6] * B[7] - A[4] * B[9] + A[7] * B[6] - A[9] * B[4],
205205
A[4] * B[8] - A[5] * B[7] - A[7] * B[5] + A[8] * B[4],
206206
A[3] * B[8] - A[2] * B[9] + A[8] * B[3] - A[9] * B[2],
@@ -214,7 +214,7 @@ end
214214

215215
function Gridap.TensorValues.cross(H::TensorValue{9,9,T1}, A::TensorValue{3,3,T2}) where {T1,T2}
216216

217-
TensorValue(A[9] * H[37] - A[8] * H[46] - A[6] * H[64] + A[5] * H[73],
217+
TensorValue{9,9}(A[9] * H[37] - A[8] * H[46] - A[6] * H[64] + A[5] * H[73],
218218
A[9] * H[38] - A[8] * H[47] - A[6] * H[65] + A[5] * H[74],
219219
A[9] * H[39] - A[8] * H[48] - A[6] * H[66] + A[5] * H[75],
220220
A[9] * H[40] - A[8] * H[49] - A[6] * H[67] + A[5] * H[76],
@@ -299,7 +299,7 @@ end
299299

300300
function Gridap.TensorValues.cross(A::TensorValue{3,3,T1}, H::TensorValue{9,9,T2}) where {T1,T2}
301301

302-
TensorValue(A[5] * H[9] - A[6] * H[8] - A[8] * H[6] + A[9] * H[5],
302+
TensorValue{9,9}(A[5] * H[9] - A[6] * H[8] - A[8] * H[6] + A[9] * H[5],
303303
A[6] * H[7] - A[4] * H[9] + A[7] * H[6] - A[9] * H[4],
304304
A[4] * H[8] - A[5] * H[7] - A[7] * H[5] + A[8] * H[4],
305305
A[3] * H[8] - A[2] * H[9] + A[8] * H[3] - A[9] * H[2],
@@ -384,7 +384,7 @@ end
384384

385385
function Gridap.TensorValues.cross(A::TensorValue{3,9,T1}, B::TensorValue{3,3,T2}) where {T1,T2}
386386

387-
TensorValue{3,9,Float64,27}(A[13] * B[9] - A[16] * B[8] - A[22] * B[6] + A[25] * B[5],
387+
TensorValue{3,9}(A[13] * B[9] - A[16] * B[8] - A[22] * B[6] + A[25] * B[5],
388388
A[14] * B[9] - A[17] * B[8] - A[23] * B[6] + A[26] * B[5],
389389
A[15] * B[9] - A[18] * B[8] - A[24] * B[6] + A[27] * B[5],
390390
A[16] * B[7] - A[10] * B[9] + A[19] * B[6] - A[25] * B[4],

0 commit comments

Comments
 (0)