Skip to content

Commit

Permalink
Intersection in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
henrij22 committed Apr 23, 2024
1 parent b038100 commit afee2a5
Show file tree
Hide file tree
Showing 37 changed files with 512 additions and 965 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ AllowAllParametersOfDeclarationOnNextLine: false
AlwaysBreakTemplateDeclarations: Yes
AllowShortLoopsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortFunctionsOnASingleLine: Empty
ColumnLimit: 120
QualifierAlignment: Left
ConstructorInitializerAllOnOneLineOrOnePerLine: true
Expand Down
4 changes: 2 additions & 2 deletions dune/iga/geometrykernel/nurbspatchgeometrylocalview.hh
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ namespace GeometryKernel {
std::conditional_t<isParameterSpaceGeometryProvided, LocalParameterSpaceGeometry,
typename Trimmer::template Codim<codim>::LocalParameterSpaceGeometry>;

//! if we have codim==0, then the Jacobian in the parameter space of the grid entity itself is a DiagonalMatrix,
//! and
// if we have codim==0, then the Jacobian in the parameter space of the grid entity itself is a DiagonalMatrix,
// and
// Coordinates in a single knot span differ from coordinates on the B-spline patch
// by an affine transformation. This transformation is stored in the diagonal entries.
// If trimming is disabled the Jacobian in the parameter space of subentities (edges or surfaces) is a
Expand Down
36 changes: 18 additions & 18 deletions dune/iga/hierarchicpatch/patchgrid.hh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class PatchGrid : public GridDefaultImplementation<dim, dimworld, ScalarType, Gr
friend GridFamily_<dim, dimworld, ScalarType>::GlobalIdSet;
friend GridFamily_<dim, dimworld, ScalarType>::LocalIdSet;

//! type of the used GridFamily for this grid
// type of the used GridFamily for this grid
public:
using GridFamily = GridFamily_<dim, dimworld, ScalarType>;

Expand Down Expand Up @@ -116,7 +116,7 @@ private:

public:
using Trimmer = typename GridFamily::Trimmer;
//! The type used to store coordinates, inherited from the Trimmer
// The type used to store coordinates, inherited from the Trimmer
using ctype = typename Trimmer::ctype;

friend Trimmer;
Expand All @@ -143,7 +143,7 @@ public:
// The Interface Methods
//**********************************************************

//! the Traits
// the Traits
using Traits = typename GridFamily::Traits;

using ParameterSpaceGrid = typename Trimmer::ParameterSpaceGrid;
Expand Down Expand Up @@ -178,49 +178,49 @@ public:
return trimmer_->maxLevel();
}

//! Iterator to first entity of given codim on level
// Iterator to first entity of given codim on level
template <int codim>
typename Traits::template Codim<codim>::LevelIterator lbegin(int level) const {
return LevelIteratorImpl<codim, All_Partition>(this, level);
}

//! one past the end on this level
// one past the end on this level
template <int codim>
typename Traits::template Codim<codim>::LevelIterator lend(int level) const {
return LevelIteratorImpl<codim, All_Partition>(this, level, true);
}

//! Iterator to first entity of given codim on level
// Iterator to first entity of given codim on level
template <int codim, PartitionIteratorType PiType>
typename Traits::template Codim<codim>::template Partition<PiType>::LevelIterator lbegin(int level) const {
return LevelIteratorImpl<codim, PiType>(this, level);
}

//! one past the end on this level
// one past the end on this level
template <int codim, PartitionIteratorType PiType>
typename Traits::template Codim<codim>::template Partition<PiType>::LevelIterator lend(int level) const {
return LevelIteratorImpl<codim, PiType>(this, level, true);
}

//! Iterator to first leaf entity of given codim
// Iterator to first leaf entity of given codim
template <int codim>
typename Traits::template Codim<codim>::LeafIterator leafbegin() const {
return LeafIteratorImpl<codim, All_Partition>(this);
}

//! one past the end of the sequence of leaf entities
// one past the end of the sequence of leaf entities
template <int codim>
typename Traits::template Codim<codim>::LeafIterator leafend() const {
return LeafIteratorImpl<codim, All_Partition>(this, true);
}

//! Iterator to first leaf entity of given codim
// Iterator to first leaf entity of given codim
template <int codim, PartitionIteratorType PiType>
typename Traits::template Codim<codim>::template Partition<PiType>::LeafIterator leafbegin() const {
return LeafIteratorImpl<codim, PiType>(this);
}

//! one past the end of the sequence of leaf entities
// one past the end of the sequence of leaf entities
template <int codim, PartitionIteratorType PiType>
typename Traits::template Codim<codim>::template Partition<PiType>::LeafIterator leafend() const {
return LeafIteratorImpl<codim, PiType>(this, true);
Expand All @@ -239,17 +239,17 @@ public:
return trimmer_->parameterSpaceGrid().numBoundarySegments();
}

