text: // Filename: UFunction.h
  // Created on 19 Mar 2004 by Boyce Griffith
  //
  // Copyright (c) 2002-2013, Boyce Griffith
  // All rights reserved.
  //
  // Redistribution and use in source and binary forms, with or without
  // modification, are permitted provided that the following conditions are met:
  //
  //    * Redistributions of source code must retain the above copyright notice,
  //      this list of conditions and the following disclaimer.
  //
  //    * Redistributions in binary form must reproduce the above copyright
  //      notice, this list of conditions and the following disclaimer in the
  //      documentation and/or other materials provided with the distribution.
  //
  //    * Neither the name of New York University nor the names of its
  //      contributors may be used to endorse or promote products derived from
  //      this software without specific prior written permission.
  //
  // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
  // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  // POSSIBILITY OF SUCH DAMAGE.
  
  #ifndef included_UFunction
  #define included_UFunction
  
  /////////////////////////////// INCLUDES /////////////////////////////////////
  
  // IBTK INCLUDES
  #include <ibtk/CartGridFunction.h>
  
  // SAMRAI INCLUDES
  #include <CartesianGridGeometry.h>
  
  // BLITZ++ INCLUDES
  #include <blitz/tinyvec2.h>
  
  // C++ namespace delcarations
  #include <ibamr/app_namespaces.h>
  
  /////////////////////////////// CLASS DEFINITION /////////////////////////////
  
  /*!
   * \brief Class to initialize the value of the advection velocity u.
   */
  class UFunction
      : public CartGridFunction
  {
  public:
      /*!
       * \brief Constructor.
       */
      UFunction(
          const string& object_name,
          Pointer<GridGeometry<NDIM> > grid_geom,
          Pointer<Database> input_db);
  
      /*!
       * \brief Destructor.
       */
      ~UFunction();
  
      /*!
       * Indicates whether the concrete CartGridFunction object is time
       * dependent.
       */
      bool
      isTimeDependent() const
          { return true; }
  
      /*!
       * Set the data on the patch interior to some values.
       */
      void
      setDataOnPatch(
          int data_idx,
          Pointer<Variable<NDIM> > var,
          Pointer<Patch<NDIM> > patch,
          double data_time,
          bool initial_time=false,
          Pointer<PatchLevel<NDIM> > level=Pointer<PatchLevel<NDIM> >(NULL));
  
  protected:
  
  private:
      /*!
       * \brief Default constructor.
       *
       * \note This constructor is not implemented and should not be used.
       */
      UFunction();
  
      /*!
       * \brief Copy constructor.
       *
       * \note This constructor is not implemented and should not be used.
       *
       * \param from The value to copy to this object.
       */
      UFunction(
          const UFunction& from);
  
      /*!
       * \brief Assignment operator.
       *
       * \note This operator is not implemented and should not be used.
       *
       * \param that The value to assign to this object.
       *
       * \return A reference to this object.
       */
      UFunction&
      operator=(
          const UFunction& that);
  
      /*!
       * Read input values, indicated above, from given database.
       */
      void
      getFromInput(
          Pointer<Database> db);
  
      /*
       * The object name is used as a handle to databases stored in restart files
       * and for error reporting purposes.
       */
      string d_object_name;
  
      /*
       * The grid geometry.
       */
      Pointer<CartesianGridGeometry<NDIM> > d_grid_geom;
  
      /*
       * The center of the initial data.
       */
      TinyVector<double,NDIM> d_X;
  
      /*
       * The initialization type.
       */
      string d_init_type;
  
      /*
       * The amplification and frequency of the sin wave used in setting
       * velocities.
       */
      TinyVector<double,NDIM> d_kappa, d_omega;
  
      /*
       * Parameters for uniform constant velocity.
       */
      TinyVector<double,NDIM> d_uniform_u;
  };
  
  /////////////////////////////// INLINE ///////////////////////////////////////
  
  //#include "UFunction.I"
  
  //////////////////////////////////////////////////////////////////////////////
  
  #endif //#ifndef included_UFunction
  