Commit 79642197 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Merge branch 'develop' into euler

parents 2e3ce873 5ee34d29
Loading
Loading
Loading
Loading
+101 −14
Original line number Diff line number Diff line
@@ -18,19 +18,36 @@ stages:
    WITH_CUDA: "no"
    WITH_CUDA_ARCH: "auto"
    WITH_MIC: "no"
    WITH_MPI: "no"
    WITH_TESTS: "yes"
    WITH_COVERAGE: "no"
    WITH_EXAMPLES: "yes"
    # these are built only in the "full" config
    WITH_BENCHMARKS: "no"
    WITH_EXAMPLES: "no"
    WITH_TOOLS: "no"
    WITH_PYTHON: "no"

# template for build jobs
.build_template_def: &build_template
    stage: build
    script:
        - export NUM_CORES=$(grep "core id" /proc/cpuinfo | wc -l)
        - export MAKEFLAGS="-l$(echo 1.5*$NUM_CORES | bc) -j$NUM_CORES"
        # set MPI compiler wrapper
        - if [[ ${WITH_MPI} == "yes" ]]; then
                export CXX=mpicxx;
                export CC=mpicc;
          fi
        # all cores including hyperthreading
#        - export NUM_CORES=$(grep "core id" /proc/cpuinfo | wc -l)
#       # all pyhsical cores
        - export NUM_CORES=$(grep "core id" /proc/cpuinfo | sort -u | wc -l)
        # ninja does not have -l
#        - export MAKEFLAGS="-l$(echo 1.5*$NUM_CORES | bc) -j$NUM_CORES"
        - export NINJAFLAGS="-j$NUM_CORES"
        - export CTEST_OUTPUT_ON_FAILURE=1
        - mkdir -p "./builddir/$CI_JOB_NAME"
        - pushd "./builddir/$CI_JOB_NAME"
        - cmake ../..
                -G Ninja
                -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
                -DCMAKE_INSTALL_PREFIX=$(pwd)/${BUILD_TYPE}_install_prefix
                -DWITH_OPENMP=${WITH_OPENMP}
@@ -39,10 +56,16 @@ stages:
                -DWITH_MIC=${WITH_MIC}
                -DWITH_TESTS=${WITH_TESTS}
                -DWITH_COVERAGE=${WITH_COVERAGE}
                -DWITH_BENCHMARKS=${WITH_BENCHMARKS}
                -DWITH_EXAMPLES=${WITH_EXAMPLES}
        - make
        - make test CTEST_OUTPUT_ON_FAILURE=1
        - make install
                -DWITH_TOOLS=${WITH_TOOLS}
                -DWITH_PYTHON=${WITH_PYTHON}
#        - make
#        - make test
#        - make install
        - ninja ${NINJAFLAGS}
        - ninja test
        - ninja install
        - popd
    variables:
        <<: *default_cmake_flags
@@ -51,7 +74,7 @@ stages:
# Cuda builds are specified first because they take more time than host-only builds,
# which can be allocated on hosts whitout GPUs.

cuda_Debug:
cuda_base_Debug:
    <<: *build_template
    tags:
        - gpu
@@ -60,7 +83,7 @@ cuda_Debug:
        WITH_CUDA: "yes"
        BUILD_TYPE: Debug

cuda_Release:
cuda_base_Release:
    <<: *build_template
    tags:
        - gpu
@@ -69,38 +92,94 @@ cuda_Release:
        WITH_CUDA: "yes"
        BUILD_TYPE: Release

cuda+openmp_Debug:
cuda_mpi_Debug:
    <<: *build_template
    tags:
        - openmp
        - gpu
        - mpi
    variables:
        <<: *default_cmake_flags
        WITH_OPENMP: "yes"
        WITH_CUDA: "yes"
        WITH_MPI: "yes"
        BUILD_TYPE: Debug

cuda+openmp_Release:
cuda_mpi_Release:
    <<: *build_template
    tags:
        - openmp
        - gpu
        - mpi
    variables:
        <<: *default_cmake_flags
        WITH_OPENMP: "yes"
        WITH_CUDA: "yes"
        WITH_MPI: "yes"
        BUILD_TYPE: Release

default_Debug:
cuda_full_Debug:
    <<: *build_template
    tags:
        - openmp
        - gpu
    variables:
        <<: *default_cmake_flags
        WITH_OPENMP: "yes"
        WITH_CUDA: "yes"
        BUILD_TYPE: Debug
        WITH_BENCHMARKS: "yes"
        WITH_EXAMPLES: "yes"
        WITH_TOOLS: "yes"
        WITH_PYTHON: "yes"

default_Release:
cuda_full_Release:
    <<: *build_template
    tags:
        - openmp
        - gpu
    variables:
        <<: *default_cmake_flags
        WITH_OPENMP: "yes"
        WITH_CUDA: "yes"
        BUILD_TYPE: Release
        WITH_BENCHMARKS: "yes"
        WITH_EXAMPLES: "yes"
        WITH_TOOLS: "yes"
        WITH_PYTHON: "yes"

openmp_Debug:
default_base_Debug:
    <<: *build_template

default_base_Release:
    <<: *build_template
    variables:
        <<: *default_cmake_flags
        BUILD_TYPE: Release

default_mpi_Debug:
    <<: *build_template
    tags:
        - openmp
        - mpi
    variables:
        <<: *default_cmake_flags
        WITH_OPENMP: "yes"
        WITH_MPI: "yes"
        BUILD_TYPE: Debug

default_mpi_Release:
    <<: *build_template
    tags:
        - openmp
        - mpi
    variables:
        <<: *default_cmake_flags
        WITH_OPENMP: "yes"
        WITH_MPI: "yes"
        BUILD_TYPE: Release

default_full_Debug:
    <<: *build_template
    tags:
        - openmp
@@ -108,8 +187,12 @@ openmp_Debug:
        <<: *default_cmake_flags
        WITH_OPENMP: "yes"
        BUILD_TYPE: Debug
        WITH_BENCHMARKS: "yes"
        WITH_EXAMPLES: "yes"
        WITH_TOOLS: "yes"
        WITH_PYTHON: "yes"

openmp_Release:
default_full_Release:
    <<: *build_template
    tags:
        - openmp
@@ -117,3 +200,7 @@ openmp_Release:
        <<: *default_cmake_flags
        WITH_OPENMP: "yes"
        BUILD_TYPE: Release
        WITH_BENCHMARKS: "yes"
        WITH_EXAMPLES: "yes"
        WITH_TOOLS: "yes"
        WITH_PYTHON: "yes"
+26 −12
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ option(WITH_TESTS "Build tests" ON)
option(WITH_COVERAGE "Enable code coverage reports from unit tests" OFF)
option(WITH_EXAMPLES "Compile the 'examples' directory" ON)
option(WITH_TOOLS "Compile the 'src/Tools' directory" ON)
option(WITH_BENCHMARKS "Compile the 'src/Benchmarks' directory" ON)
option(WITH_PYTHON "Compile the Python bindings" ON)
option(WITH_TEMPLATES_INSTANTIATION "Enable explicit template instantiation" OFF)

@@ -62,6 +63,20 @@ else()
    set( EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/Release/bin )
endif()

# check if the compiler is good enough
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
   # GCC 5.0 is the first release with full C++11 support (due to libstdc++)
   # https://gcc.gnu.org/gcc-5/changes.html
   if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0")
      message(FATAL_ERROR "Insufficient GCC version")
   endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
   # Clang 3.4 has full C++14 support: http://clang.llvm.org/cxx_status.html
   if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.4")
      message(FATAL_ERROR "Insufficient Clang version")
   endif()
endif()

# set Debug/Release options
set( CMAKE_CXX_FLAGS "-std=c++11 -pthread -Wall -Wno-unused-local-typedefs -Wno-unused-variable" )
set( CMAKE_CXX_FLAGS_DEBUG "-g -rdynamic -ftemplate-backtrace-limit=0" )
@@ -97,8 +112,8 @@ if( CXX_COMPILER_NAME MATCHES "icpc" )
endif()

# force colorized output in continuous integration
if( DEFINED ENV{CI_JOB_NAME} )
   message(STATUS "Continuous integration detected -- forcing compilers to produce colorized output.")
if( DEFINED ENV{CI_JOB_NAME} OR ${CMAKE_GENERATOR} STREQUAL "Ninja" )
   message(STATUS "Continuous integration or Ninja detected -- forcing compilers to produce colorized output.")
   if( CXX_COMPILER_NAME MATCHES "clang" )
      set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics" )
   else()
@@ -109,10 +124,11 @@ endif()
#####
# Check for MPI -- poznej podle vraperu compileru -- da se testovat preklad bez MPI
#
if( ${CXX_COMPILER_NAME} STREQUAL "mpic++" )
if( ${CXX_COMPILER_NAME} STREQUAL "mpicxx" )
   message( "MPI compiler detected."    )
   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_MPI" )
   set( CUDA_HOST_COMPILER "mpic++" )
   set( CUDA_HOST_COMPILER "mpicxx" )
   set( BUILD_MPI ON )
endif()

####
@@ -150,7 +166,7 @@ if( ${WITH_CUDA} )
            endif()
        endif()
        # An extra CUDA_ARCH_HOST_COMPILER variable for compiling tnl-cuda-arch alone,
        # because it SHOULD NOT be compiled using mpic++, which would cause weird
        # because it SHOULD NOT be compiled using mpicxx, which would cause weird
        # RPATH_CHANGE error in cmake.
        # FIXME: find better solution to switch between MPI-enabled and MPI-disabled binaries in cmake
        if( NOT $ENV{CUDA_ARCH_HOST_COMPILER} STREQUAL "" )
@@ -405,15 +421,12 @@ INCLUDE_DIRECTORIES( src )
INCLUDE_DIRECTORIES( ${PROJECT_BUILD_PATH} )
LINK_DIRECTORIES( ${LIBRARY_OUTPUT_PATH} )

#Pokracujeme dalsimi podadresari
# Add all subdirectories
if( ${WITH_TESTS} )
    add_subdirectory( tests )
endif()
add_subdirectory( src )
add_subdirectory( share )
if( WITH_TESTS STREQUAL "yes" )
    add_subdirectory( tests )
endif( WITH_TESTS STREQUAL "yes" )
if( WITH_EXAMPLES STREQUAL "yes" )
   add_subdirectory( examples )
endif( WITH_EXAMPLES STREQUAL "yes" )

set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Template Numerical Library")
set(CPACK_PACKAGE_VENDOR "MMG")
@@ -455,6 +468,7 @@ message( " WITH_TESTS=${WITH_TESTS}" )
message( "   WITH_COVERAGE=${WITH_COVERAGE}" )
message( "   WITH_EXAMPLES=${WITH_EXAMPLES}" )
message( "   WITH_TOOLS=${WITH_TOOLS}" )
message( "   WITH_BENCHMARKS=${WITH_BENCHMARKS}" )
message( "   WITH_PYTHON=${WITH_PYTHON}" )
message( "   WITH_TEMPLATES_INSTANTIATION=${WITH_TEMPLATES_INSTANTIATION}" )
# Print compiler options
+95 −66
Original line number Diff line number Diff line
#!/bin/bash

set -e

TARGET=TNL
PREFIX=${HOME}/.local
INSTALL="no"
@@ -24,6 +26,7 @@ WITH_COVERAGE="no"
WITH_EXAMPLES="yes"
WITH_PYTHON="yes"
WITH_TOOLS="yes"
WITH_BENCHMARKS="yes"

WITH_TEMPLATE_INSTANTIATION="no"
INSTANTIATE_LONG_INT="no"
@@ -45,8 +48,8 @@ do
        --cmake=*                        ) CMAKE="${option#*=}" ;;
        --cmake-only=*                   ) CMAKE_ONLY="${option#*=}" ;;
        --verbose                        ) VERBOSE="VERBOSE=1" ;;
        --offline-build                  ) OFFLINE_BUILD="yes" ;;
        --help                           ) HELP="yes" ;;
        --offline-build                  ) OFFLINE_BUILD="yes" ;;
        --with-clang=*                   ) WITH_CLANG="${option#*=}" ;;
        --with-mpi=*                     ) WITH_MPI="${option#*=}" ;;
        --with-mic=*                     ) WITH_MIC="${option#*=}" ;;
@@ -58,6 +61,7 @@ do
        --with-coverage=*                ) WITH_COVERAGE="${option#*=}" ;;
        --with-examples=*                ) WITH_EXAMPLES="${option#*=}" ;;
        --with-tools=*                   ) WITH_TOOLS="${option#*=}" ;;
        --with-benchmarks=*              ) WITH_BENCHMARKS="${option#*=}" ;;
        --with-python=*                  ) WITH_PYTHON="${option#*=}" ;;
        --with-templates-instantiation=* ) WITH_TEMPLATE_INSTANTIATION="${option#*=}" ;;
        --instantiate-long-int=*         ) INSTANTIATE_LONG_INT="${option#*=}" ;;
