Skip to content
Snippets Groups Projects
Commit d83d6943 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

BoundaryMeshFunction added.

parent b82dbd6b
No related branches found
No related tags found
No related merge requests found
/***************************************************************************
BoundaryMeshFunction.h - description
-------------------
begin : Aug 21, 2018
copyright : (C) 2018 by oberhuber
email : tomas.oberhuber@fjfi.cvut.cz
***************************************************************************/
/* See Copyright Notice in tnl/Copyright */
#pragma once
#include <TNL/Functions/MeshFunction.h>
namespace TNL {
namespace Functions {
// BoundaryMeshFunction is supposed to store values of a mesh functions only
// at boundary mesh entities. It is just a small memory optimization.
// Currently, it is only a wrap around common MeshFunction so that we can introduce
// boundary mesh functions in the rest of the code.
// TODO: Implement it.
template< typename Mesh,
int MeshEntityDimension = Mesh::getMeshDimension(),
typename Real = typename Mesh::RealType >
class BoundaryMeshFunction :
public MeshFunction< Mesh, MeshEntityDimension, Real >
{
public:
using BaseType = MeshFunction< Mesh, MeshEntityDimension, Real >;
using ThisType = BoundaryMeshFunction< Mesh, MeshEntityDimension, Real >;
using typename BaseType::MeshType;
using typename BaseType::DeviceType;
using typename BaseType::IndexType;
using typename BaseType::MeshPointer;
using typename BaseType::RealType;
using typename BaseType::VectorType;
using typename BaseType::DistributedMeshType;
using typename BaseType::DistributedMeshSynchronizerType;
};
} // namespace Functions
} // namespace TNL
ADD_SUBDIRECTORY( Analytic ) ADD_SUBDIRECTORY( Analytic )
SET( headers Domain.h SET( headers BoundaryMeshFunction.h
Domain.h
ExactOperatorFunction.h ExactOperatorFunction.h
FunctionAdapter.h FunctionAdapter.h
MeshFunction.h MeshFunction.h
......
/***************************************************************************
BoundaryMeshFunctionTest.cpp - description
-------------------
begin : Aug 21, 2018
copyright : (C) 2018 by oberhuber
email : tomas.oberhuber@fjfi.cvut.cz
***************************************************************************/
/* See Copyright Notice in tnl/Copyright */
#include "BoundaryMeshFunctionTest.h"
\ No newline at end of file
/***************************************************************************
BoundaryMeshFunctionTest.cu - description
-------------------
begin : Aug 21, 2018
copyright : (C) 2018 by oberhuber
email : tomas.oberhuber@fjfi.cvut.cz
***************************************************************************/
/* See Copyright Notice in tnl/Copyright */
#include "BoundaryMeshFunctionTest.h"
\ No newline at end of file
/***************************************************************************
BoundaryMeshFunctionTest.h - description
-------------------
begin : Aug 21, 2018
copyright : (C) 2018 by oberhuber
email : tomas.oberhuber@fjfi.cvut.cz
***************************************************************************/
/* See Copyright Notice in tnl/Copyright */
#pragma once
#include "../GtestMissingError.h"
#ifdef HAVE_GTEST
#include <gtest/gtest.h>
#include <TNL/Functions/BoundaryMeshFunction.h>
#include <TNL/Meshes/Grid.h>
TEST( BoundaryMeshFunctionTest, BasicConstructor )
{
using Grid = TNL::Meshes::Grid< 2 >;
TNL::Functions::BoundaryMeshFunction< Grid > boundaryMesh;
}
#endif
int main( int argc, char* argv[] )
{
#ifdef HAVE_GTEST
::testing::InitGoogleTest( &argc, argv );
return RUN_ALL_TESTS();
#else
throw GtestMissingError();
#endif
}
IF( BUILD_CUDA )
CUDA_ADD_EXECUTABLE( BoundaryMeshFunctionTest BoundaryMeshFunctionTest.h BoundaryMeshFunctionTest.cu OPTIONS ${CXX_TESTS_FLAGS} )
TARGET_LINK_LIBRARIES( BoundaryMeshFunctionTest ${GTEST_BOTH_LIBRARIES}
tnl )
ELSE( BUILD_CUDA )
ADD_EXECUTABLE( BoundaryMeshFunctionTest BoundaryMeshFunctionTest.h BoundaryMeshFunctionTest.cpp )
TARGET_COMPILE_OPTIONS( BoundaryMeshFunctionTest PRIVATE ${CXX_TESTS_FLAGS} )
TARGET_LINK_LIBRARIES( BoundaryMeshFunctionTest ${GTEST_BOTH_LIBRARIES}
tnl )
ENDIF( BUILD_CUDA )
ADD_TEST( BoundaryMeshFunctionTest ${EXECUTABLE_OUTPUT_PATH}/BoundaryMeshFunctionTest${CMAKE_EXECUTABLE_SUFFIX} )
\ No newline at end of file
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