//! number of leaf entities per codim in this process
// number of leaf entities per codim in this process
[[nodiscard]] int size(int codim) const {
return leafIndexSet().size(codim);
}

//! number of entities per level, codim and geometry type in this process
// number of entities per level, codim and geometry type in this process
int size(int level, GeometryType type) const {
return levelIndexSet(level).size(type);
}

//! number of leaf entities per codim and geometry type in this process
// number of leaf entities per codim and geometry type in this process
int size(GeometryType type) const {
return leafIndexSet().size(type);
}
Expand Down Expand Up @@ -401,7 +401,7 @@ public:
return trimmer_->paramterSpaceGrid().preAdapt();
}

//! Triggers the grid refinement process
// Triggers the grid refinement process
bool adapt() {
return trimmer_->paramterSpaceGrid().adapt();
}
Expand Down Expand Up @@ -465,15 +465,15 @@ public:
// End of Interface Methods
// **********************************************************

//! Returns the hostgrid this PatchGrid lives in
// Returns the hostgrid this PatchGrid lives in
const ParameterSpaceGrid& parameterSpaceGrid() const {
return trimmer_->parameterSpaceGrid();
}
ParameterSpaceGrid& parameterSpaceGrid() {
return trimmer_->parameterSpaceGrid();
}

//! Returns the hostgrid entity encapsulated in given PatchGrid entity
// Returns the hostgrid entity encapsulated in given PatchGrid entity
template <int codim>
requires(GridFamily::template hasHostEntity<codim>)
const typename GridFamily::TrimmerTraits::template Codim<codim>::ParameterSpaceGridEntity& getHostEntity(
Expand All @@ -500,7 +500,7 @@ private:
std::unique_ptr<Trimmer> trimmer_;

private:
//! @todo Please doc me !
// @todo Please doc me !
Communication<No_Comm> ccobj;

}; // end Class PatchGrid
Expand Down
50 changes: 25 additions & 25 deletions dune/iga/hierarchicpatch/patchgridentity.hh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public:

typedef typename GridImp::template Codim<codim>::Geometry Geometry;

//! The type of the EntitySeed interface class
// The type of the EntitySeed interface class
typedef typename GridImp::template Codim<codim>::EntitySeed EntitySeed;

PatchGridEntity()
Expand Down Expand Up @@ -97,15 +97,15 @@ public:

PatchGridEntity& operator=(const PatchGridEntity& original) {
if (this != &original) {
patchGrid_ = original.patchGrid_;
patchGrid_ = original.patchGrid_;
localEntity_ = original.localEntity_;
}
return *this;
}

PatchGridEntity& operator=(PatchGridEntity&& original) noexcept {
if (this != &original) {
patchGrid_ = original.patchGrid_;
patchGrid_ = original.patchGrid_;
localEntity_ = std::move(original.localEntity_);
}
return *this;
Expand All @@ -115,17 +115,17 @@ public:
return getLocalEntity() == other.getLocalEntity();
}

//! returns true if father entity exists
// returns true if father entity exists
bool hasFather() const {
return localEntity_.hasFather();
}

//! Create EntitySeed
// Create EntitySeed
EntitySeed seed() const {
return patchGrid_->trimmer_->seed(*this);
}

//! level of this element
// level of this element
int level() const {
return localEntity_.level();
}
Expand All @@ -142,7 +142,7 @@ public:
return localEntity_.subEntities(cc);
}

//! geometry of this entity
// geometry of this entity
Geometry geometry() const {
auto geo = typename Geometry::Implementation(
localEntity_.geometry(), patchGrid_->patchGeometries_[this->level()].template localView<codim, Trimmer>());
Expand Down Expand Up @@ -194,16 +194,16 @@ public:

typedef typename GridImp::template Codim<0>::LocalGeometry LocalGeometry;

//! The Iterator over intersections on this level
// The Iterator over intersections on this level
typedef typename GridImp::GridFamily::LevelIntersectionIterator LevelIntersectionIterator;

//! The Iterator over intersections on the leaf level
// The Iterator over intersections on the leaf level
typedef typename GridImp::GridFamily::LeafIntersectionIterator LeafIntersectionIterator;

//! Iterator over descendants of the entity
// Iterator over descendants of the entity
typedef typename GridImp::GridFamily::HierarchicIterator HierarchicIterator;

//! The type of the EntitySeed interface class
// The type of the EntitySeed interface class
typedef typename GridImp::template Codim<0>::EntitySeed EntitySeed;
typedef typename GridImp::Trimmer::TrimmerTraits::template Codim<0>::ParameterSpaceGridEntitySeed
ParameterSpaceGridEntitySeed;
Expand Down Expand Up @@ -253,17 +253,17 @@ public:
return localEntity_ == other.localEntity_;
}

//! returns true if father entity exists
// returns true if father entity exists
[[nodiscard]] bool hasFather() const {
return localEntity_.hasFather();
}

