From 87b0db8cd378d4f99f18c0b0cccb6ec46c368e1c Mon Sep 17 00:00:00 2001 From: Petr Krysl Date: Thu, 5 Oct 2023 17:16:26 -0700 Subject: [PATCH] implement separate floating point type for geometry --- Project.toml | 2 +- examples/Manifest.toml | 56 +++++++++++++++++++---------------- src/FEMMHeatDiffModule.jl | 22 +++++++------- src/FEMMHeatDiffSurfModule.jl | 15 ++++------ 4 files changed, 49 insertions(+), 46 deletions(-) diff --git a/Project.toml b/Project.toml index bcd73e0..d4eb44c 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "FinEtoolsHeatDiff" uuid = "972d1c22-8bdd-11e9-11cf-cdcb7577b041" authors = ["Petr Krysl "] -version = "2.1.3" +version = "2.1.4" [deps] Arpack = "7d9fca2a-8960-54d3-9f78-7d1dccf2cb97" diff --git a/examples/Manifest.toml b/examples/Manifest.toml index 40d69ee..814c716 100644 --- a/examples/Manifest.toml +++ b/examples/Manifest.toml @@ -1,6 +1,6 @@ # This file is machine-generated - editing it directly is not advised -julia_version = "1.9.3" +julia_version = "1.10.0-beta3" manifest_format = "2.0" project_hash = "6f530ee51527a0c5789df4549b51b1b924c93a1d" @@ -121,7 +121,7 @@ weakdeps = ["Dates", "LinearAlgebra"] [[deps.CompilerSupportLibraries_jll]] deps = ["Artifacts", "Libdl"] uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" -version = "1.0.5+0" +version = "1.0.5+1" [[deps.CpuId]] deps = ["Markdown"] @@ -194,9 +194,9 @@ version = "7.0.5" [[deps.FinEtoolsHeatDiff]] deps = ["Arpack", "FinEtools", "LinearAlgebra", "SparseArrays", "Statistics", "Test"] -git-tree-sha1 = "d68c687928ac587dbe022e82395682b1f331e8db" +git-tree-sha1 = "46b5d89cbbf49d537541ab9ade6a2b64b4fce48f" uuid = "972d1c22-8bdd-11e9-11cf-cdcb7577b041" -version = "2.1.0" +version = "2.1.2" [[deps.HDF5]] deps = ["Compat", "HDF5_jll", "Libdl", "Mmap", "Printf", "Random", "Requires", "UUIDs"] @@ -274,21 +274,26 @@ uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" [[deps.LibCURL]] deps = ["LibCURL_jll", "MozillaCACerts_jll"] uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" -version = "0.6.3" +version = "0.6.4" [[deps.LibCURL_jll]] deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" -version = "7.84.0+0" +version = "8.0.1+1" [[deps.LibGit2]] -deps = ["Base64", "NetworkOptions", "Printf", "SHA"] +deps = ["Base64", "LibGit2_jll", "NetworkOptions", "Printf", "SHA"] uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" +[[deps.LibGit2_jll]] +deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"] +uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5" +version = "1.6.4+0" + [[deps.LibSSH2_jll]] deps = ["Artifacts", "Libdl", "MbedTLS_jll"] uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" -version = "1.10.2+0" +version = "1.11.0+1" [[deps.Libdl]] uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" @@ -375,20 +380,20 @@ uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" [[deps.MbedTLS_jll]] deps = ["Artifacts", "Libdl"] uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" -version = "2.28.2+0" +version = "2.28.2+1" [[deps.MicrosoftMPI_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "a8027af3d1743b3bfae34e54872359fdebb31422" +git-tree-sha1 = "a7023883872e52bc29bcaac74f19adf39347d2d5" uuid = "9237b28f-5490-5468-be7b-bb81f5f5e6cf" -version = "10.1.3+4" +version = "10.1.4+0" [[deps.Mmap]] uuid = "a63ad114-7e13-5084-954f-fe012c677804" [[deps.MozillaCACerts_jll]] uuid = "14a3606d-f60d-562e-9121-12d972cd8159" -version = "2022.10.11" +version = "2023.1.10" [[deps.NetworkOptions]] uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" @@ -403,13 +408,13 @@ version = "1.12.10" [[deps.OpenBLAS_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" -version = "0.3.21+4" +version = "0.3.23+2" [[deps.OpenMPI_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML"] -git-tree-sha1 = "f3080f4212a8ba2ceb10a34b938601b862094314" +git-tree-sha1 = "e25c1778a98e34219a00455d6e4384e017ea9762" uuid = "fe0851c0-eecd-5654-98d4-656369965a5c" -version = "4.1.5+0" +version = "4.1.6+0" [[deps.OpenSSL_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -431,7 +436,7 @@ version = "2.7.2" [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" -version = "1.9.2" +version = "1.10.0" [[deps.PlotlyLight]] deps = ["Artifacts", "Cobweb", "DefaultApplication", "Downloads", "EasyConfig", "JSON3", "Random", "Scratch", "StructTypes"] @@ -472,7 +477,7 @@ uuid = "a5566ce3-012c-4b09-85b8-62131f0c3f36" version = "0.2.0" [[deps.Random]] -deps = ["SHA", "Serialization"] +deps = ["SHA"] uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [[deps.Requires]] @@ -523,6 +528,7 @@ uuid = "6462fe0b-24de-5631-8697-dd941f90decc" [[deps.SparseArrays]] deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" +version = "1.10.0" [[deps.Sparspak]] deps = ["Libdl", "LinearAlgebra", "Logging", "OffsetArrays", "Printf", "SparseArrays", "Test"] @@ -553,7 +559,7 @@ version = "1.4.1" [[deps.Statistics]] deps = ["LinearAlgebra", "SparseArrays"] uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" -version = "1.9.0" +version = "1.10.0" [[deps.StructTypes]] deps = ["Dates", "UUIDs"] @@ -568,7 +574,7 @@ uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" [[deps.SuiteSparse_jll]] deps = ["Artifacts", "Libdl", "Pkg", "libblastrampoline_jll"] uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" -version = "5.10.1+6" +version = "7.2.0+1" [[deps.SymRCM]] deps = ["LinearAlgebra", "SparseArrays", "Test"] @@ -646,14 +652,14 @@ version = "1.18.0" [[deps.XML2_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Zlib_jll"] -git-tree-sha1 = "04a51d15436a572301b5abbb9d099713327e9fc4" +git-tree-sha1 = "24b81b59bd35b3c42ab84fa589086e19be919916" uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a" -version = "2.10.4+0" +version = "2.11.5+0" [[deps.Zlib_jll]] deps = ["Libdl"] uuid = "83775a58-1f1d-513f-b197-d71354ab007a" -version = "1.2.13+0" +version = "1.2.13+1" [[deps.libaec_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -664,14 +670,14 @@ version = "1.0.6+1" [[deps.libblastrampoline_jll]] deps = ["Artifacts", "Libdl"] uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" -version = "5.8.0+0" +version = "5.8.0+1" [[deps.nghttp2_jll]] deps = ["Artifacts", "Libdl"] uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" -version = "1.48.0+0" +version = "1.52.0+1" [[deps.p7zip_jll]] deps = ["Artifacts", "Libdl"] uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" -version = "17.4.0+0" +version = "17.4.0+2" diff --git a/src/FEMMHeatDiffModule.jl b/src/FEMMHeatDiffModule.jl index e7ab788..efdbcbc 100644 --- a/src/FEMMHeatDiffModule.jl +++ b/src/FEMMHeatDiffModule.jl @@ -43,7 +43,7 @@ function FEMMHeatDiff(integdomain::IntegDomain{S, F}, material::M) where {S<:Abs return FEMMHeatDiff(integdomain, CSys(manifdim(integdomain.fes)), material) end -function _buffers1(self::FEMMHeatDiff, geom::NodalField{FloatT}, temp::NodalField{FloatT}) where {FloatT} +function _buffers1(self::FEMMHeatDiff, geom::NodalField{GFloatT}, temp::NodalField{FloatT}) where {GFloatT, FloatT} # Constants fes = self.integdomain.fes IntT = eltype(temp.dofnums) @@ -68,7 +68,7 @@ function _buffers1(self::FEMMHeatDiff, geom::NodalField{FloatT}, temp::NodalFie end """ - conductivity(self::FEMMHeatDiff, assembler::A, geom::NodalField{FloatT}, temp::NodalField{FloatT}) where {A<:AbstractSysmatAssembler} + conductivity(self::FEMMHeatDiff, assembler::A, geom::NodalField{GFloatT}, temp::NodalField{FloatT}) where {A<:AbstractSysmatAssembler, GFloatT, FloatT} Compute the conductivity matrix. @@ -78,20 +78,20 @@ Compute the conductivity matrix. - `geom` = geometry field, - `temp` = temperature field """ -function conductivity(self::FEMMHeatDiff, assembler::A, geom::NodalField{FloatT}, temp::NodalField{FloatT}) where {A<:AbstractSysmatAssembler, FloatT} +function conductivity(self::FEMMHeatDiff, assembler::A, geom::NodalField{GFloatT}, temp::NodalField{FloatT}) where {A<:AbstractSysmatAssembler, GFloatT, FloatT} mdim = manifdim(finite_elements(self)) kappa_bar = fill(zero(FloatT), mdim, mdim); # buffer kappa_bar = tangentmoduli!(self.material, kappa_bar) return bilform_diffusion(self, assembler, geom, temp, DataCache(kappa_bar)); end -function conductivity(self::FEMMHeatDiff, geom::NodalField{FloatT}, temp::NodalField{FloatT}) where {FloatT} +function conductivity(self::FEMMHeatDiff, geom::NodalField{GFloatT}, temp::NodalField{FloatT}) where {GFloatT, FloatT} assembler = SysmatAssemblerSparseSymm(); return conductivity(self, assembler, geom, temp); end """ - energy(self::FEMMHeatDiff, geom::NodalField{FloatT}, temp::NodalField{FloatT}) + energy(self::FEMMHeatDiff, geom::NodalField{GFloatT}, temp::NodalField{FloatT}) where {GFloatT, FloatT} Compute the "energy" integral over the interior domain. @@ -103,7 +103,7 @@ and the heat flux. - `geom` = geometry field, - `temp` = temperature field """ -function energy(self::FEMMHeatDiff, geom::NodalField{FloatT}, temp::NodalField{FloatT}) where {FloatT} +function energy(self::FEMMHeatDiff, geom::NodalField{GFloatT}, temp::NodalField{FloatT}) where {GFloatT, FloatT} fes = self.integdomain.fes npts, Ns, gradNparams, w, pc = integrationdata(self.integdomain); # Prepare assembler and buffers @@ -132,7 +132,7 @@ function energy(self::FEMMHeatDiff, geom::NodalField{FloatT}, temp::NodalField{ end """ - inspectintegpoints(self::FEMMHeatDiff, geom::NodalField{FloatT}, u::NodalField{T}, temp::NodalField{FloatT}, felist::VecOrMat{IntT}, inspector::F, idat, quantity=:heatflux; context...) where {T<:Number, FloatT, IntT, F<:Function} + inspectintegpoints(self::FEMMHeatDiff, geom::NodalField{GFloatT}, u::NodalField{T}, temp::NodalField{FloatT}, felist::VecOrMat{IntT}, inspector::F, idat, quantity=:heatflux; context...) where {T<:Number, GFloatT, FloatT, IntT, F<:Function} Inspect integration point quantities. @@ -154,7 +154,7 @@ Inspect integration point quantities. # Output The updated inspector data is returned. """ -function inspectintegpoints(self::FEMMHeatDiff, geom::NodalField{FloatT}, u::NodalField{T}, temp::NodalField{FloatT}, felist::VecOrMat{IntT}, inspector::F, idat, quantity=:heatflux; context...) where {T<:Number, FloatT, IntT, F<:Function} +function inspectintegpoints(self::FEMMHeatDiff, geom::NodalField{GFloatT}, u::NodalField{T}, temp::NodalField{FloatT}, felist::VecOrMat{IntT}, inspector::F, idat, quantity=:heatflux; context...) where {T<:Number, GFloatT, FloatT, IntT, F<:Function} fes = self.integdomain.fes npts, Ns, gradNparams, w, pc = integrationdata(self.integdomain); ecoords, dofnums, loc, J, RmTJ, gradN, kappa_bar, kappa_bargradNT, elmat, elvec, elvecfix = _buffers1(self, geom, temp) @@ -203,7 +203,7 @@ function inspectintegpoints(self::FEMMHeatDiff, geom::NodalField{FloatT}, u::Nod end """ - capacity(self::FEMMHeatDiff, assembler::A, geom::NodalField{FloatT}, temp::NodalField{FloatT}) where {A<:AbstractSysmatAssembler, FloatT} + capacity(self::FEMMHeatDiff, assembler::A, geom::NodalField{GFloatT}, temp::NodalField{FloatT}) where {A<:AbstractSysmatAssembler, GFloatT, FloatT} Compute the capacity matrix. @@ -213,11 +213,11 @@ Compute the capacity matrix. - `geom` = geometry field, - `temp` = temperature field """ -function capacity(self::FEMMHeatDiff, assembler::A, geom::NodalField{FloatT}, temp::NodalField{FloatT}) where {A<:AbstractSysmatAssembler, FloatT} +function capacity(self::FEMMHeatDiff, assembler::A, geom::NodalField{GFloatT}, temp::NodalField{FloatT}) where {A<:AbstractSysmatAssembler, GFloatT, FloatT} return bilform_dot(self, assembler, geom, temp, DataCache(self.material.specific_heat)) end -function capacity(self::FEMMHeatDiff, geom::NodalField{FloatT}, temp::NodalField{FloatT}) where {FloatT} +function capacity(self::FEMMHeatDiff, geom::NodalField{GFloatT}, temp::NodalField{FloatT}) where {GFloatT, FloatT} assembler = SysmatAssemblerSparseSymm(); return capacity(self, assembler, geom, temp); end diff --git a/src/FEMMHeatDiffSurfModule.jl b/src/FEMMHeatDiffSurfModule.jl index ab5033b..361712f 100644 --- a/src/FEMMHeatDiffSurfModule.jl +++ b/src/FEMMHeatDiffSurfModule.jl @@ -33,7 +33,7 @@ function FEMMHeatDiffSurf(integdomain::ID) where {ID<:IntegDomain} end """ - surfacetransfer(self::FEMMHeatDiffSurf, assembler::A, geom::NodalField{FloatT}, temp::NodalField{FloatT}) where {A<:AbstractSysmatAssembler, FloatT} + surfacetransfer(self::FEMMHeatDiffSurf, assembler::A, geom::NodalField{GFloatT}, temp::NodalField{FloatT}) where {A<:AbstractSysmatAssembler, GFloatT, FloatT} Compute the surface heat transfer matrix. @@ -43,17 +43,17 @@ Compute the surface heat transfer matrix. - `geom` = geometry field, - `temp` = temperature field """ -function surfacetransfer(self::FEMMHeatDiffSurf, assembler::A, geom::NodalField{FloatT}, temp::NodalField{FloatT}) where {A<:AbstractSysmatAssembler, FloatT} +function surfacetransfer(self::FEMMHeatDiffSurf, assembler::A, geom::NodalField{GFloatT}, temp::NodalField{FloatT}) where {A<:AbstractSysmatAssembler, GFloatT, FloatT} return bilform_dot(self, assembler, geom, temp, DataCache(self.surfacetransfercoeff); m = 2); # two dimensional, surface, domain end -function surfacetransfer(self::FEMMHeatDiffSurf, geom::NodalField{FloatT}, temp::NodalField{FloatT}) where {FloatT} +function surfacetransfer(self::FEMMHeatDiffSurf, geom::NodalField{GFloatT}, temp::NodalField{FloatT}) where {GFloatT, FloatT} assembler = SysmatAssemblerSparseSymm() return surfacetransfer(self, assembler, geom, temp); end """ - surfacetransferloads(self::FEMMHeatDiffSurf, assembler::A, geom::NodalField{FloatT}, temp::NodalField{FloatT}, ambtemp::NodalField{FloatT}) where {A<:AbstractSysvecAssembler, FloatT} + surfacetransferloads(self::FEMMHeatDiffSurf, assembler::A, geom::NodalField{GFloatT}, temp::NodalField{FloatT}, ambtemp::NodalField{FloatT}) where {A<:AbstractSysvecAssembler, GFloatT, FloatT} Compute the load vector corresponding to surface heat transfer. @@ -64,7 +64,7 @@ Compute the load vector corresponding to surface heat transfer. - `temp` = temperature field - `ambtemp` = ambient temperature field on the surface """ -function surfacetransferloads(self::FEMMHeatDiffSurf, assembler::A, geom::NodalField{FloatT}, temp::NodalField{FloatT}, ambtemp::NodalField{FloatT}) where {A<:AbstractSysvecAssembler, FloatT} +function surfacetransferloads(self::FEMMHeatDiffSurf, assembler::A, geom::NodalField{GFloatT}, temp::NodalField{FloatT}, ambtemp::NodalField{FloatT}) where {A<:AbstractSysvecAssembler, GFloatT, FloatT} fes = self.integdomain.fes # Constants nfes = count(fes); # number of finite elements in the set @@ -103,10 +103,7 @@ function surfacetransferloads(self::FEMMHeatDiffSurf, assembler::A, geom::Noda return F end -function surfacetransferloads(self::FEMMHeatDiffSurf, - geom::NodalField{FloatT}, - temp::NodalField{FloatT}, - ambtemp::NodalField{FloatT}) where {FloatT} +function surfacetransferloads(self::FEMMHeatDiffSurf, geom::NodalField{GFloatT}, temp::NodalField{FloatT}, ambtemp::NodalField{FloatT}) where {GFloatT, FloatT} assembler = SysvecAssembler() return surfacetransferloads(self, assembler, geom, temp, ambtemp); end