Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace int64 by int #445

Merged
merged 3 commits into from
Nov 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI
on:
- push
- pull_request
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
version:
- '1.5'
os:
- ubuntu-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
# - uses: julia-actions/julia-uploadcodecov@latest
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# docs:
# name: Documentation
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: julia-actions/setup-julia@v1
# with:
# version: '1.5'
# - run: |
# julia --project=docs -e '
# using Pkg
# Pkg.develop(PackageSpec(path=pwd()))
# Pkg.instantiate()'
# - run: julia --project=docs docs/make.jl
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added additional tensor operations and new double contraction notation `⋅²`. Implemented a `zero` constructor for `ThirdOrderTensorValues` to allow integration of 3-tensors. Since PR [#415](https://github.com/gridap/Gridap.jl/pull/415/).
- Added `compile/create_gridap_image.jl` Julia script that lets one to create a custom sysimage of Gridap using the so-called `PackageCompiler.jl` Julia package; see `compile/README.md` for additional details. Since PR [#432](https://github.com/gridap/Gridap.jl/pull/432/).

### Fixed
- Bug-fix for 32-bit Julia: Replace all occurences of Int64 by Int. Since PR [#445](https://github.com/gridap/Gridap.jl/pull/445).

## [0.14.1] - 2020-09-17

Expand Down
5 changes: 2 additions & 3 deletions src/Polynomials/MonomialBases.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Type representing a basis of multivariate scalar-valued, vector-valued, or
tensor-valued, iso- or aniso-tropic monomials. The fields
of this `struct` are not public
of this `struct` are not public
This type fully implements the [`Field`](@ref) interface, with up to second order
derivatives.
"""
Expand Down Expand Up @@ -83,7 +83,7 @@ exponents = get_exponents(b)
println(exponents)

# output
Tuple{Int64,Int64}[(0, 0), (1, 0), (2, 0), (0, 1), (1, 1), (2, 1), (0, 2), (1, 2), (2, 2)]
Tuple{Int,Int}[(0, 0), (1, 0), (2, 0), (0, 1), (1, 1), (2, 1), (0, 2), (1, 2), (2, 2)]
```
"""
function get_exponents(b::MonomialBasis)
Expand Down Expand Up @@ -418,4 +418,3 @@ end

_maximum(orders::Tuple{}) = 0
_maximum(orders) = maximum(orders)

10 changes: 5 additions & 5 deletions src/ReferenceFEs/CDLagrangianRefFEs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@ function _compute_cd_face_own_nodes(p::ExtrusionPolytope{D},orders::NTuple{D,<:I
nodes, _ = cd_compute_nodes(p,orders)
_ord = convert(NTuple{D,Float64},orders)
_nodes = map(i -> i.data.*_ord,nodes)
_nodes = map(i -> convert(NTuple{D,Int64},i),_nodes)
_nodes = map(i -> convert(NTuple{D,Int},i),_nodes)
perm = Dict(_nodes[i] => i for i = 1:length(_nodes))
face_owned_nodes = Vector{Int64}[]
face_owned_nodes = Vector{Int}[]
for nf in p.dface.nfaces
anc = nf.anchor
ext = nf.extrusion
fns = UnitRange{Int64}[]
fns = UnitRange{Int}[]
for (i,(e,a,c,o)) in enumerate(zip(ext,anc,cont,orders))
if e==0 && c == DISC
push!(fns,0:-1)
Expand All @@ -174,7 +174,7 @@ function _compute_cd_face_own_nodes(p::ExtrusionPolytope{D},orders::NTuple{D,<:I
end
n_ijk = map(i->i.I,collect(CartesianIndices(Tuple(fns))))
if length(n_ijk) == 0
n_i = Int64[]
n_i = Int[]
else
n_i = sort(reshape([perm[i] for i in n_ijk],length(n_ijk)))
end
Expand Down Expand Up @@ -210,7 +210,7 @@ function _move_nodes(p::ExtrusionPolytope,orders,act_f,nodes,f_own)
tr = map(i -> i == 0 ? 1 : 0,orders)
nfs = p.dface.nfaces
con(ext,anc) = f -> ( f.extrusion == ext && f.anchor == anc )
perm = zeros(Int64,length(nfs))
perm = zeros(Int,length(nfs))
for i in findall(act_f)
nf =nfs[i]
ext = VectorValue(map(+,nf.extrusion,tr))
Expand Down
4 changes: 2 additions & 2 deletions src/ReferenceFEs/ExtrusionPolytopes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct DFace{D} <: GridapType
dimranges::Vector{UnitRange{Int}}
dims::Vector{Int}
nf_nfs::Vector{Vector{Int}}
nf_dimranges::Vector{Vector{UnitRange{Int64}}}
nf_dimranges::Vector{Vector{UnitRange{Int}}}
nf_dims::Vector{Vector{Int}}
end

Expand Down Expand Up @@ -359,7 +359,7 @@ function _polytopenfaces(anchor, extrusion)
numnfs = length(nf_nfs)
nfsdim = [_nfdim(nf_nfs[i].extrusion) for i = 1:numnfs]
dnf = _nfdim(extrusion)
dimnfs = Array{UnitRange{Int64},1}(undef, dnf + 1)
dimnfs = Array{UnitRange{Int},1}(undef, dnf + 1)
dim = 0
i = 1
for iface = 1:numnfs
Expand Down
28 changes: 13 additions & 15 deletions src/ReferenceFEs/Polytopes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Abstract type representing a polytope (i.e., a polyhedron in arbitrary dimensions).
`D` is the environment dimension (typically, 0, 1, 2, or 3).
This type parameter is needed since there are functions in the
This type parameter is needed since there are functions in the
`Polytope` interface that return containers with `Point{D}` objects.
We adopt the [usual nomenclature](https://en.wikipedia.org/wiki/Polytope) for polytope-related objects.
All objects in a polytope (from vertices to the polytope itself) are called *n-faces* or simply *faces*.
Expand Down Expand Up @@ -53,7 +53,7 @@ to the first 0-face. Consecutive increasing ids are assigned to the other
0-faces, then to 1-faces, and so on. The polytope itself receives the largest id
which coincides with `num_faces(p)`. For a face id `iface`, `get_faces(p)[iface]`
is a vector of face ids, corresponding to the faces that are *incident* with the face
labeled with `iface`. That is, faces that are either on its boundary or the face itself.
labeled with `iface`. That is, faces that are either on its boundary or the face itself.
In this vector of incident face ids, faces are ordered by dimension, starting with 0-faces.
Within each dimension, the labels are ordered in a consistent way with the polyope object
for the face `iface` itself.
Expand All @@ -67,14 +67,14 @@ faces = get_faces(SEGMENT)
println(faces)

# output
Array{Int64,1}[[1], [2], [1, 2, 3]]
Array{Int,1}[[1], [2], [1, 2, 3]]
```

The constant [`SEGMENT`](@ref) is bound to a predefined instance of polytope
that represents a segment.
The face labels associated with a segment are `[1,2,3]`, being `1` and `2` for the vertices and
The face labels associated with a segment are `[1,2,3]`, being `1` and `2` for the vertices and
`3` for the segment itself. In this case, this function returns the vector of vectors
`[[1],[2],[1,2,3]]` meaning that vertex `1` is incident with vertex `1` (idem for vertex 2), and that
`[[1],[2],[1,2,3]]` meaning that vertex `1` is incident with vertex `1` (idem for vertex 2), and that
the segment (id `3`) is incident with the vertices `1` and `2` and the segment itself.

"""
Expand All @@ -97,7 +97,7 @@ ranges = get_dimranges(SEGMENT)
println(ranges)

# output
UnitRange{Int64}[1:2, 3:3]
UnitRange{Int}[1:2, 3:3]
```
Face ids for the vertices in the segment range from 1 to 2 (2 vertices),
the face ids for edges in the segment range from 3 to 3 (only one edge with id 3).
Expand Down Expand Up @@ -142,7 +142,7 @@ end
"""
(==)(a::Polytope{D},b::Polytope{D}) where D

Returns `true` if the polytopes `a` and `b` are equivalent. Otherwise, it
Returns `true` if the polytopes `a` and `b` are equivalent. Otherwise, it
returns `false`.
Note that the operator `==` returns `false` by default for polytopes
of different dimensions. Thus, this function has to be overloaded only
Expand Down Expand Up @@ -207,7 +207,7 @@ perms = get_vertex_permutations(SEGMENT)
println(perms)

# output
Array{Int64,1}[[1, 2], [2, 1]]
Array{Int,1}[[1, 2], [2, 1]]

```
The first admissible permutation for a segment is `[1,2]`,i.e., the identity.
Expand Down Expand Up @@ -252,7 +252,7 @@ num_point_dims(::Type{<:Polytope{D}}) where D = D
num_dims(::Type{<:Polytope{D}}) where D
num_dims(p::Polytope{D}) where D

Returns `D`.
Returns `D`.
"""
num_dims(p::Polytope) = num_dims(typeof(p))

Expand Down Expand Up @@ -351,7 +351,7 @@ println(dims)

```

The first two faces in the segment (the two vertices) have dimension 0 and the
The first two faces in the segment (the two vertices) have dimension 0 and the
third face (the segment itself) has dimension 1

"""
Expand Down Expand Up @@ -444,8 +444,8 @@ vertex_to_edges_around = get_faces(QUAD,0,1)
println(vertex_to_edges_around)

# output
Array{Int64,1}[[1, 2], [3, 4], [1, 3], [2, 4]]
Array{Int64,1}[[1, 3], [1, 4], [2, 3], [2, 4]]
Array{Int,1}[[1, 2], [3, 4], [1, 3], [2, 4]]
Array{Int,1}[[1, 3], [1, 4], [2, 3], [2, 4]]
```
"""
function get_faces(p::Polytope,dimfrom::Integer,dimto::Integer)
Expand Down Expand Up @@ -557,7 +557,7 @@ end
get_face_type(p::Polytope,d::Integer) -> Vector{Int}

Return a vector of integers denoting, for each face of dimension `d`, an index to the
vector `get_reffaces(Polytope{d},p)`
vector `get_reffaces(Polytope{d},p)`

# Examples

Expand Down Expand Up @@ -741,5 +741,3 @@ function Quadrature(p::Polytope{D},degree) where D
end
quad
end


4 changes: 2 additions & 2 deletions test/AlgebraTests/SparseMatrixCSC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module SparseMatrixCSCTests
maxrows=5
maxcols=5

for T in (Int32,Int64,Float32,Float64)
for T in (Int32,Int,Float32,Float64)
I = Vector{Int}()
J = Vector{Int}()
V = Vector{T}()
Expand Down Expand Up @@ -69,5 +69,5 @@ module SparseMatrixCSCTests


end

end
2 changes: 1 addition & 1 deletion test/AlgebraTests/SparseMatrixCSR.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module SparseMatrixCSRTests
maxrows=5
maxcols=5
maxrowsorcols=7
int_types=(Int32,Int64)
int_types=(Int32,Int)
float_types=(Float32,Float64)
Bi_types=(0,1)

Expand Down
2 changes: 1 addition & 1 deletion test/AlgebraTests/SymSparseMatrixCSR.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module SymSparseMatrixCSRTests
maxnz=5
maxrows=5
maxcols=5
int_types=(Int32,Int64)
int_types=(Int32,Int)
float_types=(Float32,Float64)
Bi_types=(0,1)

Expand Down
2 changes: 1 addition & 1 deletion test/ArraysTests/LocalToGlobalArraysTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ r = reindex(ca,ids)
test_array(r,ca[ids])

i_to_v=[[1, 2], [5, 6], [1, 5], [2, 6], [2, 3], [6, 7], [3, 7], [3, 4], [7, 8], [4, 8], [9, 10], [5, 9], [6, 10], [10, 11], [7, 11], [11, 12], [8, 12], [13, 14], [9, 13], [10, 14], [14, 15], [11, 15], [15, 16], [12, 16]]
j_to_i=Int64[]
j_to_i=Int[]
lid_to_gid=reindex(i_to_v,j_to_i)
gid_to_val=VectorValue{2,Float64}[(0.0, 0.25), (0.25, 0.25), (0.5, 0.25), (0.75, 0.25), (0.0, 0.5), (0.25, 0.5), (0.5, 0.5), (0.75, 0.5), (0.0, 0.75), (0.25, 0.75), (0.5, 0.75), (0.75, 0.75), (0.0, 1.0), (0.25, 1.0), (0.5, 1.0), (0.75, 1.0)]
f2=LocalToGlobalArray(lid_to_gid,gid_to_val)
Expand Down
4 changes: 2 additions & 2 deletions test/ArraysTests/LocalToGlobalPosNegArraysTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ gid_to_val_pos = [p, 2*p, 3*p, -p, p]
gid_to_val_neg = [3*p, -p, p]
lid_to_gid = Table(data,ptrs)
ca = LocalToGlobalPosNegArray(lid_to_gid,gid_to_val_pos,gid_to_val_neg)
a = Vector{Int64}[[2, 3, 3], [], [3, -1, -1], [3, 2, 1, -1, 1, -1]]
a = Vector{Int}[[2, 3, 3], [], [3, -1, -1], [3, 2, 1, -1, 1, -1]]
test_array( ca, a )

i_to_v=[[1, 2], [5, 6], [1, 5], [2, 6], [2, 3], [6, 7], [3, 7], [3, 4], [7, 8], [4, 8], [9, 10], [5, 9], [6, 10], [10, 11], [7, 11], [11, 12], [8, 12], [13, 14], [9, 13], [10, 14], [14, 15], [11, 15], [15, 16], [12, 16]]
j_to_i=Int64[]
j_to_i=Int[]
lid_to_gid=reindex(i_to_v,j_to_i)
gid_to_val=VectorValue{2,Float64}[(0.0, 0.25), (0.25, 0.25), (0.5, 0.25), (0.75, 0.25), (0.0, 0.5), (0.25, 0.5), (0.5, 0.5), (0.75, 0.5), (0.0, 0.75), (0.25, 0.75), (0.5, 0.75), (0.75, 0.75), (0.0, 1.0), (0.25, 1.0), (0.5, 1.0), (0.75, 1.0)]
f2=LocalToGlobalPosNegArray(lid_to_gid,gid_to_val,gid_to_val)
Expand Down
6 changes: 3 additions & 3 deletions test/ArraysTests/TablesTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ d = Table(data,ptrs)
e = [ data[ptrs[i]:ptrs[i+1]-1] for i in 1:length(ptrs)-1]
test_array(d,e)

data = Int64[2,3,1,3,6,7,3,2,5,6,3,4]
data = Int[2,3,1,3,6,7,3,2,5,6,3,4]
ptrs = [1,4,4,7,13]
a = Table(data,ptrs)

data = reinterpret(Int64,Vector{Float64}(undef,12))
data = reinterpret(Int,Vector{Float64}(undef,12))
data[1:6] .= a.data[7:12]
data[7:9] .= a.data[4:6]
data[10:12] .= a.data[1:3]

perm = Vector{Int64}(undef,12)
perm = Vector{Int}(undef,12)
perm[1:3] .= 10:12
perm[4:6] .= 7:9
perm[7:12] .= 1:6
Expand Down
6 changes: 1 addition & 5 deletions test/IoTests/JLD2Tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,11 @@ to_jld2_file(foo,f)
@test foo == from_jld2_file(typeof(foo),f)

f = joinpath(d,"dict.jld2")
foo = Dict("a"=>Int32(1),2=>Int64(3),4.0=>Float32(5),"six"=>Float64(7),:s=>"Symbol")
foo = Dict("a"=>Int32(1),2=>Int(3),4.0=>Float32(5),"six"=>Float64(7),:s=>"Symbol")

to_jld2_file(foo,f)
@test foo == from_jld2_file(typeof(foo),f)

rm(d,recursive=true)

end # module




8 changes: 4 additions & 4 deletions test/ReferenceFEsTests/CLagrangianRefFEsTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ b = MonomialBasis(VectorValue{2,Int},VERTEX,())
reffe = LagrangianRefFE(VectorValue{2,Int},VERTEX,())
@test get_face_own_nodes(reffe) == [[1]]
@test get_face_own_dofs(reffe) == [[1,2]]
@test get_face_own_dofs_permutations(reffe) == [[[1, 2]]]
@test get_face_own_dofs_permutations(reffe) == [[[1, 2]]]
test_lagrangian_reference_fe(reffe)
@test ReferenceFE{0}(reffe,1) === reffe

Expand All @@ -79,11 +79,11 @@ refface = ReferenceFE{1}(reffe,8)
orders = (4,)
reffe = LagrangianRefFE(VectorValue{2,Float64},SEGMENT,orders)
@test get_own_nodes_permutations(reffe) == [[1, 2, 3], [3, 2, 1]]
@test get_own_dofs_permutations(reffe) == [[1, 2, 3, 4, 5, 6], [3, 2, 1, 6, 5, 4]]
@test get_own_dofs_permutations(reffe) == [[1, 2, 3, 4, 5, 6], [3, 2, 1, 6, 5, 4]]

orders = (2,3)
reffe = LagrangianRefFE(VectorValue{2,Float64},QUAD,orders)
@test get_own_nodes_permutations(reffe) ==[[1, 2], [0, 0], [1, 2], [0, 0], [0, 0], [2, 1], [0, 0], [2, 1]]
@test get_own_nodes_permutations(reffe) ==[[1, 2], [0, 0], [1, 2], [0, 0], [0, 0], [2, 1], [0, 0], [2, 1]]
@test get_own_dofs_permutations(reffe) == [
[1, 2, 3, 4], [0, 0, 0, 0], [1, 2, 3, 4], [0, 0, 0, 0],
[0, 0, 0, 0], [2, 1, 4, 3], [0, 0, 0, 0], [2, 1, 4, 3]]
Expand Down Expand Up @@ -138,7 +138,7 @@ reffe = LagrangianRefFE(VectorValue{2,Float64},QUAD,orders)
@test num_nodes(reffe) == 1
test_lagrangian_reference_fe(reffe)

@test get_face_own_dofs(reffe) == Array{Int64,1}[[], [], [], [], [], [], [], [], [1, 2]]
@test get_face_own_dofs(reffe) == Array{Int,1}[[], [], [], [], [], [], [], [], [1, 2]]
#@test get_face_own_dofs_permutations(reffe) == [
# [[]],[[]],[[]],[[]],[[],[]],[[],[]],[[],[]],[[],[]],[[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2]]]
@test get_face_own_dofs_permutations(reffe) == [
Expand Down
4 changes: 2 additions & 2 deletions test/TensorValuesTests/OperationsTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ v = TensorValue{2,3}(1,0,0,1,0,0)

v = TensorValue{2,3}(1,0,0,1,1,0)
@test meas(v) ≈ sqrt(2)

# Broadcasted operations

a = VectorValue(1,2,3)
Expand Down Expand Up @@ -503,7 +503,7 @@ Sym4TensorIndexing = [1111, 1121, 1131, 1122, 1132, 1133, 2111, 2121, 2131, 2122
3111, 3121, 3131, 3122, 3132, 3133, 2211, 2221, 2231, 2222, 2232, 2233,
2311, 2321, 2331, 2322, 2332, 2333, 3311, 3321, 3331, 3322, 3332, 3333]
test1 = test2 = SymFourthOrderTensorValue(1:36...)
result = Int64[]
result = Int[]
for off_index in Sym4TensorIndexing
i = parse(Int,string(off_index)[1]); j = parse(Int,string(off_index)[2]);
m = parse(Int,string(off_index)[3]); p = parse(Int,string(off_index)[4]);
Expand Down
4 changes: 2 additions & 2 deletions test/TensorValuesTests/TypesTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,11 @@ v = TensorValue{3,2,Float64}(1,2,3,4,5,6)
s = "(1.0, 2.0, 3.0, 4.0, 5.0, 6.0)"
@test string(v) == s

v = SymTensorValue{3,Int64}(1, 0, 0, 1, 0, 1)
v = SymTensorValue{3,Int}(1, 0, 0, 1, 0, 1)
s = "(1, 0, 0, 1, 0, 1)"
@test string(v) == s

v = SymFourthOrderTensorValue{2,Int64}(1111,1121,1122, 2111,2121,2122, 2211,2221,2222)
v = SymFourthOrderTensorValue{2,Int}(1111,1121,1122, 2111,2121,2122, 2211,2221,2222)
s = "(1111, 1121, 1122, 2111, 2121, 2122, 2211, 2221, 2222)"
@test string(v) == s

Expand Down