Skip to content
Snippets Groups Projects
Unverified Commit 3b24fdce authored by René Fritze's avatar René Fritze
Browse files

[affine] add a (failing to build) minimal test for an affine function

parent 2b422ca3
No related branches found
No related tags found
No related merge requests found
// This file is part of the dune-xt-functions project:
// https://github.com/dune-community/dune-xt-functions
// Copyright 2009-2017 dune-xt-functions developers and contributors. All rights reserved.
// License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
// or GPL-2.0+ (http://opensource.org/licenses/gpl-license)
// with "runtime exception" (http://www.dune-project.org/license.html)
// Authors:
// Felix Schindler (2013 - 2017)
// Rene Milk (2013 - 2016)
// Tobias Leibner (2014 - 2016)
#include <dune/xt/common/test/main.hxx>
#include <memory>
#include <dune/xt/common/exceptions.hh>
#include <dune/xt/grid/grids.hh>
#include <dune/xt/grid/gridprovider/cube.hh>
#include <dune/xt/functions/affine.hh>
#include <dune/xt/functions/test/functions.hh>
using namespace Dune;
using namespace Dune::XT;
using namespace Dune::XT::Functions;
/* we just take the constant function as a container for the types we need */
/* since this one always exists for all combinations */
struct FunctionsTest //: public FunctionTest<TESTFUNCTIONTYPE>
{
virtual void check() const
{
auto grid = XT::Grid::make_cube_grid<GRIDTYPE>();
const auto testfunction = TESTFUNCTIONTYPE::create();
for (auto&& entity : elements(grid.leaf_view())) {
auto xx_global = entity.geometry().center();
auto xx_local = entity.geometry().local(xx_global);
TESTFUNCTIONTYPE::JacobianRangeType jacobian;
testfunction->local_function(entity)->jacobian(xx_local);
}
}
};
__name = functions
__exec_suffix = {gridname}_{dimDomain}d_r{dimRange}_rc{dimRangeCols}
dimRange = 1, 3 | expand
dimRangeCols = 1, 3 | expand
include grids.mini
[__static]
GRIDTYPE = {grid}
TESTFUNCTIONTYPE = Dune::XT::Functions::AffineFunction<{entity_type}, double, {dimDomain}, double, {dimRange}, {dimRangeCols}>
......@@ -16,6 +16,7 @@
#include <dune/xt/common/exceptions.hh>
#include <dune/xt/grid/grids.hh>
#include <dune/xt/functions.hh>
#include <dune/xt/common/test/gtest/gtest.h>
#include "functions.hh"
......@@ -42,3 +43,8 @@ struct FunctionsTest : public FunctionTest<TESTFUNCTIONTYPE>
}
}
};
TEST_F(FunctionsTest, creation_and_evalution)
{
this->check();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment