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

Merge remote-tracking branch 'origin/mean-curvature' into revisions

Conflicts:
	src/functions/CMakeLists.txt
	src/functions/tnlTestFunction_impl.h
	src/problems/tnlHeatEquationProblem.h
	src/problems/tnlHeatEquationProblem_impl.h
parents 735da4f5 4ceb2249
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
add_subdirectory( heat-equation )
add_subdirectory( navier-stokes )
add_subdirectory( mean-curvature-flow )
+29 −0
Original line number Diff line number Diff line
set( tnl_mean_curvature_flow_SOURCES     
     tnl-mean-curvature-flow.cpp
     tnl-mean-curvature-flow-eoc.cpp
     tnl-mean-curvature-flow.cu
     tnl-mean-curvature-flow-eoc.cu )
               
IF( BUILD_CUDA )
   CUDA_ADD_EXECUTABLE(tnl-mean-curvature-flow${debugExt} tnl-mean-curvature-flow.cu)
   CUDA_ADD_EXECUTABLE(tnl-mean-curvature-flow-eoc-test${debugExt} tnl-mean-curvature-flow-eoc.cu)
   target_link_libraries (tnl-mean-curvature-flow${debugExt} tnl${debugExt}-${tnlVersion}  ${CUSPARSE_LIBRARY} )
   target_link_libraries (tnl-mean-curvature-flow-eoc-test${debugExt} tnl${debugExt}-${tnlVersion}  ${CUSPARSE_LIBRARY} )
ELSE(  BUILD_CUDA )               
   ADD_EXECUTABLE(tnl-mean-curvature-flow${debugExt} tnl-mean-curvature-flow.cpp)     
   ADD_EXECUTABLE(tnl-mean-curvature-flow-eoc-test${debugExt} tnl-mean-curvature-flow-eoc.cpp)   
   target_link_libraries (tnl-mean-curvature-flow${debugExt} tnl${debugExt}-${tnlVersion} )
   target_link_libraries (tnl-mean-curvature-flow-eoc-test${debugExt} tnl${debugExt}-${tnlVersion} )
ENDIF( BUILD_CUDA )

INSTALL( TARGETS tnl-mean-curvature-flow${debugExt}
                 tnl-mean-curvature-flow-eoc-test${debugExt}
         RUNTIME DESTINATION bin
         PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE )
        
INSTALL( FILES tnl-run-mean-curvature-flow-eoc-test
               tnl-run-mean-curvature-flow
               tnl-run-mean-curvature-flow-contour-video
               tnl-run-mean-curvature-flow-videos
               ${tnl_mean_curvature_flow_SOURCES}
         DESTINATION share/tnl-${tnlVersion}/examples/mean-curvature-flow )
 No newline at end of file
+36 −0
Original line number Diff line number Diff line
TNL_VERSION=0.1
TNL_INSTALL_DIR=${HOME}/local/lib
TNL_INCLUDE_DIR=${HOME}/local/include/tnl-${TNL_VERSION}

TARGET = mean-curvature-flow-eoc
INSTALL_DIR = ${HOME}/local
CXX = g++
CUDA_CXX = nvcc
CXX_FLAGS = -std=gnu++0x -I$(TNL_INCLUDE_DIR)   -O0 -g
LD_FLAGS = -L$(TNL_INSTALL_DIR) -ltnl-dbg-0.1

SOURCES = tnl-mean-curvature-flow-eoc.cpp
HEADERS = 
OBJECTS = tnl-mean-curvature-flow-eoc.o
DIST = $(SOURCES) Makefile

all: $(TARGET)
clean: 
	rm -f $(OBJECTS)	

dist: $(DIST)
	tar zcvf $(TARGET).tgz $(DIST) 

install: $(TARGET)
	cp $(TARGET) $(INSTALL_DIR)/bin
	cp $(INSTALL_DIR)/share/tnl-0.1/examples/mean-curvature-flow

uninstall: $(TARGET)
	rm -f $(INSTALL_DIR)/bin/$(TARGET) 
	rm -f $(INSTALL_DIR)/share/tnl-0.1/examples/mean-curvature-flow

$(TARGET): $(OBJECTS)
	$(CXX) -o $(TARGET) $(OBJECTS) $(LD_FLAGS)

%.o: %.cpp $(HEADERS)
	$(CXX) -c -o $@ $(CXX_FLAGS) $<
