Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geometry #662

Merged
merged 39 commits into from
Sep 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f090f32
Starting refactoring of Geometry module.
fverdugo Sep 9, 2021
273884b
Added New Triangulation
fverdugo Sep 10, 2021
8ad357c
Adding new files
fverdugo Sep 10, 2021
0da34d1
Moving old files
fverdugo Sep 10, 2021
8352f64
Renamings
fverdugo Sep 10, 2021
685d1fd
moving old files
fverdugo Sep 10, 2021
4041b74
Adding facet_normal to UnstructuredGrid
fverdugo Sep 11, 2021
1f8b658
Added inverse id map to FaceToFace glue
fverdugo Sep 11, 2021
e4bc513
Implemented Base.view(::Grid,::AbstractArray)
fverdugo Sep 11, 2021
31cc27a
New BoundaryTriangulation
fverdugo Sep 11, 2021
5a74d2b
New SkeletonTriangulation
fverdugo Sep 11, 2021
af98406
New AppendedTriangulation
fverdugo Sep 11, 2021
7121242
Base.view(::Triangulation,::AbstractArray)
fverdugo Sep 11, 2021
55e6f67
moving outdated files to OLD folder before deleting them
fverdugo Sep 13, 2021
91efeea
Implemented extend function
fverdugo Sep 14, 2021
15ab2ff
CellFields starting to work with new machinery
fverdugo Sep 14, 2021
0d4b5e9
Moving part of CellField test depending on FESpaces
fverdugo Sep 15, 2021
3e4d1ad
Fixing DiracDelta
fverdugo Sep 15, 2021
961845f
fixing CellDOfs
fverdugo Sep 15, 2021
1637fbd
Visualization
fverdugo Sep 15, 2021
d38b620
Saving changes
fverdugo Sep 15, 2021
49b6345
Changes in CLagrangianFESpaces
fverdugo Sep 16, 2021
4bdc27c
get_discrete_model -> get_background_model
fverdugo Sep 16, 2021
1ebd6ca
get_active_model
fverdugo Sep 16, 2021
b51a720
Saving changes
fverdugo Sep 16, 2021
b2da4f5
FESpacesTests/runtests_1.jl working
fverdugo Sep 17, 2021
ed4c347
Recovering the functionality previously given by ExtendedFESpace
fverdugo Sep 17, 2021
98d961b
FESpaces module working
fverdugo Sep 17, 2021
2aeabe9
MultiField working
fverdugo Sep 23, 2021
673dd19
Fixing FESpacesWithLinearConstraintsTests
fverdugo Sep 23, 2021
f3e4a4b
Fixing SurfaceCouplingTests
fverdugo Sep 23, 2021
23ccc27
Implemented CompositeTriangulation
fverdugo Sep 23, 2021
d9ba628
Advancing with PoissonLagrangeMultiplierTests
fverdugo Sep 23, 2021
c77a239
PoissonLagrangeMultiplierTests working
fverdugo Sep 24, 2021
97bbe71
Minor bugfix
fverdugo Sep 24, 2021
0193267
Added aliases Boundary and Skeleton
fverdugo Sep 25, 2021
eb45d39
Merge branch 'release_0.17' of github.com:gridap/Gridap.jl into geometry
fverdugo Sep 27, 2021
879bf6d
Update NEWS.md
fverdugo Sep 27, 2021
44ae0fb
Removing old files and functions.
fverdugo Sep 27, 2021
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
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [0.17.0] - Unreleased

### Added

