Skip to content

Commit

Permalink
some more test
Browse files Browse the repository at this point in the history
  • Loading branch information
henrij22 committed May 15, 2024
1 parent 77450c8 commit 0490a4d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 3 deletions.
6 changes: 6 additions & 0 deletions dune/iga/test/testnurbsbasistrimmed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ auto testNurbsBasis(auto& grid) {
t.subTest(checkBasis(basis2, EnableContinuityCheck()));
}

{
// Check power Basis
auto powerB = Dune::Functions::BasisFactory::makeBasis(gridView, Functions::BasisFactory::power(Functions::BasisFactory::nurbs(), 2));
t.subTest(checkBasis(powerB, EnableContinuityCheck()));

}
{
// Check whether a B-Spline basis can be combined with other bases.
using namespace Functions::BasisFactory;
Expand Down
46 changes: 43 additions & 3 deletions dune/iga/test/testutillities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@
#include <dune/common/parallel/mpihelper.hh>
#include <dune/common/rangeutilities.hh>
#include <dune/common/test/testsuite.hh>
#include <dune/functions/functionspacebases/boundarydofs.hh>
#include <dune/functions/functionspacebases/powerbasis.hh>
#include <dune/iga/geometrykernel/nurbspatchtransform.hh>
#include <dune/iga/hierarchicpatch/patchgrid.hh>
#include <dune/iga/nurbsbasis.hh>
#include <dune/iga/trimmer/defaulttrimmer/trimmer.hh>
#include <dune/iga/trimmer/defaulttrimmer/trimmingutils/cliputils.hh>
#include <dune/iga/trimmer/defaulttrimmer/trimmingutils/indextransformations.hh>
#include <dune/iga/utils/igahelpers.hh>

using namespace Dune;

Expand Down Expand Up @@ -83,6 +87,38 @@ auto testTransformToSpan() {
return t;
}

auto testForEachUntrimmedBoundary(int degreeElevate) {
TestSuite t("Test testForEachUntrimmedBoundary");

using PatchGrid = IGA::PatchGrid<2, 2, IGA::DefaultTrim::PatchGridFamily>;
using GridView = PatchGrid::LeafGridView;
using GridFactory = Dune::GridFactory<PatchGrid>;

auto igaGridFactory = GridFactory();
igaGridFactory.insertJson("auxiliaryfiles/quarter_plate.ibra", true, {0, 0}, {degreeElevate, degreeElevate}, {4, 4});
auto igaGrid = igaGridFactory.createGrid();

using namespace Functions::BasisFactory;

auto gridView = igaGrid->leafGridView();
Functions::NurbsBasis<GridView> basis2(gridView, nurbs());

auto size = basis2.size();

forEachUntrimmedBoundaryDOF(basis2, [&](auto&& localIndex, auto&& localView, auto&& intersection) {
t.check(localView.index(localIndex) < size);
});

auto powerB = makeBasis(gridView, Functions::BasisFactory::power<2>(nurbs(), FlatInterleaved()));

size = powerB.size();
forEachUntrimmedBoundaryDOF(basis2, [&](auto&& localIndex, auto&& localView, auto&& intersection) {
t.check(localView.index(localIndex) < size);
});

return t;
}

auto testClipUtils() {
TestSuite t("testClipUtils", TestSuite::ThrowPolicy::AlwaysThrow);

Expand Down Expand Up @@ -111,9 +147,13 @@ int main(int argc, char** argv) try {
Dune::MPIHelper::instance(argc, argv);
Dune::TestSuite t("", Dune::TestSuite::ThrowPolicy::ThrowOnRequired);

t.subTest(testTransformations());
t.subTest(testTransformToSpan());
t.subTest(testClipUtils());
// t.subTest(testTransformations());
// t.subTest(testTransformToSpan());
// t.subTest(testClipUtils());

t.subTest(testForEachUntrimmedBoundary(0));
t.subTest(testForEachUntrimmedBoundary(1));
t.subTest(testForEachUntrimmedBoundary(2));

t.report();

Expand Down

0 comments on commit 0490a4d

Please sign in to comment.