diff --git a/src/Geometry/Simplexify.jl b/src/Geometry/Simplexify.jl index 75f4749f0..7f34b6fa3 100644 --- a/src/Geometry/Simplexify.jl +++ b/src/Geometry/Simplexify.jl @@ -241,14 +241,23 @@ end function _generate_ltcell_to_lpoints(ct::ConstantCellValue) extrusion = ct.value if extrusion == (HEX_AXIS, HEX_AXIS) - ltcell_to_lpoints = [[1,2,3],[4,3,2]] + ltcell_to_lpoints = [[1,2,3],[2,3,4]] return ltcell_to_lpoints elseif extrusion == (HEX_AXIS, HEX_AXIS, HEX_AXIS) ltcell_to_lpoints = [ - [7,3,2,1], [7,5,2,1], [7,4,3,2], [7,4,8,2], [7,6,5,2], [7,6,8,2]] + [1,2,3,7], [1,2,5,7], [2,3,4,7], [2,4,7,8], [2,5,6,7], [2,6,7,8]] else @notimplemented end end +function _orient_simplex_connectivities(cell_to_nodes_data, cell_to_nodes_ptrs) + cell_nodes = Gridap.CellValuesGallery.CellVectorFromDataAndPtrs(cell_to_nodes_data,cell_to_nodes_ptrs) + oriented = Int64[] + for i in cell_nodes + push!(oriented,sort(i)...) + end + return oriented +end + end # module diff --git a/test/temp_devs/HighOrderTets.jl b/test/temp_devs/HighOrderTets.jl index ad7f77c1b..78349d989 100644 --- a/test/temp_devs/HighOrderTets.jl +++ b/test/temp_devs/HighOrderTets.jl @@ -4,16 +4,27 @@ module HighOrderTets using Gridap, Test using Gridap.CellValuesGallery +import Gridap: ∇ + +using Gridap.Helpers +using UnstructuredGrids.Kernels: refine_grid_connectivity +using UnstructuredGrids.Kernels: generate_tface_to_face +using Gridap.DiscreteModels: DiscreteModelFromData +## + +## ufun(x) = x[1] + x[2] -ufun_grad(x) = VectorValue(1.0,1.0) +ufun_grad(x) = VectorValue(1.0,1.0,0.0) ∇(::typeof(ufun)) = ufun_grad bfun(x) = 0.0 # Construct the discrete model -model = CartesianDiscreteModel(domain=(0.0,1.0,0.0,1.0), partition=(2,2)) +model = CartesianDiscreteModel(domain=(0.0,1.0,0.0,1.0,0.0,1.0), partition=(4,4,4)) model = simplexify(model) -order = 2 + +order = 4 +# diritag = [1,2,3,4] diritag = "boundary" fespace = ConformingFESpace(Float64,model,order,diritag) @@ -29,6 +40,9 @@ quad = CellQuadrature(trian,order=6) a(v,u) = inner(∇(v), ∇(u)) b(v) = inner(v,bfun) +uh = interpolate(U,ufun) +sum(integrate(a(uh,uh),trian,quad)) + # Define Assembler assem = SparseMatrixAssembler(V,U) @@ -56,6 +70,10 @@ eh1 = sqrt(sum( integrate(h1(e),trian,quad) )) @test el2 < 1.e-8 @test eh1 < 1.e-8 +## +uhno = uh +uho = uh +writevtk(trian,"trian",cellfields=["uh"=>uh]) # 1) Clean constructors without D or T