Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 16 additions & 15 deletions examples/example_shell3D_DWR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,10 +466,11 @@ int main(int argc, char *argv[])
else
numError = DWR->computeError(dualL,dualH);

typename gsBasis<real_t>::domainIter domIt = basisL.basis(0).makeDomainIterator();
real_t diam = domIt->getMinCellLength();
for (; domIt->good(); domIt->next())
diam = domIt->getMinCellLength() < diam ? domIt->getMinCellLength() : diam;
typename gsBasis<real_t>::domainIter domIt = basisL.basis(0).domain()->beginAll();
typename gsBasis<real_t>::domainIter domItEnd = basisL.basis(0).domain()->endAll();
real_t diam = domIt.getMinCellLength();
for (; domIt<domItEnd; ++domIt)
diam = domIt.getMinCellLength() < diam ? domIt.getMinCellLength() : diam;

exacts[r] = 0;
numGoal[r] = DWR->computeGoal(mp_def)+DWR->computeGoal(bContainer,mp_def)+DWR->computeGoal(points,mp_def);
Expand Down Expand Up @@ -507,13 +508,13 @@ int main(int argc, char *argv[])
index_t c = 0;
for (index_t p=0; p < mp.nPieces(); ++p)
{
// index_t p=0;
typename gsBasis<real_t>::domainIter domIt = mp.basis(p).makeDomainIterator();
gsHDomainIterator<real_t,2> * domHIt = nullptr;
domHIt = dynamic_cast<gsHDomainIterator<real_t,2> *>(domIt.get());
GISMO_ENSURE(domHIt!=nullptr,"Domain not loaded");
for (; domHIt->good(); domHIt->next())
// index_t p=0;
typename gsBasis<real_t>::domainIter domIt = mp.basis(p).domain()->beginAll();
typename gsBasis<real_t>::domainIter domItEnd = mp.basis(p).domain()->endAll();
for (; domIt<domItEnd; ++domIt)
{
GISMO_ASSERT((dynamic_cast<gsHDomainIterator<real_t,2> *>(domIt.get())),"Domain not loaded");
gsHDomainIterator<real_t,2> * domHIt = static_cast<gsHDomainIterator<real_t,2> *>(domIt.get());
gsHBox<2,real_t> box(domHIt,p);
box.setAndProjectError(elErrors[c],mesherOpts.getInt("Convergence_alpha"),mesherOpts.getInt("Convergence_beta"));
elts.add(box);
Expand Down Expand Up @@ -568,12 +569,12 @@ int main(int argc, char *argv[])
for (index_t p=0; p < mp.nPieces(); ++p)
{
// index_t p=0;
typename gsBasis<real_t>::domainIter domIt = mp.basis(p).makeDomainIterator();
gsHDomainIterator<real_t,2> * domHIt = nullptr;
domHIt = dynamic_cast<gsHDomainIterator<real_t,2> *>(domIt.get());
GISMO_ENSURE(domHIt!=nullptr,"Domain not loaded");
for (; domHIt->good(); domHIt->next())
typename gsBasis<real_t>::domainIter domIt = mp.basis(p).domain()->beginAll();
typename gsBasis<real_t>::domainIter domItEnd = mp.basis(p).domain()->endAll();
for (; domIt<domItEnd; ++domIt)
{
GISMO_ASSERT((dynamic_cast<gsHDomainIterator<real_t,2> *>(domIt.get())),"Domain not loaded");
gsHDomainIterator<real_t,2> * domHIt = static_cast<gsHDomainIterator<real_t,2> *>(domIt.get());
gsHBox<2,real_t> box(domHIt,p);
box.setAndProjectError(elErrors[c],mesherOpts.getInt("Convergence_alpha"),mesherOpts.getInt("Convergence_beta"));
elts.add(box);
Expand Down
61 changes: 31 additions & 30 deletions src/gsThinShellAssemblerDWR.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ ThinShellAssemblerStatus gsThinShellAssemblerDWR<d, T, bending>::_assembleDual(c
for (index_t k = 0; k!=points.cols(); k++)
{
tmp = ev.eval(expr,points.col(k));
exprAssembler.integrationElements().basis(pIndex).active_into( points.col(k), actives );
exprAssembler.trialSpace(0).source().basis(pIndex).active_into( points.col(k), actives );
for (index_t j = 0; j< space.dim(); ++j)
{
space.mapper().localToGlobal(actives, pIndex, globalActives,j);
Expand All @@ -1252,7 +1252,7 @@ ThinShellAssemblerStatus gsThinShellAssemblerDWR<d, T, bending>::_assembleDual(c
for (index_t k = 0; k!=points.cols(); k++)
{
tmp = ev.eval(expr,points.col(k));
exprAssembler.integrationElements().basis(pIndex).active_into( points.col(k), actives );
exprAssembler.trialSpace(0).source().basis(pIndex).active_into( points.col(k), actives );
for (index_t j = 0; j< space.dim(); ++j)
{
space.mapper().localToGlobal(actives, pIndex, globalActives,j);
Expand All @@ -1271,7 +1271,7 @@ ThinShellAssemblerStatus gsThinShellAssemblerDWR<d, T, bending>::_assembleDual(c
for (index_t k = 0; k!=points.cols(); k++)
{
tmp = ev.eval(expr,points.col(k));
exprAssembler.integrationElements().basis(pIndex).active_into( points.col(k), actives );
exprAssembler.trialSpace(0).source().basis(pIndex).active_into( points.col(k), actives );
for (index_t j = 0; j< space.dim(); ++j)
{
space.mapper().localToGlobal(actives, pIndex, globalActives,j);
Expand All @@ -1287,7 +1287,7 @@ ThinShellAssemblerStatus gsThinShellAssemblerDWR<d, T, bending>::_assembleDual(c
for (index_t k = 0; k!=points.cols(); k++)
{
tmp = ev.eval(expr,points.col(k));
exprAssembler.integrationElements().basis(pIndex).active_into( points.col(k), actives );
exprAssembler.trialSpace(0).source().basis(pIndex).active_into( points.col(k), actives );
for (index_t j = 0; j< space.dim(); ++j)
{
space.mapper().localToGlobal(actives, pIndex, globalActives,j);
Expand All @@ -1306,7 +1306,7 @@ ThinShellAssemblerStatus gsThinShellAssemblerDWR<d, T, bending>::_assembleDual(c
for (index_t k = 0; k!=points.cols(); k++)
{
tmp = ev.eval(expr,points.col(k));
exprAssembler.integrationElements().basis(pIndex).active_into( points.col(k), actives );
exprAssembler.trialSpace(0).source().basis(pIndex).active_into( points.col(k), actives );
for (index_t j = 0; j< space.dim(); ++j)
{
space.mapper().localToGlobal(actives, pIndex, globalActives,j);
Expand All @@ -1322,7 +1322,7 @@ ThinShellAssemblerStatus gsThinShellAssemblerDWR<d, T, bending>::_assembleDual(c
for (index_t k = 0; k!=points.cols(); k++)
{
tmp = ev.eval(expr,points.col(k));
exprAssembler.integrationElements().basis(pIndex).active_into( points.col(k), actives );
exprAssembler.trialSpace(0).source().basis(pIndex).active_into( points.col(k), actives );
for (index_t j = 0; j< space.dim(); ++j)
{
space.mapper().localToGlobal(actives, pIndex, globalActives,j);
Expand All @@ -1341,7 +1341,7 @@ ThinShellAssemblerStatus gsThinShellAssemblerDWR<d, T, bending>::_assembleDual(c
for (index_t k = 0; k!=points.cols(); k++)
{
tmp = ev.eval(expr,points.col(k));
exprAssembler.integrationElements().basis(pIndex).active_into( points.col(k), actives );
exprAssembler.trialSpace(0).source().basis(pIndex).active_into( points.col(k), actives );
for (index_t j = 0; j< space.dim(); ++j)
{
space.mapper().localToGlobal(actives, pIndex, globalActives,j);
Expand All @@ -1357,7 +1357,7 @@ ThinShellAssemblerStatus gsThinShellAssemblerDWR<d, T, bending>::_assembleDual(c
for (index_t k = 0; k!=points.cols(); k++)
{
tmp = ev.eval(expr,points.col(k));
exprAssembler.integrationElements().basis(pIndex).active_into( points.col(k), actives );
exprAssembler.trialSpace(0).source().basis(pIndex).active_into( points.col(k), actives );
for (index_t j = 0; j< space.dim(); ++j)
{
space.mapper().localToGlobal(actives, pIndex, globalActives,j);
Expand All @@ -1376,7 +1376,7 @@ ThinShellAssemblerStatus gsThinShellAssemblerDWR<d, T, bending>::_assembleDual(c
for (index_t k = 0; k!=points.cols(); k++)
{
tmp = ev.eval(expr,points.col(k));
exprAssembler.integrationElements().basis(pIndex).active_into( points.col(k), actives );
exprAssembler.trialSpace(0).source().basis(pIndex).active_into( points.col(k), actives );
for (index_t j = 0; j< space.dim(); ++j)
{
space.mapper().localToGlobal(actives, pIndex, globalActives,j);
Expand All @@ -1392,7 +1392,7 @@ ThinShellAssemblerStatus gsThinShellAssemblerDWR<d, T, bending>::_assembleDual(c
for (index_t k = 0; k!=points.cols(); k++)
{
tmp = ev.eval(expr,points.col(k));
exprAssembler.integrationElements().basis(pIndex).active_into( points.col(k), actives );
exprAssembler.trialSpace(0).source().basis(pIndex).active_into( points.col(k), actives );
for (index_t j = 0; j< space.dim(); ++j)
{
space.mapper().localToGlobal(actives, pIndex, globalActives,j);
Expand All @@ -1411,7 +1411,7 @@ ThinShellAssemblerStatus gsThinShellAssemblerDWR<d, T, bending>::_assembleDual(c
for (index_t k = 0; k!=points.cols(); k++)
{
tmp = ev.eval(expr,points.col(k));
exprAssembler.integrationElements().basis(pIndex).active_into( points.col(k), actives );
exprAssembler.trialSpace(0).source().basis(pIndex).active_into( points.col(k), actives );
for (index_t j = 0; j< space.dim(); ++j)
{
space.mapper().localToGlobal(actives, pIndex, globalActives,j);
Expand All @@ -1427,7 +1427,7 @@ ThinShellAssemblerStatus gsThinShellAssemblerDWR<d, T, bending>::_assembleDual(c
for (index_t k = 0; k!=points.cols(); k++)
{
tmp = ev.eval(expr,points.col(k));
exprAssembler.integrationElements().basis(pIndex).active_into( points.col(k), actives );
exprAssembler.trialSpace(0).source().basis(pIndex).active_into( points.col(k), actives );
for (index_t j = 0; j< space.dim(); ++j)
{
space.mapper().localToGlobal(actives, pIndex, globalActives,j);
Expand All @@ -1446,7 +1446,7 @@ ThinShellAssemblerStatus gsThinShellAssemblerDWR<d, T, bending>::_assembleDual(c
for (index_t k = 0; k!=points.cols(); k++)
{
tmp = ev.eval(expr,points.col(k));
exprAssembler.integrationElements().basis(pIndex).active_into( points.col(k), actives );
exprAssembler.trialSpace(0).source().basis(pIndex).active_into( points.col(k), actives );
for (index_t j = 0; j< space.dim(); ++j)
{
space.mapper().localToGlobal(actives, pIndex, globalActives,j);
Expand All @@ -1463,7 +1463,7 @@ ThinShellAssemblerStatus gsThinShellAssemblerDWR<d, T, bending>::_assembleDual(c
for (index_t k = 0; k!=points.cols(); k++)
{
tmp = ev.eval(expr,points.col(k));
exprAssembler.integrationElements().basis(pIndex).active_into( points.col(k), actives );
exprAssembler.trialSpace(0).source().basis(pIndex).active_into( points.col(k), actives );
for (index_t j = 0; j< space.dim(); ++j)
{
space.mapper().localToGlobal(actives, pIndex, globalActives,j);
Expand All @@ -1482,7 +1482,7 @@ ThinShellAssemblerStatus gsThinShellAssemblerDWR<d, T, bending>::_assembleDual(c
for (index_t k = 0; k!=points.cols(); k++)
{
tmp = ev.eval(expr,points.col(k));
exprAssembler.integrationElements().basis(pIndex).active_into( points.col(k), actives );
exprAssembler.trialSpace(0).source().basis(pIndex).active_into( points.col(k), actives );
for (index_t j = 0; j< space.dim(); ++j)
{
space.mapper().localToGlobal(actives, pIndex, globalActives,j);
Expand All @@ -1498,7 +1498,7 @@ ThinShellAssemblerStatus gsThinShellAssemblerDWR<d, T, bending>::_assembleDual(c
for (index_t k = 0; k!=points.cols(); k++)
{
tmp = ev.eval(expr,points.col(k));
exprAssembler.integrationElements().basis(pIndex).active_into( points.col(k), actives );
exprAssembler.trialSpace(0).source().basis(pIndex).active_into( points.col(k), actives );
for (index_t j = 0; j< space.dim(); ++j)
{
space.mapper().localToGlobal(actives, pIndex, globalActives,j);
Expand All @@ -1517,7 +1517,7 @@ ThinShellAssemblerStatus gsThinShellAssemblerDWR<d, T, bending>::_assembleDual(c
for (index_t k = 0; k!=points.cols(); k++)
{
tmp = ev.eval(expr,points.col(k));
exprAssembler.integrationElements().basis(pIndex).active_into( points.col(k), actives );
exprAssembler.trialSpace(0).source().basis(pIndex).active_into( points.col(k), actives );
for (index_t j = 0; j< space.dim(); ++j)
{
space.mapper().localToGlobal(actives, pIndex, globalActives,j);
Expand All @@ -1533,7 +1533,7 @@ ThinShellAssemblerStatus gsThinShellAssemblerDWR<d, T, bending>::_assembleDual(c
for (index_t k = 0; k!=points.cols(); k++)
{
tmp = ev.eval(expr,points.col(k));
exprAssembler.integrationElements().basis(pIndex).active_into( points.col(k), actives );
exprAssembler.trialSpace(0).source().basis(pIndex).active_into( points.col(k), actives );
for (index_t j = 0; j< space.dim(); ++j)
{
space.mapper().localToGlobal(actives, pIndex, globalActives,j);
Expand All @@ -1552,7 +1552,7 @@ ThinShellAssemblerStatus gsThinShellAssemblerDWR<d, T, bending>::_assembleDual(c
for (index_t k = 0; k!=points.cols(); k++)
{
tmp = ev.eval(expr,points.col(k));
exprAssembler.integrationElements().basis(pIndex).active_into( points.col(k), actives );
exprAssembler.trialSpace(0).source().basis(pIndex).active_into( points.col(k), actives );
for (index_t j = 0; j< space.dim(); ++j)
{
space.mapper().localToGlobal(actives, pIndex, globalActives,j);
Expand All @@ -1569,7 +1569,7 @@ ThinShellAssemblerStatus gsThinShellAssemblerDWR<d, T, bending>::_assembleDual(c
for (index_t k = 0; k!=points.cols(); k++)
{
tmp = ev.eval(expr,points.col(k));
exprAssembler.integrationElements().basis(pIndex).active_into( points.col(k), actives );
exprAssembler.trialSpace(0).source().basis(pIndex).active_into( points.col(k), actives );
for (index_t j = 0; j< space.dim(); ++j)
{
space.mapper().localToGlobal(actives, pIndex, globalActives,j);
Expand Down Expand Up @@ -3685,19 +3685,20 @@ void gsThinShellAssemblerDWR<d, T, bending>::_applyLoadsToElWiseError(const gsMu
for (unsigned patchInd=0; patchInd < m_assemblerH->getBasis().nBases(); ++patchInd)
{
// Initialize domain element iterator
typename gsBasis<T>::domainIter domIt =
m_assemblerH->getBasis().piece(patchInd).makeDomainIterator();
typename gsBasis<T>::domainIter domIt = m_assemblerH->getBasis().piece(patchInd).domain()->beginAll();
typename gsBasis<T>::domainIter domItEnd = m_assemblerH->getBasis().piece(patchInd).domain()->endAll();

#ifdef _OPENMP
# ifdef _OPENMP
c = patch_cnt + tid;
patch_cnt += domIt->numElements();// a bit costy
for ( domIt->next(tid); domIt->good(); domIt->next(nt) )
#else
for (; domIt->good(); domIt->next() )
#endif
patch_cnt += m_assemblerH->getBasis().piece(patchInd).domain()->numElements();// a bit costy
domIt += tid;
for ( ; domIt<domItEnd; domIt+=nt )
# else
for (; domIt<domItEnd; ++domIt )
# endif
{
bool test = !(((((forcePoint - domIt->lowerCorner()).array() >= 0) &&
(domIt->upperCorner() - forcePoint).array() >= 0) ).array() == 0).any();
bool test = !(((((forcePoint - domIt.lowerCorner()).array() >= 0) &&
(domIt.upperCorner() - forcePoint).array() >= 0) ).array() == 0).any();
if (test)
elements_private.push_back(c);
#ifdef _OPENMP
Expand Down