-
Notifications
You must be signed in to change notification settings - Fork 19
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
Lr multipatch refinement alternative #207
Lr multipatch refinement alternative #207
Conversation
Note: The above mesh is quartic p=4 (since functions go across 6 mesh lines). The proposed solution errs on the side of caution and creates a matching mesh p+1=5 elements into the mesh. This is by picking all interior functions that overlap with the shared boundary functions. |
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.
picking on the cosmetics first. also debug output needs to go.
src/ASM/LR/ASMLRSpline.C
Outdated
@@ -307,6 +307,26 @@ IntVec ASMunstruct::getFunctionsForElements (const IntVec& elements) | |||
return result; | |||
} | |||
|
|||
IntVec ASMunstruct::getBoundaryNodesCovered (const IntVec& nodes) const |
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.
additional space between functions.
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.
Enig, Den uskrevne IFEM-standarden sier 2 blanke linjer.
src/ASM/LR/ASMLRSpline.C
Outdated
geo->generateIDs(); | ||
IntVec oneBoundary, result; | ||
int numbEdges = (getNoParamDim() == 2) ? 4 : 6; | ||
for(int edge=1; edge<=numbEdges; edge++) |
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.
space between for 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.
Du har ikke korrigert dette (samt for alle ditto)?? Dessuten dobbel space før edge++
src/ASM/LR/ASMLRSpline.C
Outdated
for(int edge=1; edge<=numbEdges; edge++) | ||
{ | ||
getBoundaryNodes(edge, oneBoundary); // this returns a 1-indexed list | ||
for(const int i : nodes) |
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.
ditto.
src/ASM/LR/ASMLRSpline.C
Outdated
{ | ||
getBoundaryNodes(edge, oneBoundary); // this returns a 1-indexed list | ||
for(const int i : nodes) | ||
for(const int j : oneBoundary) |
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.
ditto
src/ASM/LR/ASMLRSpline.C
Outdated
getBoundaryNodes(edge, oneBoundary); // this returns a 1-indexed list | ||
for(const int i : nodes) | ||
for(const int j : oneBoundary) | ||
if(geo->getBasisfunction(i)->contains(*geo->getBasisfunction(j-1))) |
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.
ditto
src/ASM/LR/ASMLRSpline.C
Outdated
{ | ||
IntVec result; | ||
geo->generateIDs(); | ||
for(const int i : nodes) |
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.
ditto
src/ASM/LR/ASMLRSpline.C
Outdated
for(const int i : nodes) | ||
{ | ||
LR::Basisfunction *b = geo->getBasisfunction(i); | ||
for(auto el : b->support()) // for all elements where *b has support |
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.
ditto
src/ASM/LR/ASMLRSpline.C
Outdated
{ | ||
LR::Basisfunction *b = geo->getBasisfunction(i); | ||
for(auto el : b->support()) // for all elements where *b has support | ||
for(auto basis : el->support()) // for all functions on this element |
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.
ditto
src/SIM/SIMinput.C
Outdated
{ | ||
pch = dynamic_cast<ASMunstruct*>(myModel[i]); | ||
IntVec secondary = pch->getOverlappingNodes(conformingIndicies[i]); | ||
for(int j : conformingIndicies[i]) // add refinement from neighbours |
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.
ditto
src/SIM/SIMinput.C
Outdated
refineIndices[i].push_back(j); | ||
|
||
for(int j : secondary) // add depth refinement to make it conforming |
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.
ditto
bruker jeg den reduce footprint så sier frac 'frac you'. |
This is the setup which requires the reduced footprint commit. The proposed setup managed to pass covered boundary functions (blue) to their respective connected patches (green), but the problem arised when interior mesh was to be refined. By taking all functions with overlapping support (yellow) one might actually hit another patch boundary and this is not detected and the gray function is never added. The proposed solution in 7da3af4 tries to only pick (yellow) functions which support does not grow in the boundary tangent direction, but only in the boundary normal direction. |
a8d705d
to
b8d9a62
Compare
Updated... fixed all boundary cases, and made the code all pretty |
da9db1c
to
fffbbfa
Compare
jenkins build this with downstreams ifem-poisson=13 ifem-elasiticity=37 please |
jenkins build this with downstreams ifem-poisson=13 ifem-elasticity=37 please |
fffbbfa
to
7138a12
Compare
jenkins build this with downstreams ifem-poisson=13 ifem-elasticity=37 ifem-stokes=77 please |
1 similar comment
jenkins build this with downstreams ifem-poisson=13 ifem-elasticity=37 ifem-stokes=77 please |
Is this OK? Can we put this on trunk now? I can't make Jenkins run the tests for some reason 😢 |
jenkins build this with downstreams ifem-poisson=13 ifem-elasticity=37 ifem-stokes=77 please |
7138a12
to
225e9af
Compare
Squashed fixup commits. Ready for merge. Also Elasticity, Poisson and Stokes |
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.
Prøvde å gå gjennom, og fant en del ting å pirke på.
Alt dette henger mer eller mindre sammen så vidt jeg kan se, så jeg tror man med fordel kan squashe alt (eller det meste) til end commit. Da er det enklere å gjøre effektiv review,
src/ASM/ASMunstruct.h
Outdated
//! \param nodes List of (0-indexed) patch local node IDs | ||
//! \returns Node IDs (0-indexed) for boundary functions whos support is | ||
// completely covered by the union of the support in the input array | ||
virtual IntVec getBoundaryNodesCovered(const IntVec& nodes) const ; |
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.
fjern space før ; og det holder med en space etter \param
og \return
i doxyen, og siden nodes
kun er input, bruk \param[in]
. One spell error too (whos --> whose).
src/ASM/LR/ASMLRSpline.C
Outdated
@@ -307,6 +307,26 @@ IntVec ASMunstruct::getFunctionsForElements (const IntVec& elements) | |||
return result; | |||
} | |||
|
|||
IntVec ASMunstruct::getBoundaryNodesCovered (const IntVec& nodes) const |
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.
Enig, Den uskrevne IFEM-standarden sier 2 blanke linjer.
src/ASM/LR/ASMLRSpline.C
Outdated
geo->generateIDs(); | ||
IntVec oneBoundary, result; | ||
int numbEdges = (getNoParamDim() == 2) ? 4 : 6; | ||
for(int edge=1; edge<=numbEdges; edge++) |
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.
Du har ikke korrigert dette (samt for alle ditto)?? Dessuten dobbel space før edge++
src/ASM/LR/ASMLRSpline.C
Outdated
std::sort(result.begin(), result.end()); | ||
auto last = std::unique(result.begin(), result.end()); | ||
result.erase(last, result.end()); | ||
return result; |
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.
Magefølelsen sier at du vel trenger å inkludere <algorithm>
for at dette skal bygge over alt?
Men, et bedre alternative er kanskje å bruke std::set<int> result
i stedet og så return IntVec(result.begin(),result.end());
. Da vil sorteringen og uniqueifiseringen komme på kjøpet.
src/SIM/SIMinput.C
Outdated
@@ -27,6 +27,8 @@ | |||
#include <sstream> | |||
#include <numeric> | |||
|
|||
using namespace std; | |||
|
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.
Nei, vi vil ikke ha denne her eller andre steder. Vi bruker std::
-scoping der det trengs,
src/SIM/SIMinput.C
Outdated
cout << j << endl; | ||
cout << " Covered (boundary) indices:\n"; | ||
for(int j : bndry_nodes) | ||
cout << j << endl; |
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.
Dette er vel mer debug-output som bør gjemmes unna i en #ifdef SP_DEBUG
eller noe?
Og legg til std::cout hvis utskriften ønske beholdes.
src/SIM/SIMinput.C
Outdated
std::sort(refineIndices[i].begin(), refineIndices[i].end()); | ||
auto last = std::unique(refineIndices[i].begin(), refineIndices[i].end()); | ||
refineIndices[i].erase(last, refineIndices[i].end()); | ||
|
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.
Her også, vurder å bruke std::set<int>
i stedet.
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.
Innser nå at mye av det jeg kommenterte på i første commit er endret på i denne. Da burde heller de to committene vært squashet til en for å gjøre review-prosessen enklere og ryddigere
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.
Hvis du klikker på "Files changed" istedenfor "commits" øverst, så får du diff'en til hele pull requesten. Essensielt det du spør om: slik ting hadde sett ut hvis alt hadde blitt most til en enkelt commit.
Jeg tror ikke review hadde blitt enklere med få commits, tvert imot da man mister commit messages og en del logikk til hvorfor ting blir som de blir. Jeg kan derimot se argumentet med at man ikke vil ha for mange intermediate states i historikken der programmet dumper ut unødvendig mye debug print (som her hos meg) eller værst av alt: ikke kompilerer (skal ikke være tilfellet her). Hvis det fortsatt er ønskelig, så moser jeg alt sammen til en stor commit.
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.
For all del, alt trenger ikke å være en stor commit, men de committene som er der bør vær logisk inndelt så langt det går. Ihvertfall trengs ikke fjernings av debug print, dokumentasjons-endringer, etc. være separat. De kan med fordel inkluderes i de forrige der de hører best hjemme.
src/ASM/ASMunstruct.h
Outdated
@@ -142,8 +142,9 @@ class ASMunstruct : public ASMbase | |||
|
|||
//! \brief Return all functions whos support overlap with the input functions | |||
//! \param nodes List of (0-indexed) patch local node IDs (typically requested by adaptive refinement) | |||
//! \param dir In which parametric direction the basis functions are allowed to have bigger support (-1 for all) |
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.
\param[in] dir
src/SIM/SIMinput.C
Outdated
for (size_t j = 0; j < myModel.size(); j++) | ||
{ | ||
std::sort(conformingIndicies[j].begin(), conformingIndicies[j].end()); | ||
auto last = std::unique(conformingIndicies[j].begin(), conformingIndicies[j].end()); | ||
conformingIndicies[j].erase(last, conformingIndicies[j].end()); | ||
for(int l : conformingIndicies[j]) | ||
cout << "#"<<j<<": "<<l << endl; |
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.
Og der forsvant debug-output'en gitt. dvs. min kommentering på det i forrige commit var bortkasta. Dette understrerker at det er viktig å squase slike endringer også før review.
src/SIM/SIMinput.C
Outdated
for (size_t i = 0; i < myModel.size(); i++) | ||
{ | ||
std::sort(conformingIndicies[i].begin(), conformingIndicies[i].end()); | ||
auto last = std::unique(conformingIndicies[i].begin(), conformingIndicies[i].end()); | ||
conformingIndicies[i].erase(last, conformingIndicies[i].end()); |
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.
Again, consider using std::set<int>
?
39d0e53
to
f8a0d31
Compare
All requested changes fixed |
…o match interior mesh
f8a0d31
to
e573c49
Compare
Is this ready for merging? |
Well, I looked at it again tonight as I cloned your branch anyway to check it on the Hemisphere problem. And I found several smaller/cosmetic issues I would like to correct. But to save you the burden for more "kverulering" from me, I did a rebase myself. See the branch kmokstad:lr-multipatch-alternative. You'll find most of your commits there (except two) such that the history is intact, but without some cosmetic backs-and-forth. The main difference is more use of std::set instead of vector, but the results should be unchanged. Check if you agree, then you can merge that one. |
#215 have now been merged instead, so this one is therefore obsolete. |
Fixes LR multipatch refinement in two steps: