Program Listing for File gamer.h

Return to documentation for file (include/gamer/gamer.h)

/*
 * ***************************************************************************
 * This file is part of the GAMer software.
 * Copyright (C) 2016-2018
 * by Christopher Lee, John Moody, Rommie Amaro, J. Andrew McCammon,
 *    and Michael Holst
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 * ***************************************************************************
 */


#pragma once

#include <Eigen/Dense>
#include "gamer/tensor.h"

namespace gamer
{
#define BLOBBYNESS        -0.2f

#define DIM_SCALE         1.99

#define MIN_VOLUME        333333

#ifdef SINGLE
  #define REAL float
#else
  #define REAL double
#endif

using Vector = tensor<REAL, 3, 1>;
using Vector3d = tensor<double, 3, 1>;
using Vector3f = tensor<float, 3, 1>;
using Vector3i = tensor<int, 3, 1>;
using Vector3szt = tensor<std::size_t, 3, 1>;

using EigenMatrix = Eigen::Matrix<REAL, 3, 3>;
using EigenVector = Eigen::Matrix<REAL, 3, 1>;
using EigenMatrixN = Eigen::Matrix<REAL, Eigen::Dynamic, Eigen::Dynamic>;
using EigenVectorN = Eigen::Matrix<REAL, Eigen::Dynamic, 1>;

inline std::size_t Vect2Index(const std::size_t i, const std::size_t j, const std::size_t k, const Vector3szt &dim)
{
    return k*dim[0]*dim[1] + j*dim[0] + i;
}
} // end namespace gamer