+20 −0
Original line number Diff line number Diff line
/***************************************************************************
                          tnl-heat-equation-eoc.cpp  -  description
                             -------------------
    begin                : Sep 7, 2014
    copyright            : (C) 2014 by oberhuber
    email                : tomas.oberhuber@fjfi.cvut.cz
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include "tnl-mean-curvature-flow-eoc.h"

+95 −0
Original line number Diff line number Diff line
/***************************************************************************
                          tnl-heat-equation-eoc.h  -  description
                             -------------------
    begin                : Nov 29, 2014
    copyright            : (C) 2014 by oberhuber
    email                : tomas.oberhuber@fjfi.cvut.cz
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef TNL_MEAN_CURVATURE_FLOW_EOC_H_
#define TNL_MEAN_CURVATURE_FLOW_EOC_H_

#include <solvers/tnlSolver.h>
#include <solvers/tnlFastBuildConfigTag.h>
#include <solvers/tnlBuildConfigTags.h>
#include <functions/tnlTestFunction.h>
#include <operators/tnlAnalyticDirichletBoundaryConditions.h>
#include <operators/tnlAnalyticNeumannBoundaryConditions.h>
#include <problems/tnlMeanCurvatureFlowEocRhs.h>
#include <problems/tnlMeanCurvatureFlowEocProblem.h>
#include <operators/diffusion/tnlExactNonlinearDiffusion.h>
#include <operators/diffusion/tnlNonlinearDiffusion.h>
#include <operators/operator-Q/tnlOneSideDiffOperatorQ.h>
#include <operators/operator-Q/tnlFiniteVolumeOperatorQ.h>
#include <operators/diffusion/tnlExactNonlinearDiffusion.h>
#include <operators/diffusion/nonlinear-diffusion-operators/tnlOneSideDiffNonlinearOperator.h>
#include <operators/diffusion/nonlinear-diffusion-operators/tnlFiniteVolumeNonlinearOperator.h>
#include <operators/operator-Q/tnlExactOperatorQ.h>

//typedef tnlDefaultConfigTag BuildConfig;
typedef tnlFastBuildConfig BuildConfig;

template< typename ConfigTag >
class meanCurvatureFlowEocConfig
{
   public:
      static void configSetup( tnlConfigDescription& config )
      {
         config.addDelimiter( "Mean Curvature Flow EOC settings:" );
         config.addEntry< double >( "eps", "This sets a eps in operator Q.", 1.0 );
         config.addDelimiter( "Tests setting::" );
         tnlTestFunction< 3, double >::configSetup( config );
      }
};

template< typename Real,
          typename Device,
          typename Index,
          typename MeshType,
          typename ConfigTag,
          typename SolverStarter >
class meanCurvatureFlowEocSetter
{
   public:

   typedef Real RealType;
   typedef Device DeviceType;
   typedef Index IndexType;

   typedef tnlStaticVector< MeshType::Dimensions, Real > Vertex;

   static bool run( const tnlParameterContainer& parameters )
   {
      enum { Dimensions = MeshType::Dimensions };
      typedef tnlFiniteVolumeOperatorQ<MeshType, Real, Index, 0> OperatorQ;
      typedef tnlFiniteVolumeNonlinearOperator<MeshType, OperatorQ, Real, Index > NonlinearOperator;
      typedef tnlNonlinearDiffusion< MeshType, NonlinearOperator, Real, Index > ApproximateOperator;
      typedef tnlExactNonlinearDiffusion< tnlExactOperatorQ<Dimensions>, Dimensions > ExactOperator;
      typedef tnlTestFunction< MeshType::Dimensions, Real, Device > TestFunction;
      typedef tnlMeanCurvatureFlowEocRhs< ExactOperator, TestFunction > RightHandSide;
      typedef tnlStaticVector < MeshType::Dimensions, Real > Vertex;
      typedef tnlAnalyticDirichletBoundaryConditions< MeshType, TestFunction, Real, Index > BoundaryConditions;
      typedef tnlMeanCurvatureFlowEocProblem< MeshType, BoundaryConditions, RightHandSide, ApproximateOperator > Solver;
      SolverStarter solverStarter;
      return solverStarter.template run< Solver >( parameters );
   };
};

int main( int argc, char* argv[] )
{
   tnlSolver< meanCurvatureFlowEocSetter, meanCurvatureFlowEocConfig, BuildConfig > solver;
   if( ! solver. run( argc, argv ) )
      return EXIT_FAILURE;
   return EXIT_SUCCESS;
}

#endif /* TNL_MEAN_CURVATURE_FLOW_EOC_H_ */
Loading