From 047b6ea68263f8ccfb5ddbdd257f1ad628b29998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Mas=C3=B3?= Date: Thu, 15 Jan 2026 12:39:27 +0100 Subject: [PATCH 1/3] removed unused dependencies --- Project.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/Project.toml b/Project.toml index 70c491d..df90a49 100644 --- a/Project.toml +++ b/Project.toml @@ -9,14 +9,11 @@ BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e" DrWatson = "634d3b9d-ee7a-5ddf-bec9-22491ea816e1" ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" Gridap = "56d4f2e9-7ea1-5844-9cf6-b9c51ca7ce8e" -GridapDistributed = "f9701e48-63b3-45aa-9a63-9bc6c271f355" GridapGmsh = "3025c34a-b394-11e9-2a55-3fee550c04c8" -GridapPETSc = "bcdc36c2-0c3e-11ea-095a-c9dadae499f1" GridapSolvers = "6d3209ee-5e3c-4db7-a716-942eb12ed534" IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153" JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" -PartitionedArrays = "5a9dfac6-5c52-46f7-8278-5e2210713be9" Profile = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79" ProfileView = "c46f51b8-102a-5cf2-8d2c-8597cb0e0da7" Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" From ec2c4c72fbcfb8ad5aac363bb97d6140ce30c109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Mas=C3=B3?= Date: Thu, 15 Jan 2026 14:44:13 +0100 Subject: [PATCH 2/3] tmp disabling --- src/ComputationalModels/ComputationalModels.jl | 18 +++++++++--------- src/ComputationalModels/FESpaces.jl | 6 +++--- src/ComputationalModels/GridapExtras.jl | 18 +++++++++--------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/ComputationalModels/ComputationalModels.jl b/src/ComputationalModels/ComputationalModels.jl index 3f850de..6872b57 100644 --- a/src/ComputationalModels/ComputationalModels.jl +++ b/src/ComputationalModels/ComputationalModels.jl @@ -11,17 +11,17 @@ using Gridap.FESpaces: get_assembly_strategy import Gridap: solve! using BlockArrays -using GridapPETSc, GridapPETSc.PETSC -using GridapPETSc: PetscScalar, PetscInt, PETSC +# using GridapPETSc, GridapPETSc.PETSC +# using GridapPETSc: PetscScalar, PetscInt, PETSC -using GridapDistributed -using GridapDistributed: DistributedDiscreteModel, DistributedTriangulation, - DistributedFESpace, DistributedDomainContribution, to_parray_of_arrays, - allocate_in_domain, DistributedCellField, DistributedMultiFieldCellField, - DistributedMultiFieldFEBasis, BlockPMatrix, BlockPVector, change_ghost +# using GridapDistributed +# using GridapDistributed: DistributedDiscreteModel, DistributedTriangulation, +# DistributedFESpace, DistributedDomainContribution, to_parray_of_arrays, +# allocate_in_domain, DistributedCellField, DistributedMultiFieldCellField, +# DistributedMultiFieldFEBasis, BlockPMatrix, BlockPVector, change_ghost -using PartitionedArrays -using PartitionedArrays: getany +# using PartitionedArrays +# using PartitionedArrays: getany using GridapSolvers using GridapSolvers.LinearSolvers, GridapSolvers.NonlinearSolvers, GridapSolvers.BlockSolvers diff --git a/src/ComputationalModels/FESpaces.jl b/src/ComputationalModels/FESpaces.jl index db03aea..a21c8c7 100644 --- a/src/ComputationalModels/FESpaces.jl +++ b/src/ComputationalModels/FESpaces.jl @@ -146,9 +146,9 @@ function instantiate_caches(x, nls::Newton_RaphsonSolver, op::NonlinearOperator) end -function instantiate_caches(x, nls::PETScNonlinearSolver, op::NonlinearOperator) - return GridapPETSc._setup_cache(x, nls, op) -end +# function instantiate_caches(x, nls::PETScNonlinearSolver, op::NonlinearOperator) +# return GridapPETSc._setup_cache(x, nls, op) +# end diff --git a/src/ComputationalModels/GridapExtras.jl b/src/ComputationalModels/GridapExtras.jl index ff9394d..2a35793 100644 --- a/src/ComputationalModels/GridapExtras.jl +++ b/src/ComputationalModels/GridapExtras.jl @@ -16,15 +16,15 @@ get_local_matrix_type(a::Assembler) = get_matrix_type(a) get_local_vector_type(a::Assembler) = get_vector_type(a) get_local_assembly_strategy(a::Assembler) = get_assembly_strategy(a) -function get_local_matrix_type(a::GridapDistributed.DistributedSparseMatrixAssembler) - return getany(map(get_matrix_type,a.assems)) -end -function get_local_vector_type(a::GridapDistributed.DistributedSparseMatrixAssembler) - return getany(map(get_vector_type,a.assems)) -end -function get_local_assembly_strategy(a::GridapDistributed.DistributedSparseMatrixAssembler) - return get_assembly_strategy(a) -end +# function get_local_matrix_type(a::GridapDistributed.DistributedSparseMatrixAssembler) +# return getany(map(get_matrix_type,a.assems)) +# end +# function get_local_vector_type(a::GridapDistributed.DistributedSparseMatrixAssembler) +# return getany(map(get_vector_type,a.assems)) +# end +# function get_local_assembly_strategy(a::GridapDistributed.DistributedSparseMatrixAssembler) +# return get_assembly_strategy(a) +# end function get_local_matrix_type(a::MultiField.BlockSparseMatrixAssembler) return get_local_matrix_type(first(a.block_assemblers)) From 1e8585a9b977bdf99634897c40ecc0e339b3a414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Mas=C3=B3?= Date: Thu, 15 Jan 2026 15:10:10 +0100 Subject: [PATCH 3/3] try pkg extension --- Project.toml | 8 ++++++++ ext/ComputationalModels/ComputationalModels.jl | 11 +++++++++++ ext/ComputationalModels/FESpaces.jl | 6 ++++++ ext/ComputationalModels/GridapExtras.jl | 14 ++++++++++++++ ext/HyperFEMDistributed.jl | 7 +++++++ src/ComputationalModels/ComputationalModels.jl | 12 ------------ src/ComputationalModels/FESpaces.jl | 11 ----------- src/ComputationalModels/GridapExtras.jl | 10 ---------- 8 files changed, 46 insertions(+), 33 deletions(-) create mode 100644 ext/ComputationalModels/ComputationalModels.jl create mode 100644 ext/ComputationalModels/FESpaces.jl create mode 100644 ext/ComputationalModels/GridapExtras.jl create mode 100644 ext/HyperFEMDistributed.jl diff --git a/Project.toml b/Project.toml index df90a49..039636e 100644 --- a/Project.toml +++ b/Project.toml @@ -20,3 +20,11 @@ Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f" WriteVTK = "64499a7a-5c06-52f2-abe2-ccb03c286192" + +[weakdeps] +GridapDistributed = "f9701e48-63b3-45aa-9a63-9bc6c271f355" +GridapPETSc = "bcdc36c2-0c3e-11ea-095a-c9dadae499f1" +PartitionedArrays = "5a9dfac6-5c52-46f7-8278-5e2210713be9" + +[extensions] +HyperFEMDistributed = ["GridapDistributed", "GridapPETSc", "PartitionedArrays"] diff --git a/ext/ComputationalModels/ComputationalModels.jl b/ext/ComputationalModels/ComputationalModels.jl new file mode 100644 index 0000000..de08eb9 --- /dev/null +++ b/ext/ComputationalModels/ComputationalModels.jl @@ -0,0 +1,11 @@ +module ComputationalModels + +using HyperFEM +using Gridap, GridapDistributed, GridapPETSc +using PartitionedArrays +using PartitionedArrays: getany + +include("FESpaces.jl") +include("GridapExtras.jl") + +end diff --git a/ext/ComputationalModels/FESpaces.jl b/ext/ComputationalModels/FESpaces.jl new file mode 100644 index 0000000..c260bfd --- /dev/null +++ b/ext/ComputationalModels/FESpaces.jl @@ -0,0 +1,6 @@ + +import HyperFEM.instantiate_caches + +function instantiate_caches(x, nls::PETScNonlinearSolver, op::NonlinearOperator) + return GridapPETSc._setup_cache(x, nls, op) +end diff --git a/ext/ComputationalModels/GridapExtras.jl b/ext/ComputationalModels/GridapExtras.jl new file mode 100644 index 0000000..5282d8c --- /dev/null +++ b/ext/ComputationalModels/GridapExtras.jl @@ -0,0 +1,14 @@ + +import HyperFEM.ComputationalModels.get_local_matrix_type +import HyperFEM.ComputationalModels.get_local_vector_type +import HyperFEM.ComputationalModels.get_local_assembly_strategy + +function get_local_matrix_type(a::GridapDistributed.DistributedSparseMatrixAssembler) + return getany(map(get_matrix_type,a.assems)) +end +function get_local_vector_type(a::GridapDistributed.DistributedSparseMatrixAssembler) + return getany(map(get_vector_type,a.assems)) +end +function get_local_assembly_strategy(a::GridapDistributed.DistributedSparseMatrixAssembler) + return get_assembly_strategy(a) +end diff --git a/ext/HyperFEMDistributed.jl b/ext/HyperFEMDistributed.jl new file mode 100644 index 0000000..570fc08 --- /dev/null +++ b/ext/HyperFEMDistributed.jl @@ -0,0 +1,7 @@ +module HyperFEMDistributed + +using HyperFEM + +include("ComputationalModels/ComputationalModels.jl") + +end \ No newline at end of file diff --git a/src/ComputationalModels/ComputationalModels.jl b/src/ComputationalModels/ComputationalModels.jl index 6872b57..c0dff03 100644 --- a/src/ComputationalModels/ComputationalModels.jl +++ b/src/ComputationalModels/ComputationalModels.jl @@ -11,18 +11,6 @@ using Gridap.FESpaces: get_assembly_strategy import Gridap: solve! using BlockArrays -# using GridapPETSc, GridapPETSc.PETSC -# using GridapPETSc: PetscScalar, PetscInt, PETSC - -# using GridapDistributed -# using GridapDistributed: DistributedDiscreteModel, DistributedTriangulation, -# DistributedFESpace, DistributedDomainContribution, to_parray_of_arrays, -# allocate_in_domain, DistributedCellField, DistributedMultiFieldCellField, -# DistributedMultiFieldFEBasis, BlockPMatrix, BlockPVector, change_ghost - -# using PartitionedArrays -# using PartitionedArrays: getany - using GridapSolvers using GridapSolvers.LinearSolvers, GridapSolvers.NonlinearSolvers, GridapSolvers.BlockSolvers using GridapSolvers.SolverInterfaces: SolverVerboseLevel, SOLVER_VERBOSE_NONE, SOLVER_VERBOSE_LOW, SOLVER_VERBOSE_HIGH diff --git a/src/ComputationalModels/FESpaces.jl b/src/ComputationalModels/FESpaces.jl index a21c8c7..a36f8f2 100644 --- a/src/ComputationalModels/FESpaces.jl +++ b/src/ComputationalModels/FESpaces.jl @@ -144,14 +144,3 @@ function instantiate_caches(x, nls::Newton_RaphsonSolver, op::NonlinearOperator) ns = numerical_setup(ss, A, x) return Newton_RaphsonCache(A, b, dx, ns) end - - -# function instantiate_caches(x, nls::PETScNonlinearSolver, op::NonlinearOperator) -# return GridapPETSc._setup_cache(x, nls, op) -# end - - - - - - diff --git a/src/ComputationalModels/GridapExtras.jl b/src/ComputationalModels/GridapExtras.jl index 2a35793..7c9cc86 100644 --- a/src/ComputationalModels/GridapExtras.jl +++ b/src/ComputationalModels/GridapExtras.jl @@ -16,16 +16,6 @@ get_local_matrix_type(a::Assembler) = get_matrix_type(a) get_local_vector_type(a::Assembler) = get_vector_type(a) get_local_assembly_strategy(a::Assembler) = get_assembly_strategy(a) -# function get_local_matrix_type(a::GridapDistributed.DistributedSparseMatrixAssembler) -# return getany(map(get_matrix_type,a.assems)) -# end -# function get_local_vector_type(a::GridapDistributed.DistributedSparseMatrixAssembler) -# return getany(map(get_vector_type,a.assems)) -# end -# function get_local_assembly_strategy(a::GridapDistributed.DistributedSparseMatrixAssembler) -# return get_assembly_strategy(a) -# end - function get_local_matrix_type(a::MultiField.BlockSparseMatrixAssembler) return get_local_matrix_type(first(a.block_assemblers)) end