You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Documents an error that I have found along with an associated MWE.
Not urgent, I found a work-around.
As of now, I don't fully understand what might be missing. Thus not sure if the solution has to be applied in GridapSolvers.jl or somewhere else.
The MWE is as follows:
using MPI
using Gridap
using Gridap.FESpaces
using GridapDistributed
using PartitionedArrays
using GridapP4est
using GridapSolvers
using GridapSolvers.MultilevelTools
u(x) = x[1]+x[2]
functionget_model(model)
if (isa(model,GridapDistributed.GenericDistributedDiscreteModel))
return model.models.part
elsereturn model.dmodel.models.part
endendfunctionmain(parts,num_parts_x_level)
GridapP4est.with(parts) do# Start from coarse, refine models
domain = (0,1,0,1)
num_levels =length(num_parts_x_level)
cparts =generate_subparts(parts,num_parts_x_level[num_levels])
cmodel =CartesianDiscreteModel(domain,(2,2))
coarse_model =OctreeDistributedDiscreteModel(cparts,cmodel,2)
mh =ModelHierarchy(parts,coarse_model,num_parts_x_level)
reffe =ReferenceFE(lagrangian,Float64,1)
tests =TestFESpace(mh,reffe,conformity=:H1)
trials =TrialFESpace(tests,u)
model=get_model(mh.levels[1].model)
V0 = tests[1].fe_space.spaces.part
Ug = trials[1].fe_space.spaces.part
Ω =Triangulation(model)
dΩ =Measure(Ω, 2)
uh=FEFunction(Ug,rand(num_free_dofs(Ug)))
eh=uh-u
(∇(u)-∇(uh))⋅(∇(u)-∇(uh)) # Works ok ∇(eh)⋅∇(eh) # Fails for num_levels>1endend# WORKS OK
num_parts_x_level = [1]
ranks = num_parts_x_level[1]
with_backend(main,MPIBackend(),ranks,num_parts_x_level)
# GENERATES ERROR # ERROR: This function belongs to an interface definition and cannot be used# I would say the source of the difference to be related to the types of the data structures in the first # level of the hierarchy versus those of the unique level
num_parts_x_level = [1,1] # Procs in each refinement level
ranks = num_parts_x_level[1,1]
with_backend(main,MPIBackend(),ranks,num_parts_x_level)
MPI.Finalize()
Documents an error that I have found along with an associated MWE.
Not urgent, I found a work-around.
As of now, I don't fully understand what might be missing. Thus not sure if the solution has to be applied in
GridapSolvers.jl
or somewhere else.The MWE is as follows:
and the error
The text was updated successfully, but these errors were encountered: