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

Implementing the Neumann boundary conditions.

Fixing the solvers.
parent e9f6c89c
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
TODO: doladit heat eq. eoc test
TODO: opravit argumenty metod v heat equation - nekde se nepredavaji dofy a pomocne dofy
TODO: neumanovy okrajove podminky
TODO: doladit iterativni resice 
      * nepocitaji se iterace
      * iterovat podle metody nextIteration
@@ -22,7 +19,5 @@ TODO: metodu pro tnlString pro nahrazeni napr. podretezce XXXXX indexem 00001 tj

TODO: vyjimky 

TODO: implementovat maticovy format COO - mimo jine by se dal vyuzit k rychlejsimu parsovani mtx souboru

TODO: prubezne ukladani vysledku behem vypoctu 
                 
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
set( tnl_heat_equation_SOURCES
     tnlHeatEquationEocRhs.h
     tnlRightHandSide_impl.h
     tnlRightHandSide.h
     tnl-heat-equation.cpp
     tnl-heat-equation-eoc.cpp
     heatEquationSolver_impl.h
     heatEquationSolver.h
     heatEquationEocSolver.h
     heatEquationEocSolver_impl.h
     tnlHeatEquationEocRhs.h )
               
ADD_EXECUTABLE(tnl-heat-equation${debugExt} tnl-heat-equation.cpp)
+39 −0
Original line number Diff line number Diff line
/***************************************************************************
                          heatEquationEocSolver.h  -  description
                             -------------------
    begin                : Nov 22, 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 HEATEQUATIONEOCSOLVER_H_
#define HEATEQUATIONEOCSOLVER_H_

#include "heatEquationSolver.h"


template< typename Mesh,
          typename DifferentialOperator,
          typename BoundaryCondition,
          typename RightHandSide >
class heatEquationEocSolver : public heatEquationSolver< Mesh, DifferentialOperator, BoundaryCondition, RightHandSide >
{
   public:

      static tnlString getTypeStatic();

      bool setup( const tnlParameterContainer& parameters );
};

#include "heatEquationEocSolver_impl.h"

#endif /* HEATEQUATIONEOCSOLVER_H_ */
+46 −0
Original line number Diff line number Diff line
/***************************************************************************
                          heatEquationEocSolver_impl.h  -  description
                             -------------------
    begin                : Nov 22, 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 HEATEQUATIONEOCSOLVER_IMPL_H_
#define HEATEQUATIONEOCSOLVER_IMPL_H_

template< typename Mesh,
          typename DifferentialOperator,
          typename BoundaryCondition,
          typename RightHandSide >
tnlString
heatEquationEocSolver< Mesh, DifferentialOperator, BoundaryCondition, RightHandSide >::
getTypeStatic()
{
   return tnlString( "heatEquationEocSolver< " ) + Mesh :: getTypeStatic() + " >";
}

template< typename Mesh,
          typename DifferentialOperator,
          typename BoundaryCondition,
          typename RightHandSide >
bool
heatEquationEocSolver< Mesh, DifferentialOperator, BoundaryCondition, RightHandSide >::
setup( const tnlParameterContainer& parameters )
{
   if( ! this->boundaryCondition.setup( parameters ) ||
       ! this->rightHandSide.setup( parameters ) )
      return false;
   return true;
}

#endif /* HEATEQUATIONEOCSOLVER_IMPL_H_ */
+11 −5
Original line number Diff line number Diff line
@@ -57,14 +57,17 @@ class heatEquationSolver

   bool setInitialCondition( const tnlParameterContainer& parameters,
                             const MeshType& mesh,
                             DofVectorType& dofs );
                             DofVectorType& dofs,
                             DofVectorType& auxDofs );

   bool setupLinearSystem( const MeshType& mesh,
                           MatrixType& matrix );

   bool makeSnapshot( const RealType& time,
                      const IndexType& step,
                      const MeshType& mesh );
                      const MeshType& mesh,
                      const DofVectorType& dofs,
                      DofVectorType& auxDofs );

   IndexType getDofs( const MeshType& mesh ) const;

@@ -79,7 +82,8 @@ class heatEquationSolver
   bool preIterate( const RealType& time,
                    const RealType& tau,
                    const MeshType& mesh,
                    DofVectorType& u );
                    DofVectorType& dofs,
                    DofVectorType& auxDofs );

   void getExplicitRHS( const RealType& time,
                        const RealType& tau,
@@ -91,14 +95,16 @@ class heatEquationSolver
   void assemblyLinearSystem( const RealType& time,
                              const RealType& tau,
                              const MeshType& mesh,
                              DofVectorType& u,
                              DofVectorType& dofs,
                              DofVectorType& auxDofs,
                              MatrixType& matrix,
                              DofVectorType& rightHandSide );

   bool postIterate( const RealType& time,
                     const RealType& tau,
                     const MeshType& mesh,
                     DofVectorType& u );
                     DofVectorType& dofs,
                     DofVectorType& auxDofs );


   tnlSolverMonitor< RealType, IndexType >* getSolverMonitor();
Loading