@@ -78,15 +82,15 @@ do
    esac
done

if test ${HELP} = "yes";
then
if [[ ${HELP} == "yes" ]]; then
    echo "TNL build options:"
    echo ""
    echo "   --build=Debug/Release                 Build type."
    echo "   --build-jobs=NUM                      Number of processes to be used for the build. It is set to the number of available CPU cores by default."
    echo "   --prefix=PATH                         Prefix for the installation directory. ${HOME}/local by default."
    echo "   --install=yes/no                      Enables the installation of TNL files."
    echo "   --with-mpi=yes/no                     Enables MPI. 'no' by default (Intel Compiler required)."
    echo "   --offline-build=yes/no                Disables online updates during the build. 'no' by default."
    echo "   --with-mpi=yes/no                     Enables MPI. 'yes' by default (OpenMPI required)."
    echo "   --with-mic=yes/no                     Enables MIC (Intel Xeon Phi). 'no' by default (Intel Compiler required)."
    echo "   --with-cuda=yes/no                    Enables CUDA. 'yes' by default (CUDA Toolkit is required)."
    echo "   --with-cuda-arch=all/auto/30/35/...   Chooses CUDA architecture. 'auto' by default."
@@ -106,63 +110,93 @@ then
    exit 1
fi

if test ${WITH_CLANG} = "yes";
then
if [[ ${WITH_CLANG} == "yes" ]]; then
   export CXX=clang++
   export CC=clang
fi

if test ${WITH_MPI} = "yes";
then
    if ! [ -x  "$(command -v mpic++)" ]; then
       echo "Warning:mpic++ is not installed on this system. MPI support is turned off." 
if [[ ${WITH_MPI} == "yes" ]]; then
    # NOTE: OpenMPI provides mpic++, but Intel MPI does not
    if [[ ! -x  "$(command -v mpicxx)" ]]; then
       echo "Warning: mpicxx is not installed on this system. MPI support is turned off."
    else
       export CXX=mpic++
       export CUDA_HOST_COMPILER=mpic++
       # instruct OpenMPI to use the original compiler
       # reference: https://www.open-mpi.org/faq/?category=mpi-apps#override-wrappers-after-v1.0
       # FIXME: this does not work with CUDA_HOST_COMPILER=mpicxx
#       if [ -n "$CXX" ]; then
#          export OMPI_CXX="$CXX"
#       fi
       export CXX=mpicxx
       export CUDA_HOST_COMPILER=mpicxx
    fi
    if ! [ -x  "$(command -v mpicc)" ]; then
    if [[ ! -x  "$(command -v mpicc)" ]]; then
       echo "Warning: mpicc is not installed on this system." 
    else
       # instruct OpenMPI to use the original compiler
       # reference: https://www.open-mpi.org/faq/?category=mpi-apps#override-wrappers-after-v1.0
#       if [ -n "$CC" ]; then
#          export OMPI_CC="$CC"
#       fi
       export CC=mpicc
    fi
fi

if hash ninja 2>/dev/null; then
   generator=Ninja
   make=ninja
   check_file="build.ninja"
else
   generator="Unix Makefiles"
   make=make
   check_file="Makefile"
fi

echo "Configuring ${BUILD} $TARGET ..."

${CMAKE} ${ROOT_DIR} \
         -DCMAKE_BUILD_TYPE=${BUILD} \
         -DCMAKE_INSTALL_PREFIX=${PREFIX} \
         -DOFFLINE_BUILD=${OFFLINE_BUILD} \
         -DWITH_MIC=${WITH_MIC} \
         -DWITH_CUDA=${WITH_CUDA} \
         -DWITH_CUDA_ARCH=${WITH_CUDA_ARCH} \
         -DWITH_OPENMP=${WITH_OPENMP} \
         -DWITH_GMP=${WITH_GMP} \
         -DWITH_TESTS=${WITH_TESTS} \
         -DWITH_COVERAGE=${WITH_COVERAGE} \
         -DWITH_EXAMPLES=${WITH_EXAMPLES} \
         -DWITH_TOOLS=${WITH_TOOLS} \
         -DWITH_PYTHON=${WITH_PYTHON} \
         -DDCMTK_DIR=${DCMTK_DIR} \
         -DWITH_TEMPLATE_INSTANTIATION=${WITH_TEMPLATE_INSTANTIATION} \
         -DINSTANTIATE_FLOAT=${INSTANTIATE_FLOAT} \
         -DINSTANTIATE_DOUBLE=${INSTANTIATE_DOUBLE} \
         -DINSTANTIATE_LONG_DOUBLE=${INSTANTIATE_LONG_DOUBLE} \
         -DINSTANTIATE_INT=${INSTANTIATE_INT} \
         -DINSTANTIATE_LONG_INT=${INSTANTIATE_LONG_INT} \
cmake_command=(
   ${CMAKE} ${ROOT_DIR}
         -G "${generator}"
         -DCMAKE_BUILD_TYPE=${BUILD}
         -DCMAKE_INSTALL_PREFIX=${PREFIX}
         -DOFFLINE_BUILD=${OFFLINE_BUILD}
         -DWITH_MIC=${WITH_MIC}
         -DWITH_CUDA=${WITH_CUDA}
         -DWITH_CUDA_ARCH=${WITH_CUDA_ARCH}
         -DWITH_OPENMP=${WITH_OPENMP}
         -DWITH_GMP=${WITH_GMP}
         -DWITH_TESTS=${WITH_TESTS}
         -DWITH_COVERAGE=${WITH_COVERAGE}
         -DWITH_EXAMPLES=${WITH_EXAMPLES}
         -DWITH_TOOLS=${WITH_TOOLS}
         -DWITH_BENCHMARKS=${WITH_BENCHMARKS}
         -DWITH_PYTHON=${WITH_PYTHON}
         -DDCMTK_DIR=${DCMTK_DIR}
         -DWITH_TEMPLATE_INSTANTIATION=${WITH_TEMPLATE_INSTANTIATION}
         -DINSTANTIATE_FLOAT=${INSTANTIATE_FLOAT}
         -DINSTANTIATE_DOUBLE=${INSTANTIATE_DOUBLE}
         -DINSTANTIATE_LONG_DOUBLE=${INSTANTIATE_LONG_DOUBLE}
         -DINSTANTIATE_INT=${INSTANTIATE_INT}
         -DINSTANTIATE_LONG_INT=${INSTANTIATE_LONG_INT}
         -DOPTIMIZED_VECTOR_HOST_OPERATIONS=${OPTIMIZED_VECTOR_HOST_OPERATIONS}
)

if test $? != 0; then
    echo "Error: cmake exited with error code."
    exit 1
# Skip running cmake if it was already run and the cmake command is the same.
# The build system (e.g. make) will call it automatically if necessary (e.g.
# when some CMakeLists.txt changes).
if [[ -f ".cmake_command" ]]; then
   last_cmake_command=$(cat ".cmake_command" 2>/dev/null)
else
   last_cmake_command=""
fi
if [[ ! -f "$check_file" ]] || [[ "$last_cmake_command" != "${cmake_command[@]}" ]]; then
   echo "Configuring ${BUILD} $TARGET ..."
   "${cmake_command[@]}"
   echo -n "${cmake_command[@]}" > ".cmake_command"
fi

if test ${CMAKE_ONLY} = "yes";
then
if [[ ${CMAKE_ONLY} == "yes" ]]; then
   exit 0
fi

if [[ "$make" == "make" ]]; then
   if [[ -n ${BUILD_JOBS} ]]; then
      # override $MAKEFLAGS from parent environment
      export MAKEFLAGS=-j${BUILD_JOBS}
@@ -171,6 +205,12 @@ elif [[ -z ${MAKEFLAGS} ]]; then
      BUILD_JOBS=$(grep "core id" /proc/cpuinfo | sort -u | wc -l)
      export MAKEFLAGS=-j${BUILD_JOBS}
   fi
else
   if [[ -z ${BUILD_JOBS} ]]; then
      BUILD_JOBS=$(grep "core id" /proc/cpuinfo | sort -u | wc -l)
   fi
   make="$make -j$BUILD_JOBS"
fi

if [[ -n ${BUILD_JOBS} ]]; then
   echo "Building ${BUILD} $TARGET using $BUILD_JOBS processors ..."
@@ -186,19 +226,8 @@ else
   make_target="all"
fi

make ${VERBOSE} $make_target
if test $? != 0; then
    echo "Error: Build process failed."
    exit 1
fi

$make ${VERBOSE} $make_target

if test ${WITH_TESTS} = "yes";
then
    make test CTEST_OUTPUT_ON_FAILURE=1
    if test $? != 0; then
        echo "Error: Some test did not pass successfuly."
    fi
