Commit 1fa4cefe authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Optimized smart pointers in ExplicitUpdater

parent 78246216
Loading
Loading
Loading
Loading
+12 −26
Original line number Diff line number Diff line
@@ -27,12 +27,6 @@ class ExplicitUpdaterTraverserUserData
{
   public:
      
      /*typedef typename DifferentialOperator::DeviceType DeviceType;
      /*typedef DifferentialOperator DifferentialOperator;
      typedef BoundaryConditions BoundaryConditions;
      typedef RightHandSide RightHandSide;
      typedef MeshFunction MeshFunction;*/

      const DifferentialOperator* differentialOperator;

      const BoundaryConditions* boundaryConditions;
@@ -41,29 +35,21 @@ class ExplicitUpdaterTraverserUserData

      MeshFunction *u, *fu;
      
      Real* _fu;
      
      public:

      const Real time;


      ExplicitUpdaterTraverserUserData( const Real& time,
                                           const DifferentialOperator& differentialOperator,
                                           const BoundaryConditions& boundaryConditions,
                                           const RightHandSide& rightHandSide,
                                           MeshFunction& u,
                                           MeshFunction& fu,
                                           MeshFunction& __fu )
                                        const DifferentialOperator* differentialOperator,
                                        const BoundaryConditions* boundaryConditions,
                                        const RightHandSide* rightHandSide,
                                        MeshFunction* u,
                                        MeshFunction* fu )
      : time( time ),
        differentialOperator( &differentialOperator ),
        boundaryConditions( &boundaryConditions ),
        rightHandSide( &rightHandSide ),
        u( &u ),
        fu( &fu ),
        _fu( &__fu[ 0 ] )
      {
      };
        differentialOperator( differentialOperator ),
        boundaryConditions( boundaryConditions ),
        rightHandSide( rightHandSide ),
        u( u ),
        fu( fu )
      {}
};


+5 −7
Original line number Diff line number Diff line
@@ -45,12 +45,11 @@ update( const RealType& time,
      "Error: I am getting tnlVector instead of MeshFunction or similar object. You might forget to bind DofVector into MeshFunction in you method getExplicitRHS."  );
   {
      TraverserUserData userData( time,
                                  differentialOperatorPointer.template getData< DeviceType >(),
                                  boundaryConditionsPointer.template getData< DeviceType >(),
                                  rightHandSidePointer.template getData< DeviceType >(),
                                  uPointer.template modifyData< DeviceType >(),
                                  fuPointer.template modifyData< DeviceType >(),
                                  fuPointer.template modifyData< Devices::Host >() );
                                  &differentialOperatorPointer.template getData< DeviceType >(),
                                  &boundaryConditionsPointer.template getData< DeviceType >(),
                                  &rightHandSidePointer.template getData< DeviceType >(),
                                  &uPointer.template modifyData< DeviceType >(),
                                  &fuPointer.template modifyData< DeviceType >() );
      Meshes::Traverser< MeshType, EntityType > meshTraverser;
      meshTraverser.template processBoundaryEntities< TraverserUserData,
                                                      TraverserBoundaryEntitiesProcessor >
@@ -60,7 +59,6 @@ update( const RealType& time,
                                                      TraverserInteriorEntitiesProcessor >
                                                    ( meshPointer,
                                                      userData );

   }
}