Skip to content

Commit

Permalink
Resolving conflicts with new version of TensorValues 0.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
fverdugo committed Oct 21, 2019
1 parent 32175fc commit 3c0682a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 52 deletions.
29 changes: 17 additions & 12 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ version = "0.2.0"

[[Compat]]
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
git-tree-sha1 = "84aa74986c5b9b898b0d1acaf3258741ee64754f"
git-tree-sha1 = "ed2c4abadf84c53d9e58510b5fc48912c2336fbb"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "2.1.0"
version = "2.2.0"

[[DataStructures]]
deps = ["InteractiveUtils", "OrderedCollections", "Random", "Serialization", "Test"]
Expand Down Expand Up @@ -122,10 +122,10 @@ uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

[[LightXML]]
deps = ["BinaryProvider", "Libdl", "Test"]
git-tree-sha1 = "aeec7a341652d47bc773475a42952fa78eccd7cc"
deps = ["BinaryProvider", "Libdl"]
git-tree-sha1 = "be855e3c975b89746b09952407c156b5e4a33a1d"
uuid = "9c8b4983-aa76-5018-a973-4c85ecc9e179"
version = "0.8.0"
version = "0.8.1"

[[LineSearches]]
deps = ["LinearAlgebra", "NLSolversBase", "NaNMath", "Parameters", "Printf", "Test"]
Expand All @@ -149,9 +149,9 @@ uuid = "a63ad114-7e13-5084-954f-fe012c677804"

[[NLSolversBase]]
deps = ["Calculus", "DiffEqDiffTools", "DiffResults", "Distributed", "ForwardDiff"]
git-tree-sha1 = "c430bd3f2dfcffc30688cf4a9cb61535e8d85f65"
git-tree-sha1 = "f1b8ed89fa332f410cfc7c937682eb4d0b361521"
uuid = "d41bc354-129a-5804-8e4c-c37616107c6c"
version = "7.4.1"
version = "7.5.0"

[[NLsolve]]
deps = ["DiffEqDiffTools", "Distances", "ForwardDiff", "LineSearches", "LinearAlgebra", "NLSolversBase", "Printf", "Reexport"]
Expand Down Expand Up @@ -188,10 +188,10 @@ deps = ["Dates", "LibGit2", "Markdown", "Printf", "REPL", "Random", "SHA", "UUID
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[[Polynomials]]
deps = ["LinearAlgebra", "SparseArrays", "Test"]
git-tree-sha1 = "62142bd65d3f8aeb2226ec64dd8493349147df94"
deps = ["LinearAlgebra", "RecipesBase"]
git-tree-sha1 = "f7c0c07e82798aef542d60a6e6e85e39f4590750"
uuid = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
version = "0.5.2"
version = "0.5.3"

[[Printf]]
deps = ["Unicode"]
Expand All @@ -211,6 +211,11 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
deps = ["Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[RecipesBase]]
git-tree-sha1 = "7bdce29bc9b2f5660a6e5e64d64d91ec941f6aa2"
uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
version = "0.7.0"

[[Reexport]]
deps = ["Pkg"]
git-tree-sha1 = "7b1d07f411bc8ddb7977ec7f377b97b158514fe0"
Expand Down Expand Up @@ -264,9 +269,9 @@ version = "0.1.4"

[[TensorValues]]
deps = ["LinearAlgebra", "StaticArrays"]
git-tree-sha1 = "a998c534421283d1ad7cec699964600223be5357"
git-tree-sha1 = "f1f46eea2c9991f7a051d647e37ece33a7d88b78"
uuid = "31c64edf-cdeb-50e4-845d-ed2334360c20"
version = "0.3.4"
version = "0.3.5"

[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Deprecated
### Fixed

## [0.5.2] - 2019-10-21
### Fixed
- Incompatibility problem with `TensorValues` version 0.3.5.

## [0.5.1] - 2019-10-03
### Added
- Pretty printing for the types most exposed to users. Since PR [#109](https://github.com/gridap/Gridap.jl/pull/109).
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Gridap"
uuid = "56d4f2e9-7ea1-5844-9cf6-b9c51ca7ce8e"
authors = ["Santiago Badia <[email protected]>", "Francesc Verdugo <[email protected]>"]
version = "0.5.1"
version = "0.5.2"

[deps]
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
Expand Down Expand Up @@ -30,7 +30,7 @@ QuadGK = "2.1.0"
Reexport = "0.2.0"
StaticArrays = "0.10.3"
TensorPolynomialBases = "0.1.4"
TensorValues = "0.3.4"
TensorValues = "0.3.5"
UnstructuredGrids = "0.2.2"
WriteVTK = "1.2.0"
julia = "1.1"
Expand Down
33 changes: 1 addition & 32 deletions src/Fields/FieldValues.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@ export normalvec
export trace
export tr
export symmetic_part
export mutable

import TensorValues: meas
import Base: adjoint
import LinearAlgebra: tr
import LinearAlgebra: dot
import LinearAlgebra: norm


"""
Type representing all possible field value types
Expand Down Expand Up @@ -55,31 +51,4 @@ function meas(v::MultiValue{Tuple{2,3}})
sqrt(n*n)
end

@generated function trace(v::TensorValue{D}) where D
str = join([" v.array.data[$i+$((i-1)*D)] +" for i in 1:D ])
Meta.parse(str[1:(end-1)])
end

@inline tr(v::TensorValue) = trace(v)

@generated function symmetic_part(v::TensorValue{D}) where D
str = "("
for j in 1:D
for i in 1:D
str *= "0.5*v.array.data[$i+$((j-1)*D)] + 0.5*v.array.data[$j+$((i-1)*D)], "
end
end
str *= ")"
Meta.parse("TensorValue($str)")
end

function adjoint(v::TensorValue)
t = adjoint(v.array)
TensorValue(t)
end

@inline dot(u::VectorValue,v::VectorValue) = inner(u,v)

@inline norm(u::VectorValue) = sqrt(inner(u,u))

end # module
6 changes: 0 additions & 6 deletions src/Gridap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ __precompile__()

module Gridap

# TODO move to TensorValues
using StaticArrays
using TensorValues
export mutable
mutable(::Type{MultiValue{S,T,N,L}}) where {S,T,N,L} = MArray{S,T,N,L}

using Reexport

include("Utils/files.jl")
Expand Down

0 comments on commit 3c0682a

Please sign in to comment.