Commit 41ce55f0 authored by Jan Schäfer's avatar Jan Schäfer
Browse files

vyresen smoothheaviside

parent 3d6cd925
Loading
Loading
Loading
Loading
+61 −60

File changed.

Preview size limit exceeded, changes collapsed.

+2 −1
Original line number Diff line number Diff line
@@ -162,11 +162,12 @@ makeSnapshot( const RealType& time,
{
   std::cout << std::endl << "Writing output at time " << time << " step " << step << "." << std::endl;
   this->bindDofs( mesh, dofs );
   MeshFunctionType printDofs( mesh, dofs );
   FileName fileName;
   fileName.setFileNameBase( "u-" );
   fileName.setExtension( "tnl" );
   fileName.setIndex( step );
   if( ! dofs->save( fileName.getFileName() ) )
   if( ! printDofs.save( fileName.getFileName() ) )
      return false;
   return true;
}
+1 −1
Original line number Diff line number Diff line
@@ -325,7 +325,7 @@ setValue( const EntityType& meshEntity,
          const RealType& value )
{
   static_assert( EntityType::getEntityDimension() == MeshEntityDimension, "Calling with wrong EntityType -- entity dimensions do not match." );
   this->data.setValue( meshEntity.getIndex(), value );
   this->data.setElement( meshEntity.getIndex(), value );
}

template< typename Mesh,
+17 −1
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ configSetup( Config::ConfigDescription& config,
      config.addEntryEnum( "sin-wave-sdf" );
      config.addEntryEnum( "sin-bumps-sdf" );
      config.addEntryEnum( "heaviside-of-vector-norm" );
      config.addEntryEnum( "smooth-heaviside-of-vector-norm" );

   config.addEntry     < double >( prefix + "constant", "Value of the constant function.", 0.0 );
   config.addEntry     < double >( prefix + "wave-length", "Wave length of the sine based test functions.", 1.0 );
@@ -100,6 +101,7 @@ configSetup( Config::ConfigDescription& config,
   config.addEntry     < double >( prefix + "height", "Height of zero-level-set function for the blob, pseudosquare test functions.", 1.0 );
   Analytic::VectorNorm< 3, double >::configSetup( config, "vector-norm-" );
   TNL::Operators::Analytic::Heaviside< 3, double >::configSetup( config, "heaviside-" );
   TNL::Operators::Analytic::SmoothHeaviside< 3, double >::configSetup( config, "smooth-heaviside-" );
   config.addEntry     < String >( prefix + "time-dependence", "Time dependence of the test function.", "none" );
      config.addEntryEnum( "none" );
      config.addEntryEnum( "linear" );
@@ -336,7 +338,7 @@ setup( const Config::ParameterContainer& parameters,
   if( testFunction == "smooth-heaviside-of-vector-norm" )
   {
      typedef VectorNorm< Dimension, Real > FunctionType;
      typedef SmoothHeaviside< FunctionType > OperatorType;
      typedef SmoothHeaviside< Dimension, Real > OperatorType;
      functionType = vectorNorm;
      operatorType = smoothHeaviside;
      return ( setupFunction< FunctionType >( parameters, prefix + "vector-norm-" ) && 
@@ -464,6 +466,13 @@ getPartialDerivative( const PointType& vertex,
         {
            typedef Heaviside< Dimension, Real > OperatorType;

            return scale * ( ( OperatorType* ) this->operator_ )->
                      template getPartialDerivative< FunctionType, XDiffOrder, YDiffOrder, ZDiffOrder >( * ( FunctionType*) this->function, vertex, time );
         }
         if( operatorType == smoothHeaviside )
         {
            typedef SmoothHeaviside< Dimension, Real > OperatorType;

            return scale * ( ( OperatorType* ) this->operator_ )->
                      template getPartialDerivative< FunctionType, XDiffOrder, YDiffOrder, ZDiffOrder >( * ( FunctionType*) this->function, vertex, time );
         }
@@ -546,6 +555,13 @@ getPartialDerivative( const PointType& vertex,
         {
            typedef Heaviside< Dimension, Real > OperatorType;

            return scale * ( ( OperatorType* ) this->operator_ )->
                      template getPartialDerivative< FunctionType, XDiffOrder, YDiffOrder, ZDiffOrder >( * ( FunctionType*) this->function, vertex, time );
         }
         if( operatorType == smoothHeaviside )
         {
            typedef SmoothHeaviside< Dimension, Real > OperatorType;

            return scale * ( ( OperatorType* ) this->operator_ )->
                      template getPartialDerivative< FunctionType, XDiffOrder, YDiffOrder, ZDiffOrder >( * ( FunctionType*) this->function, vertex, time );
         }
+10 −1
Original line number Diff line number Diff line
@@ -186,7 +186,16 @@ class VectorField< Size, MeshFunction< Mesh, MeshEntityDimension, Real > >
            v[ i ] = ( *this->vectorField[ i ] )[ index ];
         return v;
      }

/*
      template< typename EntityType >
      void setValue( const EntityType& meshEntity,
                     const PointType& value )
      {
         static_assert( ( EntityType::getEntityDimension() == MeshEntityDimension ) && ( PointType::getSize() == Size ), "Calling with wrong EntityType -- entity dimensions do not match." );
         for(int i = 0; i < Size; i++ )
            this->vectorfield[ i ].setValue( meshEntity.getIndex(), value[ i ] );
      }
*/
      template< typename EntityType >
      __cuda_callable__
      VectorType getVector( const EntityType& meshEntity ) const
Loading