...
 
Commits (24)
......@@ -226,6 +226,20 @@ if( ${WITH_CUDA} )
endif()
endif()
#####
# Check for HIP
#
if( ${WITH_HIP} )
find_package(HIP)
if(HIP_FOUND)
set(BUILD_HIP TRUE)
set(CMAKE_HIPCXX_FLAGS ${CMAKE_HIPCXX_FLAGS} -I${HIP_ROOT_DIR}/include -DHAVE_HIP -DHIP_PLATFORM=nvcc )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${HIP_ROOT_DIR}/include -DHAVE_HIP -I/usr/lib/llvm-8/include/openmp -L/usr/lib/llvm-8/lib")
#set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS_INIT} -L/usr/lib/llvm-8/lib} )
set(CMAKE_CXX_COMPILER "${HIP_ROOT_DIR}/bin/hipcc" )
endif()
endif()
if( ${WITH_PROFILING} )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g" )
......@@ -355,6 +369,7 @@ message( "-- Build options:" )
message( " OFFLINE_BUILD = ${OFFLINE_BUILD}" )
message( " WITH_CUDA = ${WITH_CUDA}" )
message( " WITH_CUDA_ARCH = ${WITH_CUDA_ARCH}" )
message( " WITH_HIP = ${WITH_HIP}" )
message( " WITH_OPENMP = ${WITH_OPENMP}" )
message( " WITH_MPI = ${WITH_MPI}" )
message( " WITH_GMP = ${WITH_GMP}" )
......@@ -368,6 +383,7 @@ message( " WITH_BENCHMARKS = ${WITH_BENCHMARKS}" )
message( " WITH_PYTHON = ${WITH_PYTHON}" )
# Print compiler options
message( "-- Compiler options:" )
message( " CMAKE_CXX_COMPILER = ${CMAKE_CXX_COMPILER}" )
message( " CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}" )
message( " CMAKE_CXX_FLAGS_DEBUG = ${CMAKE_CXX_FLAGS_DEBUG}" )
message( " CMAKE_CXX_FLAGS_RELEASE = ${CMAKE_CXX_FLAGS_RELEASE}" )
......@@ -381,6 +397,7 @@ message( " CMAKE_SHARED_LINKER_FLAGS = ${CMAKE_SHARED_LINKER_FLAGS}" )
message( " CMAKE_SHARED_LINKER_FLAGS_DEBUG = ${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" )
message( " CMAKE_SHARED_LINKER_FLAGS_RELEASE = ${CMAKE_SHARED_LINKER_FLAGS_RELEASE}" )
message( " CUDA_NVCC_FLAGS = ${CUDA_NVCC_FLAGS}" )
message( " CMAKE_HIPCXX_FLAGS = ${CMAKE_HIPCXX_FLAGS}" )
message( " GMP_LIBRARIES = ${GMP_LIBRARIES}" )
if( MPI_CXX_FOUND AND ${WITH_MPI} )
message( " MPI_CXX_COMPILE_OPTIONS = ${MPI_CXX_COMPILE_OPTIONS}" )
......
#include <iostream>
#include <TNL/Containers/Array.h>
using namespace TNL;
using namespace TNL::Containers;
int main( int argc, char* argv[] )
{
/****
* Allocate an array on host
*/
const int size = 10;
int* ai = new int[ size ];
/****
* Bind the data with TNL array
*/
Array< int > host_array;
host_array.bind( ai, size );
/****
* Initialize the data using the TNL array
*/
host_array = 66;
/****
* Check the data
*/
for( int i = 0; i < size; i++ )
std::cout << ai[ i ] << " ";
std::cout << std::endl;
/****
* Free the allocated data
*/
delete[] ai;
}
ArrayBinding-1.cpp
\ No newline at end of file
#include <iostream>
#include <TNL/Containers/Array.h>
using namespace TNL;
using namespace TNL::Containers;
void initArray( Array< int >& a )
{
/****
* Create new array, bind it with 'a' and initialize it
*/
Array< int > b( 10 );
a.bind( b );
b = 10;
/****
* Show that both arrays share the same data
*/
std::cout << "a data in initArray function is " << a.getData() << std::endl;
std::cout << "a value in initArray function is " << a << std::endl;
std::cout << "--------------------------------------" << std::endl;
std::cout << "b data in initArray function is " << b.getData() << std::endl;
std::cout << "b in initArray function is " << b << std::endl;
std::cout << "--------------------------------------" << std::endl;
}
int main( int argc, char* argv[] )
{
/****
* Create array but do not initialize it
*/
Array< int > a;
/***
* Call function initArray for the array initialization
*/
initArray( a );
/****
* Print the initialized array
*/
std::cout << "a data in main function is " << a.getData() << std::endl;
std::cout << "a in main function is " << a << std::endl;
}
ArrayBinding-2.cpp
\ No newline at end of file
#include <iostream>
#include <TNL/Containers/Array.h>
using namespace TNL;
using namespace TNL::Containers;
int main( int argc, char* argv[] )
{
/****
* Allocate data for all degrees of freedom
*/
const int size = 5;
Array< float > a( 3 * size );
/***
* Partition the data into density and velocity components
*/
Array< float > rho( a, 0, size );
Array< float > v_1( a, size, size );
Array< float > v_2( a, 2 * size, size );
rho = 10.0;
v_1 = 1.0;
v_2 = 0.0;
/****
* Print the initialized arrays
*/
std::cout << "rho = " << rho << std::endl;
std::cout << "v1 = " << v_1 << std::endl;
std::cout << "v2 = " << v_2 << std::endl;
std::cout << "a = " << a << std::endl;
}
ArrayBinding-3.cpp
\ No newline at end of file
IF( BUILD_CUDA )
CUDA_ADD_EXECUTABLE( ArrayAllocation ArrayAllocation.cu )
ADD_CUSTOM_COMMAND( COMMAND ArrayAllocation > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/ArrayAllocation.out OUTPUT ArrayAllocation.out )
CUDA_ADD_EXECUTABLE( ArrayBinding-1 ArrayBinding-1.cu )
ADD_CUSTOM_COMMAND( COMMAND ArrayBinding-1 > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/ArrayBinding-1.out OUTPUT ArrayBinding-1.out )
CUDA_ADD_EXECUTABLE( ArrayBinding-2 ArrayBinding-2.cu )
ADD_CUSTOM_COMMAND( COMMAND ArrayBinding-2 > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/ArrayBinding-2.out OUTPUT ArrayBinding-2.out )
CUDA_ADD_EXECUTABLE( ArrayBinding-3 ArrayBinding-3.cu )
ADD_CUSTOM_COMMAND( COMMAND ArrayBinding-3 > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/ArrayBinding-3.out OUTPUT ArrayBinding-3.out )
CUDA_ADD_EXECUTABLE( ArrayIO ArrayIO.cu )
ADD_CUSTOM_COMMAND( COMMAND ArrayIO > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/ArrayIO.out OUTPUT ArrayIO.out )
CUDA_ADD_EXECUTABLE( ArrayView-1 ArrayView-1.cu )
......@@ -28,9 +22,6 @@ ENDIF()
IF( BUILD_CUDA )
ADD_CUSTOM_TARGET( TutorialsArrays-cuda ALL DEPENDS
ArrayAllocation.out
ArrayBinding-1.out
ArrayBinding-2.out
ArrayBinding-3.out
ArrayIO.out
ArrayView-1.out
ArrayView-2.out
......
......@@ -6,14 +6,13 @@ This tutorial introduces arrays in TNL. There are three types - common arrays wi
## Table of Contents
1. [Arrays](#arrays)
1. [Arrays binding](#arrays_binding)
2. [Array views](#array_views)
3. [Accessing the array elements](#accessing_the_array_elements)
1. [Array views](#array_views)
2. [Accessing the array elements](#accessing_the_array_elements)
1. [Accessing the array elements with `operator[]`](#accessing_the_array_elements_with_operator)
2. [Accessing the array elements with `setElement` and `getElement`](#accessing_the_array_elements_with_set_get_element)
4. [Arrays initiation with lambdas](#arrays_initiation_with_lambdas)
5. [Checking the array contents](#checking_the_array_contents)
6. [IO operations with arrays](#io_operations_with-arrays)
3. [Arrays initiation with lambdas](#arrays_initiation_with_lambdas)
4. [Checking the array contents](#checking_the_array_contents)
5. [IO operations with arrays](#io_operations_with-arrays)
2. [Static arrays](#static_arrays)
3. [Distributed arrays](#distributed_arrays)
......@@ -34,36 +33,11 @@ The result looks as follows:
\include ArrayAllocation.out
### Arrays binding <a name="arrays_binding"></a>
Arrays can share data with each other or data allocated elsewhere. It is called binding and it can be done using method `bind`. The following example shows how to bind data allocated on host using the `new` operator. In this case, the TNL array do not free this data at the and of its life cycle.
\include ArrayBinding-1.cpp
It generates output like this:
\include ArrayBinding-1.out
One may also bind TNL array with another TNL array. In this case, the data is shared and can be shared between multiple arrays. Reference counter ensures that the data is freed after the last array sharing the data ends its life cycle.
\include ArrayBinding-2.cpp
The result is:
\include ArrayBinding-2.out
Binding may also serve for data partitioning. Both CPU and GPU prefer data allocated in large contiguous blocks instead of many fragmented pieces of allocated memory. Another reason why one might want to partition the allocated data is demonstrated in the following example. Consider a situation of solving incompressible flow in 2D. The degrees of freedom consist of density and two components of velocity. Mostly, we want to manipulate either density or velocity. But some numerical solvers may need to have all degrees of freedom in one array. It can be managed like this:
\include ArrayBinding-3.cpp
The result is:
\include ArrayBinding-3.out
### Array views <a name="array_views"></a>
Because of the data sharing, TNL Array is relatively complicated structure. In many situations, we prefer lightweight structure which only encapsulates the data pointer and keeps information about the data size. Passing array structure to GPU kernel can be one example. For this purpose there is `ArrayView` in TNL. It is templated structure having the same template parameters as `Array` (it means `Value`, `Device` and `Index`). The following code snippet shows how to create an array view.
Arrays cannot share data with each other or data allocated elsewhere. This can be achieved with the `ArrayView` structure which has similar semantics to `Array`, but it does not handle allocation and deallocation of the data. Hence, array view cannot be resized, but it can be used to wrap data allocated elsewhere (e.g. using an `Array` or an operator `new`) and to partition large arrays into subarrays. The process of wrapping external data with a view is called _binding_.
The following code snippet shows how to create an array view.
\include ArrayView-1.cpp
......@@ -71,7 +45,7 @@ The output is:
\include ArrayView-1.out
Of course, one may bind his own data into array view:
You can also bind external data into array view:
\include ArrayView-2.cpp
......@@ -79,7 +53,7 @@ Output:
\include ArrayView-2.out
Array view never allocated or deallocate the memory managed by it. Therefore it can be created even in CUDA kernels which is not true for `Array`.
Since array views do not allocate or deallocate memory, they can be created even in CUDA kernels, which is not possible with `Array`. `ArrayView` can also be passed-by-value into CUDA kernels or captured-by-value by device lambda functions, because the `ArrayView`'s copy-constructor makes only a shallow copy (i.e., it copies only the data pointer and size).
### Accessing the array elements <a name="accessing_the_array_elements"></a>
......
......@@ -16,6 +16,7 @@ VERBOSE=""
OFFLINE_BUILD="no"
WITH_CLANG="no"
WITH_HIP="no"
WITH_MPI="yes"
WITH_CUDA="yes"
WITH_CUDA_ARCH="auto"
......@@ -49,6 +50,7 @@ do
--help ) HELP="yes" ;;
--offline-build ) OFFLINE_BUILD="yes" ;;
--with-clang=* ) WITH_CLANG="${option#*=}" ;;
--with-hip=* ) WITH_HIP="${option#*=}" ;;
--with-mpi=* ) WITH_MPI="${option#*=}" ;;
--with-cuda=* ) WITH_CUDA="${option#*=}" ;;
--with-cuda-arch=* ) WITH_CUDA_ARCH="${option#*=}";;
......@@ -107,9 +109,6 @@ if [[ ${WITH_CLANG} == "yes" ]]; then
export CXX=clang++
export CC=clang
export CUDA_HOST_COMPILER=clang++
else
export CXX=g++
export CC=gcc
fi
if [[ ! $(command -v cmake) ]]; then
......@@ -135,6 +134,7 @@ cmake_command=(
-DOFFLINE_BUILD=${OFFLINE_BUILD}
-DWITH_CUDA=${WITH_CUDA}
-DWITH_CUDA_ARCH=${WITH_CUDA_ARCH}
-DWITH_HIP=${WITH_HIP}
-DWITH_OPENMP=${WITH_OPENMP}
-DWITH_MPI=${WITH_MPI}
-DWITH_GMP=${WITH_GMP}
......
This diff is collapsed.
###############################################################################
# Runs commands using HIPCC
###############################################################################
###############################################################################
# This file runs the hipcc commands to produce the desired output file
# along with the dependency file needed by CMake to compute dependencies.
#
# Input variables:
#
# verbose:BOOL=<> OFF: Be as quiet as possible (default)
# ON : Describe each step
# build_configuration:STRING=<> Build configuration. Defaults to Debug.
# generated_file:STRING=<> File to generate. Mandatory argument.
if(NOT build_configuration)
set(build_configuration Debug)
endif()
if(NOT generated_file)
message(FATAL_ERROR "You must specify generated_file on the command line")
endif()
# Set these up as variables to make reading the generated file easier
set(HIP_HIPCC_EXECUTABLE "@HIP_HIPCC_EXECUTABLE@") # path
set(HIP_HIPCONFIG_EXECUTABLE "@HIP_HIPCONFIG_EXECUTABLE@") #path
set(HIP_HOST_COMPILER "@HIP_HOST_COMPILER@") # path
set(CMAKE_COMMAND "@CMAKE_COMMAND@") # path
set(HIP_run_make2cmake "@HIP_run_make2cmake@") # path
set(HCC_HOME "@HCC_HOME@") #path
@HIP_HOST_FLAGS@
@_HIP_HIPCC_FLAGS@
@_HIP_HCC_FLAGS@
@_HIP_NVCC_FLAGS@
set(HIP_HIPCC_INCLUDE_ARGS "@HIP_HIPCC_INCLUDE_ARGS@") # list (needs to be in quotes to handle spaces properly)
set(cmake_dependency_file "@cmake_dependency_file@") # path
set(source_file "@source_file@") # path
set(host_flag "@host_flag@") # bool
# Determine compiler and compiler flags
execute_process(COMMAND ${HIP_HIPCONFIG_EXECUTABLE} --platform OUTPUT_VARIABLE HIP_PLATFORM OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT host_flag)
set(__CC ${HIP_HIPCC_EXECUTABLE})
if(HIP_PLATFORM STREQUAL "hcc")
if(NOT "x${HCC_HOME}" STREQUAL "x")
set(ENV{HCC_HOME} ${HCC_HOME})
endif()
set(__CC_FLAGS ${HIP_HIPCC_FLAGS} ${HIP_HCC_FLAGS} ${HIP_HIPCC_FLAGS_${build_configuration}} ${HIP_HCC_FLAGS_${build_configuration}})
else()
set(__CC_FLAGS ${HIP_HIPCC_FLAGS} ${HIP_NVCC_FLAGS} ${HIP_HIPCC_FLAGS_${build_configuration}} ${HIP_NVCC_FLAGS_${build_configuration}})
endif()
else()
set(__CC ${HIP_HOST_COMPILER})
set(__CC_FLAGS ${CMAKE_HOST_FLAGS} ${CMAKE_HOST_FLAGS_${build_configuration}})
endif()
set(__CC_INCLUDES ${HIP_HIPCC_INCLUDE_ARGS})
# hip_execute_process - Executes a command with optional command echo and status message.
# status - Status message to print if verbose is true
# command - COMMAND argument from the usual execute_process argument structure
# ARGN - Remaining arguments are the command with arguments
# HIP_result - Return value from running the command
macro(hip_execute_process status command)
set(_command ${command})
if(NOT "x${_command}" STREQUAL "xCOMMAND")
message(FATAL_ERROR "Malformed call to hip_execute_process. Missing COMMAND as second argument. (command = ${command})")
endif()
if(verbose)
execute_process(COMMAND "${CMAKE_COMMAND}" -E echo -- ${status})
# Build command string to print
set(hip_execute_process_string)
foreach(arg ${ARGN})
# Escape quotes if any
string(REPLACE "\"" "\\\"" arg ${arg})
# Surround args with spaces with quotes
if(arg MATCHES " ")
list(APPEND hip_execute_process_string "\"${arg}\"")
else()
list(APPEND hip_execute_process_string ${arg})
endif()
endforeach()
# Echo the command
execute_process(COMMAND ${CMAKE_COMMAND} -E echo ${hip_execute_process_string})
endif()
# Run the command
execute_process(COMMAND ${ARGN} RESULT_VARIABLE HIP_result)
endmacro()
# Delete the target file
hip_execute_process(
"Removing ${generated_file}"
COMMAND "${CMAKE_COMMAND}" -E remove "${generated_file}"
)
# Generate the dependency file
hip_execute_process(
"Generating dependency file: ${cmake_dependency_file}.pre"
COMMAND "${__CC}"
-M
"${source_file}"
-o "${cmake_dependency_file}.pre"
${__CC_FLAGS}
${__CC_INCLUDES}
)
if(HIP_result)
message(FATAL_ERROR "Error generating ${generated_file}")
endif()
# Generate the cmake readable dependency file to a temp file
hip_execute_process(
"Generating temporary cmake readable file: ${cmake_dependency_file}.tmp"
COMMAND "${CMAKE_COMMAND}"
-D "input_file:FILEPATH=${cmake_dependency_file}.pre"
-D "output_file:FILEPATH=${cmake_dependency_file}.tmp"
-D "verbose=${verbose}"
-P "${HIP_run_make2cmake}"
)
if(HIP_result)
message(FATAL_ERROR "Error generating ${generated_file}")
endif()
# Copy the file if it is different
hip_execute_process(
"Copy if different ${cmake_dependency_file}.tmp to ${cmake_dependency_file}"
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${cmake_dependency_file}.tmp" "${cmake_dependency_file}"
)
if(HIP_result)
message(FATAL_ERROR "Error generating ${generated_file}")
endif()
# Delete the temporary file
hip_execute_process(
"Removing ${cmake_dependency_file}.tmp and ${cmake_dependency_file}.pre"
COMMAND "${CMAKE_COMMAND}" -E remove "${cmake_dependency_file}.tmp" "${cmake_dependency_file}.pre"
)
if(HIP_result)
message(FATAL_ERROR "Error generating ${generated_file}")
endif()
# Generate the output file
hip_execute_process(
"Generating ${generated_file}"
COMMAND "${__CC}"
-c
"${source_file}"
-o "${generated_file}"
${__CC_FLAGS}
${__CC_INCLUDES}
)
if(HIP_result)
# Make sure that we delete the output file
hip_execute_process(
"Removing ${generated_file}"
COMMAND "${CMAKE_COMMAND}" -E remove "${generated_file}"
)
message(FATAL_ERROR "Error generating file ${generated_file}")
else()
if(verbose)
message("Generated ${generated_file} successfully.")
endif()
endif()
# vim: ts=4:sw=4:expandtab:smartindent
###############################################################################
# Computes dependencies using HIPCC
###############################################################################
###############################################################################
# This file converts dependency files generated using hipcc to a format that
# cmake can understand.
# Input variables:
#
# input_file:STRING=<> Dependency file to parse. Required argument
# output_file:STRING=<> Output file to generate. Required argument
if(NOT input_file OR NOT output_file)
message(FATAL_ERROR "You must specify input_file and output_file on the command line")
endif()
file(READ ${input_file} depend_text)
if (NOT "${depend_text}" STREQUAL "")
string(REPLACE " /" "\n/" depend_text ${depend_text})
string(REGEX REPLACE "^.*:" "" depend_text ${depend_text})
string(REGEX REPLACE "[ \\\\]*\n" ";" depend_text ${depend_text})
set(dependency_list "")
foreach(file ${depend_text})
string(REGEX REPLACE "^ +" "" file ${file})
if(NOT EXISTS "${file}")
message(WARNING " Removing non-existent dependency file: ${file}")
set(file "")
endif()
if(NOT IS_DIRECTORY "${file}")
get_filename_component(file_absolute "${file}" ABSOLUTE)
list(APPEND dependency_list "${file_absolute}")
endif()
endforeach()
endif()
# Remove the duplicate entries and sort them.
list(REMOVE_DUPLICATES dependency_list)
list(SORT dependency_list)
foreach(file ${dependency_list})
set(hip_hipcc_depend "${hip_hipcc_depend} \"${file}\"\n")
endforeach()
file(WRITE ${output_file} "# Generated by: FindHIP.cmake. Do not edit.\nSET(HIP_HIPCC_DEPEND\n ${hip_hipcc_depend})\n\n")
# vim: ts=4:sw=4:expandtab:smartindent
......@@ -2,7 +2,7 @@
#define HeatEquationBenchmarkPROBLEM_H_
#include <TNL/Problems/PDEProblem.h>
#include <TNL/Functions/MeshFunction.h>
#include <TNL/Functions/MeshFunctionView.h>
#include <TNL/Solvers/PDE/ExplicitUpdater.h>
#include "Tuning/ExplicitUpdater.h"
......@@ -26,8 +26,8 @@ class HeatEquationBenchmarkProblem:
typedef typename DifferentialOperator::RealType RealType;
typedef typename Mesh::DeviceType DeviceType;
typedef typename DifferentialOperator::IndexType IndexType;
typedef Functions::MeshFunction< Mesh > MeshFunctionType;
typedef Pointers::SharedPointer< MeshFunctionType, DeviceType > MeshFunctionPointer;
typedef Functions::MeshFunctionView< Mesh > MeshFunctionViewType;
typedef Pointers::SharedPointer< MeshFunctionViewType, DeviceType > MeshFunctionViewPointer;
typedef PDEProblem< Mesh, Communicator, RealType, DeviceType, IndexType > BaseType;
typedef Pointers::SharedPointer< DifferentialOperator > DifferentialOperatorPointer;
typedef Pointers::SharedPointer< BoundaryCondition > BoundaryConditionPointer;
......@@ -86,7 +86,7 @@ class HeatEquationBenchmarkProblem:
BoundaryConditionPointer boundaryConditionPointer;
RightHandSidePointer rightHandSidePointer;
MeshFunctionPointer fu, u;
MeshFunctionViewPointer fu, u;
String cudaKernelType;
......@@ -95,8 +95,8 @@ class HeatEquationBenchmarkProblem:
RightHandSide* cudaRightHandSide;
DifferentialOperator* cudaDifferentialOperator;
TNL::ExplicitUpdater< Mesh, MeshFunctionType, DifferentialOperator, BoundaryCondition, RightHandSide > tuningExplicitUpdater;
TNL::Solvers::PDE::ExplicitUpdater< Mesh, MeshFunctionType, DifferentialOperator, BoundaryCondition, RightHandSide > explicitUpdater;
TNL::ExplicitUpdater< Mesh, MeshFunctionViewType, DifferentialOperator, BoundaryCondition, RightHandSide > tuningExplicitUpdater;
TNL::Solvers::PDE::ExplicitUpdater< Mesh, MeshFunctionViewType, DifferentialOperator, BoundaryCondition, RightHandSide > explicitUpdater;
};
......
......@@ -117,7 +117,7 @@ void
HeatEquationBenchmarkProblem< Mesh, BoundaryCondition, RightHandSide, DifferentialOperator, Communicator >::
bindDofs( DofVectorPointer& dofsPointer )
{
this->u->bind( this->getMesh(), dofsPointer );
this->u->bind( this->getMesh(), *dofsPointer );
}
template< typename Mesh,
......@@ -131,7 +131,8 @@ setInitialCondition( const Config::ParameterContainer& parameters,
DofVectorPointer& dofsPointer )
{
const String& initialConditionFile = parameters.getParameter< String >( "initial-condition" );
Functions::MeshFunction< Mesh > u( this->getMesh(), dofsPointer );
MeshFunctionViewType u;
u.bind( this->getMesh(), *dofsPointer );
try
{
u.boundLoad( initialConditionFile );
......@@ -183,9 +184,9 @@ makeSnapshot( const RealType& time,
{
std::cout << std::endl << "Writing output at time " << time << " step " << step << "." << std::endl;
this->bindDofs( dofsPointer );
MeshFunctionType u;
MeshFunctionViewType u;
u.bind( this->getMesh(), *dofsPointer );
FileName fileName;
fileName.setFileNameBase( "u-" );
fileName.setExtension( "tnl" );
......@@ -475,8 +476,8 @@ getExplicitUpdate( const RealType& time,
//typedef typename MeshType::Cell CellType;
//std::cerr << "Size of entity is ... " << sizeof( TestEntity< MeshType > ) << " vs. " << sizeof( CellType ) << std::endl;
typedef typename CellType::CoordinatesType CoordinatesType;
u->bind( mesh, uDofs );
fu->bind( mesh, fuDofs );
u->bind( mesh, *uDofs );
fu->bind( mesh, *fuDofs );
fu->getData().setValue( 1.0 );
const CoordinatesType begin( 0,0 );
const CoordinatesType& end = mesh->getDimensions();
......@@ -493,7 +494,7 @@ getExplicitUpdate( const RealType& time,
Pointers::synchronizeSmartPointersOnDevice< Devices::Cuda >();
for( IndexType gridYIdx = 0; gridYIdx < cudaYGrids; gridYIdx ++ )
for( IndexType gridXIdx = 0; gridXIdx < cudaXGrids; gridXIdx ++ )
boundaryConditionsTemplatedCompact< MeshType, CellType, BoundaryCondition, MeshFunctionType >
boundaryConditionsTemplatedCompact< MeshType, CellType, BoundaryCondition, MeshFunctionViewType >
<<< cudaBlocks, cudaBlockSize >>>
( &mesh.template getData< Devices::Cuda >(),
&boundaryConditionPointer.template getData< Devices::Cuda >(),
......@@ -511,7 +512,7 @@ getExplicitUpdate( const RealType& time,
//std::cerr << "Computing the heat equation ..." << std::endl;
for( IndexType gridYIdx = 0; gridYIdx < cudaYGrids; gridYIdx ++ )
for( IndexType gridXIdx = 0; gridXIdx < cudaXGrids; gridXIdx ++ )
heatEquationTemplatedCompact< MeshType, CellType, DifferentialOperator, RightHandSide, MeshFunctionType >
heatEquationTemplatedCompact< MeshType, CellType, DifferentialOperator, RightHandSide, MeshFunctionViewType >
<<< cudaBlocks, cudaBlockSize >>>
( &mesh.template getData< DeviceType >(),
&differentialOperatorPointer.template getData< DeviceType >(),
......@@ -532,8 +533,8 @@ getExplicitUpdate( const RealType& time,
{
//if( !this->cudaMesh )
// this->cudaMesh = tnlCuda::passToDevice( &mesh );
this->u->bind( mesh, uDofs );
this->fu->bind( mesh, fuDofs );
this->u->bind( mesh, *uDofs );
this->fu->bind( mesh, *fuDofs );
//explicitUpdater.setGPUTransferTimer( this->gpuTransferTimer );
this->explicitUpdater.template update< typename Mesh::Cell, CommunicatorType >( time, tau, mesh, this->u, this->fu );
}
......@@ -541,19 +542,19 @@ getExplicitUpdate( const RealType& time,
{
if( std::is_same< DeviceType, Devices::Cuda >::value )
{
this->u->bind( mesh, uDofs );
this->fu->bind( mesh, fuDofs );
this->u->bind( mesh, *uDofs );
this->fu->bind( mesh, *fuDofs );
/*this->explicitUpdater.template update< typename Mesh::Cell >( time, tau, mesh, this->u, this->fu );
return;*/
#ifdef WITH_TNL
using ExplicitUpdaterType = TNL::Solvers::PDE::ExplicitUpdater< Mesh, MeshFunctionType, DifferentialOperator, BoundaryCondition, RightHandSide >;
using ExplicitUpdaterType = TNL::Solvers::PDE::ExplicitUpdater< Mesh, MeshFunctionViewType, DifferentialOperator, BoundaryCondition, RightHandSide >;
using Cell = typename MeshType::Cell;
using MeshTraverserType = Meshes::Traverser< MeshType, Cell >;
using UserData = TNL::Solvers::PDE::ExplicitUpdaterTraverserUserData< RealType,
MeshFunctionType,
MeshFunctionViewType,
DifferentialOperator,
BoundaryCondition,
RightHandSide >;
......@@ -561,12 +562,12 @@ getExplicitUpdate( const RealType& time,
#else
//using CellConfig = Meshes::GridEntityNoStencilStorage;
using CellConfig = Meshes::GridEntityCrossStencilStorage< 1 >;
using ExplicitUpdaterType = ExplicitUpdater< Mesh, MeshFunctionType, DifferentialOperator, BoundaryCondition, RightHandSide >;
using ExplicitUpdaterType = ExplicitUpdater< Mesh, MeshFunctionViewType, DifferentialOperator, BoundaryCondition, RightHandSide >;
using Cell = typename MeshType::Cell;
//using Cell = SimpleCell< Mesh, CellConfig >;
using MeshTraverserType = Traverser< MeshType, Cell >;
using UserData = ExplicitUpdaterTraverserUserData< RealType,
MeshFunctionType,
MeshFunctionViewType,
DifferentialOperator,
BoundaryCondition,
RightHandSide >;
......@@ -735,16 +736,15 @@ assemblyLinearSystem( const RealType& time,
{
// TODO: the instance should be "cached" like this->explicitUpdater, but there is a problem with MatrixPointer
Solvers::PDE::LinearSystemAssembler< Mesh,
MeshFunctionType,
MeshFunctionViewType,
DifferentialOperator,
BoundaryCondition,
RightHandSide,
Solvers::PDE::BackwardTimeDiscretisation,
typename DofVectorPointer::ObjectType > systemAssembler;
typedef Functions::MeshFunction< Mesh > MeshFunctionType;
typedef Pointers::SharedPointer< MeshFunctionType, DeviceType > MeshFunctionPointer;
MeshFunctionPointer u( this->getMesh(), *_u );
MeshFunctionViewPointer u;
u->bind( this->getMesh(), *_u );
systemAssembler.setDifferentialOperator( this->differentialOperator );
systemAssembler.setBoundaryConditions( this->boundaryCondition );
systemAssembler.setRightHandSide( this->rightHandSide );
......
......@@ -18,7 +18,7 @@
#include <TNL/Devices/Cuda.h>
#include <TNL/Containers/StaticVector.h>
#include <TNL/Meshes/Grid.h>
#include <TNL/Functions/MeshFunction.h>
#include <TNL/Functions/MeshFunctionView.h>
#include "pure-c-rhs.h"
using namespace std;
......@@ -325,13 +325,13 @@ bool solveHeatEquationCuda( const Config::ParameterContainer& parameters,
GridPointer gridPointer;
gridPointer->setDimensions( gridXSize, gridYSize );
gridPointer->setDomain( PointType( 0.0, 0.0 ), PointType( domainXSize, domainYSize ) );
Containers::Vector< Real, Devices::Cuda, Index > vecU;
Containers::VectorView< Real, Devices::Cuda, Index > vecU;
vecU.bind( cuda_u, gridXSize * gridYSize );
Functions::MeshFunction< GridType > meshFunction;
Functions::MeshFunctionView< GridType > meshFunction;
meshFunction.bind( gridPointer, vecU );
meshFunction.save( "simple-heat-equation-initial.tnl" );
Containers::Vector< Real, Devices::Cuda, Index > vecAux;
Containers::VectorView< Real, Devices::Cuda, Index > vecAux;
vecAux.bind( cuda_aux, gridXSize * gridYSize );
vecAux.setValue( 0.0 );
......@@ -552,9 +552,9 @@ bool solveHeatEquationHost( const Config::ParameterContainer& parameters,
Pointers::SharedPointer< GridType > gridPointer;
gridPointer->setDimensions( gridXSize, gridYSize );
gridPointer->setDomain( PointType( 0.0, 0.0 ), PointType( domainXSize, domainYSize ) );
Containers::Vector< Real, Devices::Host, Index > vecU;
Containers::VectorView< Real, Devices::Host, Index > vecU;
vecU.bind( u, gridXSize * gridYSize );
Functions::MeshFunction< GridType > meshFunction;
Functions::MeshFunctionView< GridType > meshFunction;
meshFunction.bind( gridPointer, vecU );
meshFunction.save( "simple-heat-equation-result.tnl" );
......
......@@ -24,7 +24,7 @@
#include <TNL/Operators/Operator.h>
#include <TNL/Functions/Analytic/Constant.h>
#include <TNL/Functions/FunctionAdapter.h>
#include <TNL/Functions/MeshFunction.h>
#include <TNL/Functions/MeshFunctionView.h>
namespace TNL {
namespace Operators {
......
......@@ -24,7 +24,7 @@
#include <TNL/Operators/Operator.h>
#include <TNL/Functions/Analytic/Constant.h>
#include <TNL/Functions/FunctionAdapter.h>
#include <TNL/Functions/MeshFunction.h>
#include <TNL/Functions/MeshFunctionView.h>
namespace TNL {
namespace Operators {
......
......@@ -19,7 +19,7 @@ class BoundaryConditionsBoiler
typedef Real RealType;
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< Mesh > MeshFunctionType;
typedef Functions::MeshFunctionView< Mesh > MeshFunctionType;
typedef typename Mesh::DeviceType DeviceType;
typedef TNL::Operators::DensityBoundaryConditionsBoiler< MeshType, FunctionType, RealType, IndexType > DensityBoundaryConditionsType;
......
......@@ -19,7 +19,7 @@ class BoundaryConditionsCavity
typedef Real RealType;
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< Mesh > MeshFunctionType;
typedef Functions::MeshFunctionView< Mesh > MeshFunctionType;
typedef typename Mesh::DeviceType DeviceType;
typedef TNL::Operators::DensityBoundaryConditionsCavity< MeshType, FunctionType, RealType, IndexType > DensityBoundaryConditionsType;
......
......@@ -11,7 +11,7 @@
#pragma once
#include <TNL/Functions/MeshFunction.h>
#include <TNL/Functions/MeshFunctionView.h>
#include <TNL/Functions/VectorField.h>
#include <TNL/Pointers/SharedPointer.h>
......@@ -26,7 +26,7 @@ class CompressibleConservativeVariables
typedef typename MeshType::RealType RealType;
typedef typename MeshType::DeviceType DeviceType;
typedef typename MeshType::IndexType IndexType;
typedef Functions::MeshFunction< Mesh > MeshFunctionType;
typedef Functions::MeshFunctionView< Mesh > MeshFunctionType;
typedef Functions::VectorField< Dimensions, MeshFunctionType > VelocityFieldType;
typedef Pointers::SharedPointer< MeshType > MeshPointer;
typedef Pointers::SharedPointer< MeshFunctionType > MeshFunctionPointer;
......@@ -50,7 +50,7 @@ class CompressibleConservativeVariables
template< typename Vector >
void bind( const MeshPointer& meshPointer,
const Vector& data,
Vector& data,
IndexType offset = 0 )
{
IndexType currentOffset( offset );
......
......@@ -107,7 +107,7 @@ class DensityBoundaryConditionsBoiler< Meshes::Grid< 1, MeshReal, Device, MeshIn
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 1, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......@@ -229,7 +229,7 @@ class DensityBoundaryConditionsBoiler< Meshes::Grid< 2, MeshReal, Device, MeshIn
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 2, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......@@ -378,7 +378,7 @@ class DensityBoundaryConditionsBoiler< Meshes::Grid< 3, MeshReal, Device, MeshIn
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 3, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......
......@@ -107,7 +107,7 @@ class DensityBoundaryConditionsCavity< Meshes::Grid< 1, MeshReal, Device, MeshIn
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 1, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......@@ -229,7 +229,7 @@ class DensityBoundaryConditionsCavity< Meshes::Grid< 2, MeshReal, Device, MeshIn
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 2, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......@@ -375,7 +375,7 @@ class DensityBoundaryConditionsCavity< Meshes::Grid< 3, MeshReal, Device, MeshIn
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 3, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......
......@@ -109,7 +109,7 @@ class EnergyBoundaryConditionsBoiler< Meshes::Grid< 1, MeshReal, Device, MeshInd
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 1, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......@@ -247,7 +247,7 @@ class EnergyBoundaryConditionsBoiler< Meshes::Grid< 2, MeshReal, Device, MeshInd
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 2, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......@@ -526,7 +526,7 @@ class EnergyBoundaryConditionsBoiler< Meshes::Grid< 3, MeshReal, Device, MeshInd
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 3, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......
......@@ -109,7 +109,7 @@ class EnergyBoundaryConditionsCavity< Meshes::Grid< 1, MeshReal, Device, MeshInd
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 1, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......@@ -247,7 +247,7 @@ class EnergyBoundaryConditionsCavity< Meshes::Grid< 2, MeshReal, Device, MeshInd
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 2, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......@@ -470,7 +470,7 @@ class EnergyBoundaryConditionsCavity< Meshes::Grid< 3, MeshReal, Device, MeshInd
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 3, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......
......@@ -33,7 +33,7 @@ class LaxFridrichs
typedef Real RealType;
typedef typename Mesh::DeviceType DeviceType;
typedef Index IndexType;
typedef Functions::MeshFunction< Mesh > MeshFunctionType;
typedef Functions::MeshFunctionView< Mesh > MeshFunctionType;
static const int Dimensions = Mesh::getMeshDimension();
typedef Functions::VectorField< Dimensions, MeshFunctionType > VectorFieldType;
......
......@@ -31,7 +31,7 @@ class LaxFridrichsContinuityBase
typedef Mesh MeshType;
typedef typename MeshType::DeviceType DeviceType;
typedef typename MeshType::CoordinatesType CoordinatesType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
static const int Dimensions = MeshType::getMeshDimension();
typedef Functions::VectorField< Dimensions, MeshFunctionType > VelocityFieldType;
typedef Pointers::SharedPointer< VelocityFieldType > VelocityFieldPointer;
......
......@@ -27,7 +27,7 @@ class LaxFridrichsEnergyBase
typedef Mesh MeshType;
typedef typename MeshType::DeviceType DeviceType;
typedef typename MeshType::CoordinatesType CoordinatesType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
static const int Dimensions = MeshType::getMeshDimension();
typedef Functions::VectorField< Dimensions, MeshFunctionType > VelocityFieldType;
typedef Pointers::SharedPointer< MeshFunctionType > MeshFunctionPointer;
......
......@@ -25,7 +25,7 @@ class LaxFridrichsMomentumBase
typedef Mesh MeshType;
typedef typename MeshType::DeviceType DeviceType;
typedef typename MeshType::CoordinatesType CoordinatesType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
static const int Dimensions = MeshType::getMeshDimension();
typedef Functions::VectorField< Dimensions, MeshFunctionType > VelocityFieldType;
typedef Pointers::SharedPointer< MeshFunctionType > MeshFunctionPointer;
......
......@@ -107,7 +107,7 @@ class MomentumXBoundaryConditionsBoiler< Meshes::Grid< 1, MeshReal, Device, Mesh
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 1, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......@@ -237,7 +237,7 @@ class MomentumXBoundaryConditionsBoiler< Meshes::Grid< 2, MeshReal, Device, Mesh
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 2, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......@@ -412,7 +412,7 @@ class MomentumXBoundaryConditionsBoiler< Meshes::Grid< 3, MeshReal, Device, Mesh
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 3, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......
......@@ -107,7 +107,7 @@ class MomentumXBoundaryConditionsCavity< Meshes::Grid< 1, MeshReal, Device, Mesh
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 1, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......@@ -237,7 +237,7 @@ class MomentumXBoundaryConditionsCavity< Meshes::Grid< 2, MeshReal, Device, Mesh
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 2, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......@@ -401,7 +401,7 @@ class MomentumXBoundaryConditionsCavity< Meshes::Grid< 3, MeshReal, Device, Mesh
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 3, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......
......@@ -107,7 +107,7 @@ class MomentumYBoundaryConditionsBoiler< Meshes::Grid< 1, MeshReal, Device, Mesh
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 1, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......@@ -237,7 +237,7 @@ class MomentumYBoundaryConditionsBoiler< Meshes::Grid< 2, MeshReal, Device, Mesh
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 2, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......@@ -407,7 +407,7 @@ class MomentumYBoundaryConditionsBoiler< Meshes::Grid< 3, MeshReal, Device, Mesh
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 3, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......
......@@ -107,7 +107,7 @@ class MomentumYBoundaryConditionsCavity< Meshes::Grid< 1, MeshReal, Device, Mesh
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 1, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......@@ -237,7 +237,7 @@ class MomentumYBoundaryConditionsCavity< Meshes::Grid< 2, MeshReal, Device, Mesh
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 2, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......@@ -398,7 +398,7 @@ class MomentumYBoundaryConditionsCavity< Meshes::Grid< 3, MeshReal, Device, Mesh
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 3, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......
......@@ -107,7 +107,7 @@ class MomentumZBoundaryConditionsBoiler< Meshes::Grid< 1, MeshReal, Device, Mesh
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 1, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......@@ -237,7 +237,7 @@ class MomentumZBoundaryConditionsBoiler< Meshes::Grid< 2, MeshReal, Device, Mesh
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 2, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......@@ -388,7 +388,7 @@ class MomentumZBoundaryConditionsBoiler< Meshes::Grid< 3, MeshReal, Device, Mesh
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 3, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......
......@@ -107,7 +107,7 @@ class MomentumZBoundaryConditionsCavity< Meshes::Grid< 1, MeshReal, Device, Mesh
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 1, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......@@ -237,7 +237,7 @@ class MomentumZBoundaryConditionsCavity< Meshes::Grid< 2, MeshReal, Device, Mesh
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 2, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......@@ -388,7 +388,7 @@ class MomentumZBoundaryConditionsCavity< Meshes::Grid< 3, MeshReal, Device, Mesh
typedef Index IndexType;
typedef Function FunctionType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Containers::Vector< RealType, DeviceType, IndexType> DofVectorType;
typedef Containers::StaticVector< 3, RealType > PointType;
typedef typename MeshType::CoordinatesType CoordinatesType;
......
......@@ -11,7 +11,7 @@
#pragma once
#include <TNL/Pointers/SharedPointer.h>
#include <TNL/Functions/MeshFunction.h>
#include <TNL/Functions/MeshFunctionView.h>
#include <TNL/Functions/VectorField.h>
#include <TNL/Functions/MeshFunctionEvaluator.h>
#include "CompressibleConservativeVariables.h"
......@@ -29,7 +29,7 @@ class PhysicalVariablesGetter
typedef typename MeshType::IndexType IndexType;
static const int Dimensions = MeshType::getMeshDimension();
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Pointers::SharedPointer< MeshFunctionType > MeshFunctionPointer;
typedef CompressibleConservativeVariables< MeshType > ConservativeVariablesType;
typedef Pointers::SharedPointer< ConservativeVariablesType > ConservativeVariablesPointer;
......
......@@ -37,7 +37,7 @@ class RiemannProblemInitialConditionSetter< Meshes::Grid< 1,MeshReal, Device, Me
typedef typename MeshType::IndexType IndexType;
static const int Dimensions = MeshType::getMeshDimension();
typedef Containers::StaticVector< Dimensions, RealType > PointType;
typedef Functions::MeshFunction< MeshType > MeshFunctionType;
typedef Functions::MeshFunctionView< MeshType > MeshFunctionType;
typedef Pointers::SharedPointer< MeshFunctionType > MeshFunctionPointer;
typedef Functions::VectorField< Dimensions, MeshType > VectorFieldType;
// for cyklus i = 0 to mesh.getDimensions().x() j pro .y() a k pro .z()
......@@ -194,7 +194,7 @@ class RiemannProblemInitialConditionSetter< Meshes::Grid< 2, MeshReal, Device, M
typedef typename MeshType::IndexType IndexType;
static const int Dimensions = MeshType::getMeshDimension();
typedef Containers::StaticVector< Dimensions, RealTy