-
Notifications
You must be signed in to change notification settings - Fork 1
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
New grid implementation #51
base: main
Are you sure you want to change the base?
Conversation
3580b50
to
7be4aec
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #51 +/- ##
==========================================
+ Coverage 78.04% 87.96% +9.92%
==========================================
Files 31 65 +34
Lines 3913 4181 +268
==========================================
+ Hits 3054 3678 +624
+ Misses 859 503 -356
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
16ce750
to
354d893
Compare
add file first working version save more things working update working cleanup second order derivative more fixes fixes more tets more working tests refactor more refactor working cleanup some cleanup all grid tests fwork refactor basis lots of refactorering more refactoring for basis running tests refactor fix clang format and tests basis fixes working untrimmed tests fix format fixes add docs add ref element refactoring compiling trim concepts created trimmer interface add json refactor more refactoring more fixes fixes working intersection refactor geometry localview fixes working default trimmer cleanup big cleanup big refactor more tests add trimmer concept docs fixes TODOS
fix ref small fixes refactor test lots of refactor now everything exploded test fixies fixes refactor types working with subgrid save state fix refactor intersections intersections more refactor more fixing fix adding own idset further steps forward fixes further progress moar fixes fixes wokring untrimmed case refactor call it a day fixes fix fixes refactor refactor Wip new z callback Weekend Forgot to push Correct intersections for closed trimming boundaries
It wasn't correct the first time Okay maybe not exactly what I wanted new idea Clipping should be fine now Correct topology of trimmed elements pre chrtimas Intersectionspoints + findIntersectionLine with linear case save cplitCurve algo + enhancements of clipAlgo dix clang fomat save before refactor Rework of IP - Algo More examples are working tidy up New test fix (add getters) Add support for multiple IP per edge z-Value handler in patchTrimData save fix format support for vertices inside element add several tests save Fixed some things + testcase for hole geometries added good guess for line parameter commented slice curve algo support for hole geometries yeah fix and refactor linear curve and line algo add testcase for worldim = 3 + fix in splitcurve added multiplicity function some tidy up + some bug fix add isConnectedAtBoundary function to NurbsPatchGeometry class small refactoring. Mainly adding curve and loop index encoder refactor more refactor move isPointOnLine add sampling info to clipper Z value small fixes to fix tests refactor vertex frest vertex refactor refactor isFullElement if statement clang format and fix bug with full element on right corner fix work Extract draw grid method fix the tests save more work work 3 gridtest work again makecreatelvlbrokenagain save first tests are working
Intersection in progress Intersection Variant einbau intersections are working (at least a bit) Intersections maybe working all tests working except intersection empty elements are working all tests compiling? run tests now transform to span + integrationrules VTK Writer reimplemented basis is working (???) more tests add cmake + more tests fix? Add secondFundamentalForm add getQuadratureRule
fix tests minor work Change namespace to IGA work work work fix fix? transfer add devcontainer Rookie implementation of boundarySegmentIndex idk fix docker container for actions work fixes 1 is this needed? fixes 2 add generators for USINGZ fixes 3 fix from rebase Work work push to test pypi fix fix cmake fix cmake again fix3 fix5 fix7 fix9 fix cmake for the 100th time cmake 101 cmake 102 cmake 103 cmake 104 cmake 105
fixing some bugs Some fixies add some test cases add postKnotRefinement Get rid of no unique address some more test add unstructured grid mak integration rules a bit more efficient
fix fix fix fix adaptive refinement & fix clang format k refinement for basis fix fix2
refactor file structure I did something wrong cmake? add benchmark + some refactoring 2 fixes Refactor naming a few more things factory foctories and make basis fast again (100x improvement)
7bd6c22
to
fdc6f2c
Compare
using EdgeEntity = typename ParameterSpaceTraits::template Codim<1>::ParameterSpaceGridEntity; | ||
using VertexEntity = typename ParameterSpaceTraits::template Codim<2>::ParameterSpaceGridEntity; | ||
|
||
// auto& globalIdSetParameterSpace = parameterSpaceGrid_->globalIdSet(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be removed
|
||
metadata = metaData(duneVersion)[1] | ||
metadata["version"] = duneigaVersion | ||
|
||
metadata["name"] = "dune-iga-experimental" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed? This is the python package name at the end isnt it?
// template<typename Curve> | ||
// auto windingNumberOfCurve(const Curve& curve, const Dune::FieldVector<double,2>& | ||
// p=Dune::FieldVector<double,2>{0.5,0.5}) { | ||
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want you can also celanup here and below
// if(re.checkInside({x,y})) | ||
// ++insideCounter; | ||
// | ||
// if(samples>=minsamples and oldRatio>0 and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too
const int oldLevel = untrimmedParameterSpaceGrid_->maxLevel(); | ||
untrimmedParameterSpaceGrid_->globalRefine(refCount); | ||
|
||
// parameterSpaceGrid_->insertLeaf(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too
template <int codim> | ||
using Entity = typename ParameterSpace::ParameterSpaceTraits::template Codim<codim>::ParameterSpaceGridEntity; | ||
// template <int codim> | ||
// using EntityMap = std::map<IdType, ElementEntity<codim>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too
|
||
// Compute individual hash values for first, second and third and combine them using XOR | ||
// and bit shifting: | ||
// todo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
auto index() const { | ||
// TODO | ||
// if constexpr (codim_ == 0) | ||
// return isTrimmed() ? entityInfo_.trimmedIndexInLvl : entityInfo_.unTrimmedIndexInLvl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
@param level grid level on which the iterator shall be created | ||
*/ | ||
// template<typename =void> requires (codim!=0) | ||
// explicit PatchGridLevelIterator(const GridImp* patchGrid, int level, [[maybe_unused]] bool endDummy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
using IteratorImplR = typename GridImp::ParameterSpace::template ParameterSpaceLevelIterator<codim, pitype>; | ||
using OLDIteratorImpl = | ||
typename GridImp::ParameterSpaceGrid::template Codim<codim>::template Partition<pitype>::LevelIterator; | ||
using IteratorImpl = IteratorImplR; // std::conditional_t<codim==0,IteratorImplR,OLDIteratorImpl>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
[[maybe_unused]] bool endDummy) | ||
: parameterSpaceGrid_(parameterSpaceGrid), | ||
maxLevel_{maxLevel} | ||
// , hostHierarchicIterator_(startEntity.impl().getHostEntity().hend(maxLevel)),maxLevel_{maxLevel} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
setCurrentEntity(); // since std::stack is LIFO, we set the current entity to the first son of the old son | ||
|
||
// ++hostHierarchicIterator_; | ||
// ++descendantLocalIndex_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
option(ENABLE_TEST_COVERAGE "Enable test coverage" OFF) | ||
|
||
set(THREADS_PREFER_PTHREAD_FLAG ON) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you need that?
// auto subEntityName = [](std::size_t codim)-> std::string { | ||
// return codim==0 ? "element" : codim==1 ? "edges" : "vertices" ; | ||
// }; | ||
// std::cout<<"The size of "<<subEntityName(cc)<<" with codim "<<cc<<" of the "<<i<<"-th |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
// auto subEntityName = [](std::size_t codim)-> std::string { | ||
// return codim==0 ? "element" : codim==1 ? "edges" : "vertex" ; | ||
// }; | ||
// std::cout<<"The index of the "<<ii<<"-th "<<subEntityName(cc)<<" with codim "<<cc<<" of the "<<i<<"-th |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
auto subEntities(int i, int c, int cc) const { | ||
// auto subEntityName = [](std::size_t codim)-> std::string { | ||
// return codim==0 ? "element" : codim==1 ? "edges" : "vertices" ; | ||
// }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
// TODO this functions could be a bit complicated basically we have to make sure the point lies inside the | ||
// outer boundary loop, but outside the inner loops thus we have to implement something as | ||
// | ||
https://en.wikipedia.org/wiki/Point_in_polygon#:~:text=One%20simple%20way%20of%20finding,an%20even%20number%20of%20times. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
typename Codim<codim>::Geometry geometry(int i) const { | ||
// TODO trim returns the reference element in geometry space | ||
// return _impl->template geometry<codim>(i); | ||
// if constexpr (codim==0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
// Returns true if the point is in the current element | ||
// TODO | ||
bool checkInside(const LocalCoordinate& local) const { | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here?
|
||
// TODO | ||
[[nodiscard]] Volume integrationElement(const LocalCoordinate& local) const { | ||
return hostGeometry_.volume(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here?
for (const auto& pt : resultClosedPaths.front()) { | ||
if (auto [isHost, idx] = isCornerVertex(pt, eleRect); isHost) | ||
result.addOriginalVertex(idx); | ||
// result.addOriginalVertex(idx, pt.z > 4 ? std::optional<size_t>(pt.z) : std::nullopt); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
result.finish(patchTrimData); | ||
|
||
// While developing | ||
// result.report(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
TrimmedParameterSpaceGridEntity& operator=(TrimmedParameterSpaceGridEntity&& other) noexcept = default; | ||
|
||
// TODO tidy up these constructors | ||
// Entity with codim 0 but trimmed thus needs trimdata |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
requires(codim_ == 0) | ||
[[nodiscard]] decltype(auto) ilevelbegin() const { | ||
// if(trimData_) | ||
// return trimData_.template ilevelbegin<codim_>(localId_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this return is wrong I suppose? Here a notimplemented would better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also methods below
// clang-format on | ||
// using GlobalIdSetType = PatchGridGlobalIdSet<const Grid>; | ||
|
||
// template <int codim, PartitionIteratorType pitype> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
|
||
// get number of entities of given codim, type and on this level | ||
std::size_t size(GeometryType type) const { | ||
// TODO Trim, count cube and none types i.e. full and trimmed elements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
|
||
/** @brief Deliver all geometry types used in this grid */ | ||
Types types(int codim) const { | ||
// TODO Trim, this should return none and cube for trimmed geometries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here also this should be removed
|
||
using LocalCoordinate = std::common_type_t<typename Implementations::LocalCoordinate...>; | ||
using GlobalCoordinate = std::common_type_t<typename Implementations::GlobalCoordinate...>; | ||
// using JacobianTransposed = std::common_type_t<typename Implementations::JacobianTransposed...>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok let get this finished. I marked several places, where I saw commented code that should be removed or coutdated comments or code that is wrong and wher we should at least throw a NotImplemented. Furthermore, there are several TODOS that are still valid our outdated. can you search for them and add some comments why it is there or if it is outdated removed it.
You can resolve all my comments and then we can merge this. thanks!
Ah yes and please rebase on master, because there are conflicts |
This is of course not perfect, but most use cases should work without a problem