if [[ ${WITH_TESTS} == "yes" ]]; then
   CTEST_OUTPUT_ON_FAILURE=1 $make test
fi

exit 0
+0 −147
Original line number Diff line number Diff line
/***************************************************************************
                          CompressibleConservativeVariables.h  -  description
                             -------------------
    begin                : Feb 12, 2017
    copyright            : (C) 2017 by Tomas Oberhuber
    email                : tomas.oberhuber@fjfi.cvut.cz
 ***************************************************************************/

/* See Copyright Notice in tnl/Copyright */


#pragma once

#include <TNL/Functions/MeshFunction.h>
#include <TNL/Functions/VectorField.h>
#include <TNL/SharedPointer.h>

namespace TNL {

template< typename Mesh >
class CompressibleConservativeVariables
{
   public:
      typedef Mesh MeshType;
      static const int Dimensions = MeshType::getMeshDimension();
      typedef typename MeshType::RealType RealType;
      typedef typename MeshType::DeviceType DeviceType;
      typedef typename MeshType::IndexType IndexType;
      typedef Functions::MeshFunction< Mesh > MeshFunctionType;
      typedef Functions::VectorField< Dimensions, MeshFunctionType > VelocityFieldType;
      typedef SharedPointer< MeshType > MeshPointer;      
      typedef SharedPointer< MeshFunctionType > MeshFunctionPointer;
      typedef SharedPointer< VelocityFieldType > MomentumFieldPointer;
      
      CompressibleConservativeVariables(){};
      
      CompressibleConservativeVariables( const MeshPointer& meshPointer )
      : density( meshPointer ),
        momentum( meshPointer ),
        //pressure( meshPointer ),
        energy( meshPointer ){};
        
      void setMesh( const MeshPointer& meshPointer )
      {
         this->density->setMesh( meshPointer );
         this->momentum->setMesh( meshPointer );
         //this->pressure.setMesh( meshPointer );
         this->energy->setMesh( meshPointer );
      }
      
      template< typename Vector >
      void bind( const MeshPointer& meshPointer,
                 const Vector& data,
                 IndexType offset = 0 )
      {
         IndexType currentOffset( offset );
         this->density->bind( meshPointer, data, currentOffset );
         currentOffset += this->density->getDofs( meshPointer );
         for( IndexType i = 0; i < Dimensions; i++ )
         {
            ( *this->momentum )[ i ]->bind( meshPointer, data, currentOffset );
            currentOffset += ( *this->momentum )[ i ]->getDofs( meshPointer );
         }
         this->energy->bind( meshPointer, data, currentOffset );
      }
      
      IndexType getDofs( const MeshPointer& meshPointer ) const
      {
         return this->density->getDofs( meshPointer ) + 
            this->momentum->getDofs( meshPointer ) +
            this->energy->getDofs( meshPointer );
      }
      
      MeshFunctionPointer& getDensity()
      {
         return this->density;
      }

      const MeshFunctionPointer& getDensity() const
      {
         return this->density;
      }
      
      void setDensity( MeshFunctionPointer& density )
      {
         this->density = density;
      }
      
      MomentumFieldPointer& getMomentum()
      {
         return this->momentum;
      }
      
      const MomentumFieldPointer& getMomentum() const
      {
         return this->momentum;
      }
      
      void setMomentum( MomentumFieldPointer& momentum )
      {
         this->momentum = momentum;
      }
      
      /*MeshFunctionPointer& getPressure()
      {
         return this->pressure;
      }
      
      const MeshFunctionPointer& getPressure() const
      {
         return this->pressure;
      }
      
      void setPressure( MeshFunctionPointer& pressure )
      {
         this->pressure = pressure;
      }*/
      
      MeshFunctionPointer& getEnergy()
      {
         return this->energy;
      }
      
      const MeshFunctionPointer& getEnergy() const
      {
         return this->energy;
      }
      
      void setEnergy( MeshFunctionPointer& energy )
      {
         this->energy = energy;
      }
      
      void getVelocityField( VelocityFieldType& velocityField )
      {
         
      }

   protected:
      
      MeshFunctionPointer density;
      MomentumFieldPointer momentum;
      MeshFunctionPointer energy;
      
};

} // namespace TN
 No newline at end of file
+0 −122

File deleted.

Preview size limit exceeded, changes collapsed.

Loading