- Aliases `Boundary`, `Skeleton`, and `Interface` for the `BoundaryTriangulation`, `SkeletonTriangulation`, and `InterfaceTriangulation` constructors. Since PR [#662](https://github.com/gridap/Gridap.jl/pull/662).

### Changed

- Major refactoring in the `Triangulation` interface to properly support the solution of PDEs defined on domains of different dimension. The major change from the user perspective is that `Triangulation` objects can be used both to integrate the weak form (as before) but also to define FE spaces (except for unfitted triangulations obviously). It is still possible to define FE spaces from `DiscreteModels`, but it is safer and more idiomatic (closer to the math notation) to use `Triangulation` objects from now on. Since PR [#662](https://github.com/gridap/Gridap.jl/pull/662).

### Removed

- `BoundaryDiscreteModel`, `RestrictedDiscreteMdeol`, `RestrictedTriangulation`, `TriangulationStyle`, `BackgroundTriangulation`, `SubTriangulation`, `get_cell_to_bgcell`, `get_cell_ref_map`, `get_background_triangulation`, and `have_compatible_domains`. Since PR [#662](https://github.com/gridap/Gridap.jl/pull/662).

## [0.16.5] - 2021-09-08

### Added
Expand Down
3 changes: 2 additions & 1 deletion src/Arrays/PosNegReindex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ end
function pos_and_neg_length(i_to_iposneg)
Npos = maximum(i_to_iposneg)
Nneg = -minimum(i_to_iposneg)
Npos, Nneg
Npos==-1 ? 0 : Npos , Nneg
end

function is_exhaustive(i_to_iposneg)
Expand Down Expand Up @@ -210,3 +210,4 @@ all_neg(a::PosNegPartition) = length(a.ipos_to_i)==0
# i = j_to_i[j]
# i_to_v[i]=v
# end

76 changes: 66 additions & 10 deletions src/CellData/CellDofs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,74 @@ function change_domain(a::CellDof,::PhysicalDomain,::ReferenceDomain)
@notimplemented
end

function change_domain(a::CellDof,target_trian::Triangulation,target_domain::DomainStyle)
@notimplemented
function change_domain(a::CellDof,ttrian::Triangulation,target_domain::DomainStyle)
change_domain(a,DomainStyle(a),ttrian,target_domain)
end

function change_domain(a::CellDof,::ReferenceDomain,ttrian::Triangulation,::ReferenceDomain)
msg = """\n
We cannot move the given CellDof to the reference domain of the requested triangulation.
Make sure that the given triangulation is either the same as the triangulation on which the
CellDof is defined, or that the latter triangulation is the background of the former.
"""
strian = get_triangulation(a)
if strian === ttrian
return a
end
@assert is_change_possible(strian,ttrian) msg
D = num_cell_dims(strian)
sglue = get_glue(strian,Val(D))
tglue = get_glue(ttrian,Val(D))
change_domain_ref_ref(a,ttrian,sglue,tglue)
end

function change_domain(a::CellDof,::PhysicalDomain,ttrian::Triangulation,::PhysicalDomain)
msg = """\n
We cannot move the given CellDof to the physical domain of the requested triangulation.
Make sure that the given triangulation is either the same as the triangulation on which the
CellDof is defined, or that the latter triangulation is the background of the former.
"""
strian = get_triangulation(a)
if strian === ttrian
return a
end
@assert is_change_possible(strian,ttrian) msg
D = num_cell_dims(strian)
sglue = get_glue(strian,Val(D))
tglue = get_glue(ttrian,Val(D))
change_domain_phys_phys(a,ttrian,sglue,tglue)
end

function change_domain(a::CellDof,::PhysicalDomain,trian::Triangulation,::ReferenceDomain)
a_trian = change_domain(a,trian,PhysicalDomain())
change_domain(a_trian,ReferenceDomain())
end

function change_domain(a::CellDof,::ReferenceDomain,trian::Triangulation,::PhysicalDomain)
a_phys = change_domain(a,PhysicalDomain())
change_domain(a_phys,trian,PhysicalDomain())
end

function change_domain_ref_ref(
a::CellDof,ttrian::Triangulation,sglue::FaceToFaceGlue,tglue::FaceToFaceGlue)
sface_to_dof = get_data(a)
mface_to_sface = sglue.mface_to_tface
tface_to_mface = tglue.tface_to_mface
tface_to_mface_map = tglue.tface_to_mface_map
mface_to_dof = extend(sface_to_dof,mface_to_sface)
tface_to_dof = lazy_map(Reindex(mface_to_dof),tface_to_mface)
@notimplementedif ! isa(tface_to_mface_map,AbstractArray{<:GenericField{typeof(identity)}})
CellDof(tface_to_dof,ttrian,ReferenceDomain())
end

function change_domain(a::CellDof,target_trian::RestrictedTriangulation,target_domain::DomainStyle)
@notimplementedif DomainStyle(a) != target_domain
trian_a = get_triangulation(a)
@notimplementedif ! have_compatible_domains(trian_a,get_background_triangulation(target_trian))
cell_dof = get_data(a)
tcell_to_cell = get_cell_to_bgcell(target_trian)
tcell_dof = lazy_map(Reindex(cell_dof),tcell_to_cell)
CellDof(tcell_dof,target_trian,DomainStyle(a))
function change_domain_phys_phys(
a::CellDof,ttrian::Triangulation,sglue::FaceToFaceGlue,tglue::FaceToFaceGlue)
sface_to_dof = get_data(a)
mface_to_sface = sglue.mface_to_tface
tface_to_mface = tglue.tface_to_mface
mface_to_dof = extend(sface_to_dof,mface_to_sface)
tface_to_dof = lazy_map(Reindex(mface_to_dof),tface_to_mface)
CellDof(tface_to_dof,ttrian,PhysicalDomain())
end

function get_cell_points(dofs::CellDof)
Expand Down
Loading