Skip to content
Open
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
11 changes: 8 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,22 @@ 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"
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"]
11 changes: 11 additions & 0 deletions ext/ComputationalModels/ComputationalModels.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module ComputationalModels

using HyperFEM
using Gridap, GridapDistributed, GridapPETSc
using PartitionedArrays
using PartitionedArrays: getany

include("FESpaces.jl")
include("GridapExtras.jl")

end
6 changes: 6 additions & 0 deletions ext/ComputationalModels/FESpaces.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

import HyperFEM.instantiate_caches

function instantiate_caches(x, nls::PETScNonlinearSolver, op::NonlinearOperator)
return GridapPETSc._setup_cache(x, nls, op)
end
14 changes: 14 additions & 0 deletions ext/ComputationalModels/GridapExtras.jl
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions ext/HyperFEMDistributed.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module HyperFEMDistributed

using HyperFEM

include("ComputationalModels/ComputationalModels.jl")

end
12 changes: 0 additions & 12 deletions src/ComputationalModels/ComputationalModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 0 additions & 11 deletions src/ComputationalModels/FESpaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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






10 changes: 0 additions & 10 deletions src/ComputationalModels/GridapExtras.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down