//! Create EntitySeed
// Create EntitySeed
[[nodiscard]] EntitySeed seed() const {
return patchGrid_->trimmer_->seed(*this);
}

//! Level of this element
// Level of this element
[[nodiscard]] int level() const {
return getLocalEntity().level();
}
Expand All @@ -273,7 +273,7 @@ public:
return getLocalEntity().partitionType();
}

//! Geometry of this entity
// Geometry of this entity
[[nodiscard]] Geometry geometry() const {
static_assert(std::is_same_v<
decltype(patchGrid_->patchGeometries_[this->level()].template localView<0, Trimmer>()),
Expand All @@ -298,33 +298,33 @@ public:
return PatchGridEntity<cc, dim, GridImp>(patchGrid_, localEntity_.template subEntity<cc>(i));
}

//! First level intersection
// First level intersection
[[nodiscard]] LevelIntersectionIterator ilevelbegin() const {
return patchGrid_->trimmer_->ilevelbegin(*this);
}

//! Reference to one past the last neighbor
// Reference to one past the last neighbor
LevelIntersectionIterator ilevelend() const {
return patchGrid_->trimmer_->ilevelend(*this);
}

//! First leaf intersection
// First leaf intersection
LeafIntersectionIterator ileafbegin() const {
return patchGrid_->trimmer_->ileafbegin(*this);
}

//! Reference to one past the last leaf intersection
// Reference to one past the last leaf intersection
LeafIntersectionIterator ileafend() const {
return patchGrid_->trimmer_->ileafend(*this);
}

//! returns true if Entity has NO children
// returns true if Entity has NO children
bool isLeaf() const {
return localEntity_.isLeaf();
}

//! Inter-level access to father element on coarser grid.
//! Assumes that meshes are nested.
// Inter-level access to father element on coarser grid.
// Assumes that meshes are nested.
typename GridImp::template Codim<0>::Entity father() const {
return PatchGridEntity(patchGrid_, localEntity_.father());
}
Expand All @@ -350,12 +350,12 @@ public:
return HierarchicIterator(patchGrid_, *this, maxLevel);
}

//! Returns iterator to one past the last son
// Returns iterator to one past the last son
HierarchicIterator hend(int maxLevel) const {
return HierarchicIterator(patchGrid_, *this, maxLevel, true);
}

//! @todo Please doc me !
// @todo Please doc me !
bool wasRefined() const {
if (patchGrid_->adaptationStep != GridImp::adaptDone)
return false;
Expand All @@ -365,7 +365,7 @@ public:
return patchGrid_->refinementMark_[level][index];
}

//! @todo Please doc me !
// @todo Please doc me !
bool mightBeCoarsened() const {
return true;
}
Expand Down
10 changes: 5 additions & 5 deletions dune/iga/hierarchicpatch/patchgridgeometry.hh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public:
using ParameterSpaceGeometry = typename Trimmer::template Codim<codim>::LocalParameterSpaceGeometry;

// using LocalGeometryInParameterSpace = typename ReferenceElementType::template Codim<CodimInHostGrid>::Geometry;
//! type of the LocalView of the patch geometry
// type of the LocalView of the patch geometry
using GeometryLocalView = typename GeometryKernel::NURBSPatch<GridImp::dimension, worlddimension,
ctype>::template GeometryLocalView<codim, Trimmer>;

Expand All @@ -63,12 +63,12 @@ public:
return geometryLocalView_.affine();
}

//! return the number of corners of this element. Corners are numbered 0...n-1
// return the number of corners of this element. Corners are numbered 0...n-1
[[nodiscard]] int corners() const {
return geometryLocalView_.corners();
}

//! access to coordinates of corners. Index is the number of the corner
// access to coordinates of corners. Index is the number of the corner
[[nodiscard]] GlobalCoordinate corner(int i) const {
return geometryLocalView_.corner(i);
}
Expand Down Expand Up @@ -96,7 +96,7 @@ public:
return geometryLocalView_.local(global);
}

//! Returns true if the point is in the current element
// Returns true if the point is in the current element
[[nodiscard]] bool checkInside(const FieldVector<ctype, mydim>& local) const {
return geometryLocalView_.checkInside(local);
}
Expand All @@ -105,7 +105,7 @@ public:
return geometryLocalView_.integrationElement(local);
}

//! The Jacobian matrix of the mapping from the reference element to this element
// The Jacobian matrix of the mapping from the reference element to this element
[[nodiscard]] JacobianInverseTransposed jacobianInverseTransposed(const FieldVector<ctype, mydim>& local) const {
// std::cout<<"jacobianInverseTransposed(local)\n"<<geometryLocalView_.jacobianInverseTransposed(local)<<std::endl;
return geometryLocalView_.jacobianInverseTransposed(local);
Expand Down
Loading

0 comments on commit afee2a5

Please sign in to comment.