Skip to content
Snippets Groups Projects
Commit 4bd3b115 authored by Dr. Felix Tobias Schindler's avatar Dr. Felix Tobias Schindler
Browse files

[operators.projections.l2] add tests for L2ProjectionOperator

parent 4b42dba7
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,29 @@ struct L2ProjectionLocalizableOperatorTest
};
template <class SpaceType>
struct L2ProjectionOperatorTest
: public ProjectionOperatorBase<SpaceType, L2ProjectionOperator<typename SpaceType::GridViewType, double>>
{
void constructible_by_factory()
{
const auto& grid_view = this->space_.grid_view();
auto DUNE_UNUSED(op_w_over_integrate) = make_l2_projection_operator(grid_view, 1);
auto DUNE_UNUSED(op_wo_over_integrate) = make_l2_projection_operator(grid_view);
} // ... constructible_by_factory(...)
void free_function_callable()
{
const auto& grid_view = this->space_.grid_view();
const auto& source = this->function_;
auto& range = this->discrete_function_;
Dune::GDT::project_l2(grid_view, source, range);
Dune::GDT::project_l2(source, range);
} // ... free_function_callable(...)
};
} // namespace Test
} // namespace GDT
} // namespace Dune
......
// This file is part of the dune-gdt project:
// http://users.dune-project.org/projects/dune-gdt
// Copyright holders: Felix Schindler
// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
#include <dune/stuff/test/main.hxx>
#include "operators/projections/l2.hh"
#include "spaces/cg/fem.hh"
using namespace Dune::GDT::Test;
#if HAVE_DUNE_FEM
typedef testing::Types<SPACES_CG_FEM(1)
#if HAVE_ALUGRID
,
SPACES_CG_FEM_ALUGRID(1)
#endif
> SpaceTypes;
TYPED_TEST_CASE(L2ProjectionOperatorTest, SpaceTypes);
TYPED_TEST(L2ProjectionOperatorTest, constructible_by_ctor)
{
this->constructible_by_ctor();
}
TYPED_TEST(L2ProjectionOperatorTest, constructible_by_factory)
{
this->constructible_by_factory();
}
TYPED_TEST(L2ProjectionOperatorTest, free_function_callable)
{
this->free_function_callable();
}
TYPED_TEST(L2ProjectionOperatorTest, produces_correct_results)
{
this->produces_correct_results();
}
#else // HAVE_DUNE_FEM
TEST(DISABLED_L2ProjectionOperatorTest, constructible_by_ctor)
{
}
TEST(DISABLED_L2ProjectionOperatorTest, constructible_by_factory)
{
}
TEST(DISABLED_L2ProjectionOperatorTest, free_function_callable)
{
}
TEST(DISABLED_L2ProjectionOperatorTest, produces_correct_results)
{
}
#endif // HAVE_DUNE_FEM
// This file is part of the dune-gdt project:
// http://users.dune-project.org/projects/dune-gdt
// Copyright holders: Felix Schindler
// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
#include <dune/stuff/test/main.hxx>
#include "operators/projections/l2.hh"
#include "spaces/cg/pdelab.hh"
using namespace Dune::GDT::Test;
#if HAVE_DUNE_PDELAB
typedef testing::Types<SPACES_CG_PDELAB(1)
#if HAVE_ALUGRID
,
SPACES_CG_PDELAB_ALUGRID(1)
#endif
> SpaceTypes;
TYPED_TEST_CASE(L2ProjectionOperatorTest, SpaceTypes);
TYPED_TEST(L2ProjectionOperatorTest, constructible_by_ctor)
{
this->constructible_by_ctor();
}
TYPED_TEST(L2ProjectionOperatorTest, constructible_by_factory)
{
this->constructible_by_factory();
}
TYPED_TEST(L2ProjectionOperatorTest, free_function_callable)
{
this->free_function_callable();
}
TYPED_TEST(L2ProjectionOperatorTest, produces_correct_results)
{
this->produces_correct_results();
}
#else // HAVE_DUNE_PDELAB
TEST(DISABLED_L2ProjectionOperatorTest, constructible_by_ctor)
{
}
TEST(DISABLED_L2ProjectionOperatorTest, constructible_by_factory)
{
}
TEST(DISABLED_L2ProjectionOperatorTest, free_function_callable)
{
}
TEST(DISABLED_L2ProjectionOperatorTest, produces_correct_results)
{
}
#endif // HAVE_DUNE_PDELAB
// This file is part of the dune-gdt project:
// http://users.dune-project.org/projects/dune-gdt
// Copyright holders: Felix Schindler
// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
#include <dune/stuff/test/main.hxx>
#include "operators/projections/l2.hh"
#include "spaces/dg/fem.hh"
using namespace Dune::GDT::Test;
#if HAVE_DUNE_FEM
typedef testing::Types<SPACES_DG_FEM(1)
#if HAVE_ALUGRID
,
SPACES_DG_FEM_ALUGRID(1)
#endif
> SpaceTypes;
TYPED_TEST_CASE(L2ProjectionOperatorTest, SpaceTypes);
TYPED_TEST(L2ProjectionOperatorTest, constructible_by_ctor)
{
this->constructible_by_ctor();
}
TYPED_TEST(L2ProjectionOperatorTest, constructible_by_factory)
{
this->constructible_by_factory();
}
TYPED_TEST(L2ProjectionOperatorTest, free_function_callable)
{
this->free_function_callable();
}
TYPED_TEST(L2ProjectionOperatorTest, produces_correct_results)
{
this->produces_correct_results();
}
#else // HAVE_DUNE_FEM
TEST(DISABLED_L2ProjectionOperatorTest, constructible_by_ctor)
{
}
TEST(DISABLED_L2ProjectionOperatorTest, constructible_by_factory)
{
}
TEST(DISABLED_L2ProjectionOperatorTest, free_function_callable)
{
}
TEST(DISABLED_L2ProjectionOperatorTest, produces_correct_results)
{
}
#endif // HAVE_DUNE_FEM
// This file is part of the dune-gdt project:
// http://users.dune-project.org/projects/dune-gdt
// Copyright holders: Felix Schindler
// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
#include <dune/stuff/test/main.hxx>
#include "operators/projections/l2.hh"
#include "spaces/dg/pdelab.hh"
using namespace Dune::GDT::Test;
#if HAVE_DUNE_PDELAB
typedef testing::Types<SPACES_DG_PDELAB(1)
#if HAVE_ALUGRID
,
SPACES_DG_PDELAB_ALUGRID(1)
#endif
> SpaceTypes;
TYPED_TEST_CASE(L2ProjectionOperatorTest, SpaceTypes);
TYPED_TEST(L2ProjectionOperatorTest, constructible_by_ctor)
{
this->constructible_by_ctor();
}
TYPED_TEST(L2ProjectionOperatorTest, constructible_by_factory)
{
this->constructible_by_factory();
}
TYPED_TEST(L2ProjectionOperatorTest, free_function_callable)
{
this->free_function_callable();
}
TYPED_TEST(L2ProjectionOperatorTest, produces_correct_results)
{
this->produces_correct_results();
}
#else // HAVE_DUNE_PDELAB
TEST(DISABLED_L2ProjectionOperatorTest, constructible_by_ctor)
{
}
TEST(DISABLED_L2ProjectionOperatorTest, constructible_by_factory)
{
}
TEST(DISABLED_L2ProjectionOperatorTest, free_function_callable)
{
}
TEST(DISABLED_L2ProjectionOperatorTest, produces_correct_results)
{
}
#endif // HAVE_DUNE_PDELAB
// This file is part of the dune-gdt project:
// http://users.dune-project.org/projects/dune-gdt
// Copyright holders: Felix Schindler
// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
#include <dune/stuff/test/main.hxx>
#include "operators/projections/l2.hh"
#include "spaces/fv/default.hh"
using namespace Dune::GDT::Test;
typedef testing::Types<SPACE_FV_SGRID(1, 1), SPACE_FV_SGRID(2, 1), SPACE_FV_SGRID(3, 1), SPACE_FV_YASPGRID(1, 1),
SPACE_FV_YASPGRID(2, 1), SPACE_FV_YASPGRID(3, 1)
#if HAVE_ALUGRID
,
SPACE_FV_ALUCONFORMGRID(2, 1), SPACE_FV_ALUCONFORMGRID(3, 1), SPACE_FV_ALUCUBEGRID(2, 1),
SPACE_FV_ALUCUBEGRID(3, 1)
#endif // HAVE_ALUGRID
> SpaceTypes;
TYPED_TEST_CASE(L2ProjectionOperatorTest, SpaceTypes);
TYPED_TEST(L2ProjectionOperatorTest, constructible_by_ctor)
{
this->constructible_by_ctor();
}
TYPED_TEST(L2ProjectionOperatorTest, constructible_by_factory)
{
this->constructible_by_factory();
}
TYPED_TEST(L2ProjectionOperatorTest, free_function_callable)
{
this->free_function_callable();
}
TYPED_TEST(L2ProjectionOperatorTest, produces_correct_results)
{
this->produces_correct_results(0.096226);
}
// This file is part of the dune-gdt project:
// http://users.dune-project.org/projects/dune-gdt
// Copyright holders: Felix Schindler
// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
#include <dune/stuff/test/main.hxx>
#include "operators/projections/l2.hh"
#include "spaces/rt/pdelab.hh"
using namespace Dune::GDT::Test;
#if HAVE_DUNE_PDELAB
typedef testing::Types<SPACES_RT_PDELAB
#if HAVE_ALUGRID
,
SPACES_RT_PDELAB_ALUGRID
#endif
> SpaceTypes;
TYPED_TEST_CASE(L2ProjectionOperatorTest, SpaceTypes);
TYPED_TEST(L2ProjectionOperatorTest, constructible_by_ctor)
{
this->constructible_by_ctor();
}
TYPED_TEST(L2ProjectionOperatorTest, constructible_by_factory)
{
this->constructible_by_factory();
}
TYPED_TEST(L2ProjectionOperatorTest, free_function_callable)
{
this->free_function_callable();
}
TYPED_TEST(L2ProjectionOperatorTest, produces_correct_results)
{
this->produces_correct_results(0.0925927);
}
#else // HAVE_DUNE_PDELAB
TEST(DISABLED_L2ProjectionOperatorTest, constructible_by_ctor)
{
}
TEST(DISABLED_L2ProjectionOperatorTest, constructible_by_factory)
{
}
TEST(DISABLED_L2ProjectionOperatorTest, free_function_callable)
{
}
TEST(DISABLED_L2ProjectionOperatorTest, produces_correct_results)
{
}
#endif // HAVE_DUNE_PDELAB
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment