Commit c3441a5e authored by Ondřej Székely's avatar Ondřej Székely
Browse files

MEAN CURVATURE FLOW IMPLEMENTATION

parent 024fd3b2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2,3 +2,4 @@ add_subdirectory( make-project )
add_subdirectory( simple-solver )
add_subdirectory( heat-equation )
add_subdirectory( navier-stokes )
add_subdirectory( mean-curvature-flow )
+23 −0
Original line number Diff line number Diff line
INSTALL( FILES tnlBackwardFiniteDifference.h
					tnlBackwardFiniteDifference_impl.h
					tnlExactFlowDiffusion.h
					tnlExactFlowDiffusion_impl.h
					tnlForwardFiniteDifference.h
					tnlForwardFiniteDifference_impl.h
					tnl-mean-curvature-flow.cpp
					tnl-mean-curvature-flow.h
					tnlMeanCurvatureFlowDiffusion.h
					tnlMeanCurvatureFlowDiffusion_impl.h
					tnl-mean-curvature-flow-eoc.cpp
					tnl-mean-curvature-flow-eoc.h
					tnlMeanCurvatureFlowEocProblem.h
					tnlMeanCurvatureFlowEocProblem_impl.h
					tnlMeanCurvatureFlowEocRhs.h
					tnlMeanCurvatureFlowEocRhs_impl.h
					tnlMeanCurvatureFlowProblem.h
					tnlMeanCurvatureFlowProblem_impl.h
					tnlOperatorQ.h
					tnlOperatorQ_impl.h
					tnl-run-mean-curvature-flow
					tnl-run-mean-curvature-flow-eoc-test
         DESTINATION share/tnl-${tnlVersion}/examples/mean-curvature-flow )
+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)  -g -O0
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-eoc

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

$(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"

+86 −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/tnlFastBuildConfig.h>
#include <solvers/tnlConfigTags.h>
#include <functions/tnlTestFunction.h>
#include <operators/tnlAnalyticDirichletBoundaryConditions.h>
#include <operators/tnlAnalyticNeumannBoundaryConditions.h>
#include "tnlMeanCurvatureFlowEocRhs.h"
#include "tnlMeanCurvatureFlowEocProblem.h"
#include "tnlExactFlowDiffusion.h"
#include "tnlMeanCurvatureFlowDiffusion.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.addDelimiter( "Tests setting::" );
         tnlTestFunction< 2, 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 tnlMeanCurvatureFlowDiffusion< MeshType, Real, Index > ApproximateOperator;
      typedef tnlExactFlowDiffusion< Dimensions > ExactOperator;
      typedef tnlTestFunction< MeshType::Dimensions, Real, Device > TestFunction;
      typedef tnlMeanCurvatureFlowEocRhs< ExactOperator, TestFunction > RightHandSide;
      typedef tnlStaticVector < MeshType::Dimensions, Real > Vertex;
      typedef tnlAnalyticNeumannBoundaryConditions< 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