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

Debuging the shared pointers.

parent 473f36d6
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -53,10 +53,12 @@ class tnlHeatEquationProblem : public tnlPDEProblem< Mesh,
      typedef tnlSharedPointer< DifferentialOperator > DifferentialOperatorPointer;
      typedef tnlSharedPointer< BoundaryCondition > BoundaryConditionPointer;
      typedef tnlSharedPointer< RightHandSide, DeviceType > RightHandSidePointer;
      typedef tnlSharedPointer< MatrixType, DeviceType > MatrixPointer;

      using typename BaseType::MeshType;
      using typename BaseType::MeshPointer;
      using typename BaseType::DofVectorType;
      using typename BaseType::DofVectorPointer;
      using typename BaseType::MeshDependentDataType;

      static tnlString getTypeStatic();
@@ -78,7 +80,7 @@ class tnlHeatEquationProblem : public tnlPDEProblem< Mesh,

      template< typename Matrix >
      bool setupLinearSystem( const MeshPointer& meshPointer,
                              Matrix& matrix );
                              MatrixPointer& matrixPointer );

      bool makeSnapshot( const RealType& time,
                         const IndexType& step,
@@ -102,9 +104,9 @@ class tnlHeatEquationProblem : public tnlPDEProblem< Mesh,
      void assemblyLinearSystem( const RealType& time,
                                 const RealType& tau,
                                 const MeshPointer& meshPointer,
                                 const DofVectorType& dofs,                                 
                                 Matrix& matrix,
                                 DofVectorType& rightHandSide,
                                 const DofVectorPointer& dofsPointer,
                                 MatrixPointer& matrixPointer,
                                 DofVectorPointer& rightHandSidePointer,
                                 MeshDependentDataType& meshDependentData );


+4 −4
Original line number Diff line number Diff line
@@ -255,9 +255,9 @@ tnlHeatEquationProblem< Mesh, BoundaryCondition, RightHandSide, DifferentialOper
assemblyLinearSystem( const RealType& time,
                      const RealType& tau,
                      const MeshPointer& meshPointer,
                      const DofVectorType& dofs,                      
                      const DofVectorPointer& dofsPointer,
                      MatrixPointer& matrixPointer,
                      DofVectorType& b,
                      DofVectorPointer& bPointer,
                      MeshDependentDataType& meshDependentData )
{
   this->bindDofs( meshPointer, dofs );
@@ -278,7 +278,7 @@ assemblyLinearSystem( const RealType& time,
      this->rightHandSidePointer,
      this->uPointer,
      matrixPointer,
      b );
      bPointer );
   /*matrix.print( cout );
   cout << endl << b << endl;
   cout << endl << u << endl;
+3 −1
Original line number Diff line number Diff line
@@ -36,9 +36,11 @@ class tnlPDEProblem : public tnlProblem< Real, Device, Index >
      using typename BaseType::IndexType;

      typedef Mesh MeshType;
      typedef tnlSharedPointer< MeshType, Device > MeshPointer;
      typedef tnlSharedPointer< MeshType, DeviceType > MeshPointer;
      typedef tnlVector< RealType, DeviceType, IndexType> DofVectorType;
      typedef tnlSharedPointer< DofVectorType, DeviceType > DofVectorPointer;
      typedef tnlCSRMatrix< RealType, DeviceType, IndexType > MatrixType;
      typedef tnlSharedPointer< MatrixType, DeviceType > MatrixPointer;
      typedef tnlVector< RealType, DeviceType, IndexType > MeshDependentDataType;

      /****
+14 −10
Original line number Diff line number Diff line
@@ -36,7 +36,8 @@ class tnlLinearSystemAssemblerTraverserUserData
      typedef tnlSharedPointer< DifferentialOperator, DeviceType > DifferentialOperatorPointer;
      typedef tnlSharedPointer< BoundaryConditions, DeviceType > BoundaryConditionsPointer;
      typedef tnlSharedPointer< RightHandSide, DeviceType > RightHandSidePointer;

      typedef tnlSharedPointer< MeshFunction, DeviceType > MeshFunctionPointer;
      typedef tnlSharedPointer< DofVector, DeviceType > DofVectorPointer;

      const Real* time;

@@ -50,9 +51,9 @@ class tnlLinearSystemAssemblerTraverserUserData

      const RightHandSidePointer rightHandSidePointer;
      
      const MeshFunction *u;
      const MeshFunctionPointer uPointer;
      
      DofVector *b;
      DofVectorPointer bPointer;

      MatrixPointer matrixPointer;

@@ -61,16 +62,16 @@ class tnlLinearSystemAssemblerTraverserUserData
                                                 const DifferentialOperatorPointer& differentialOperatorPointer,
                                                 const BoundaryConditionsPointer& boundaryConditionsPointer,
                                                 const RightHandSidePointer& rightHandSidePointer,
                                                 const MeshFunction& u,
                                                 const MeshFunctionPointer& uPointer,
                                                 MatrixPointer& matrixPointer,
                                                 DofVector& b )
                                                 DofVectorPointer& bPointer )
      : time( &time ),
        tau( &tau ),
        differentialOperatorPointer( differentialOperatorPointer ),
        boundaryConditionsPointer( boundaryConditionsPointer ),
        rightHandSidePointer( rightHandSidePointer ),
        u( &u ),
        b( &b ),
        uPointer( uPointer ),
        bPointer( bPointer ),
        matrixPointer( matrixPointer )
      {};

@@ -108,6 +109,9 @@ class tnlLinearSystemAssembler
   typedef tnlSharedPointer< DifferentialOperator, DeviceType > DifferentialOperatorPointer;
   typedef tnlSharedPointer< BoundaryConditions, DeviceType > BoundaryConditionsPointer;
   typedef tnlSharedPointer< RightHandSide, DeviceType > RightHandSidePointer;
   typedef tnlSharedPointer< MeshFunction, DeviceType > MeshFunctionPointer;
   typedef tnlSharedPointer< DofVector, DeviceType > DofVectorPointer;
   
      
   template< typename EntityType >
   void assembly( const RealType& time,
@@ -116,9 +120,9 @@ class tnlLinearSystemAssembler
                  const DifferentialOperatorPointer& differentialOperatorPointer,
                  const BoundaryConditionsPointer& boundaryConditionsPointer,
                  const RightHandSidePointer& rightHandSidePointer,
                  const MeshFunction& u,
                  const MeshFunctionPointer& uPointer,
                  MatrixPointer& matrixPointer,
                  DofVector& b ) const;
                  DofVectorPointer& bPointer ) const;

   
      class TraverserBoundaryEntitiesProcessor
+4 −4
Original line number Diff line number Diff line
@@ -40,9 +40,9 @@ assembly( const RealType& time,
          const DifferentialOperatorPointer& differentialOperatorPointer,
          const BoundaryConditionsPointer& boundaryConditionsPointer,
          const RightHandSidePointer& rightHandSidePointer,
          const MeshFunction& u,
          const MeshFunctionPointer& uPointer,
          MatrixPointer& matrixPointer,
          DofVector& b ) const
          DofVectorPointer& bPointer ) const
{
      static_assert( std::is_same< MeshFunction, 
                                tnlVector< typename MeshFunction::RealType,
@@ -60,9 +60,9 @@ assembly( const RealType& time,
                                  differentialOperatorPointer,
                                  boundaryConditionsPointer,
                                  rightHandSidePointer,
                                  u,
                                  uPointer,
                                  matrixPointer,
                                  b );
                                  bPointer );
      tnlTraverser< MeshType, EntityType > meshTraverser;
      meshTraverser.template processBoundaryEntities< TraverserUserData,
                                                      TraverserBoundaryEntitiesProcessor >
Loading