Commit f1fad703 authored by Yury Hayeu's avatar Yury Hayeu Committed by Tomáš Oberhuber
Browse files

Fix code alignment. Remove Dockerfile

parent b4c0dd33
Loading
Loading
Loading
Loading

Dockerfile

deleted100644 → 0
+0 −16
Original line number Diff line number Diff line
FROM nvidia/cuda:11.4.2-devel-ubuntu20.04

# Fix timezone
ENV TZ=Europe/Prague
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update
RUN apt-get install -y --no-install-recommends g++ gcc make cmake zlib1g-dev libjpeg-dev libpng-dev libtinyxml2-dev
RUN apt-get install -y --no-install-recommends git openssh-client subversion procps
RUN apt-get install -y --no-install-recommends vim valgrind gpg man-db gnuplot
RUN apt-get install -y --no-install-recommends zsh ca-certificates curl netbase wget

RUN git config --global alias.ll 'log --oneline --graph --all --decorate'
RUN git config --global core.editor 'vim'

WORKDIR /workspace
+113 −106
Original line number Diff line number Diff line
@@ -8,9 +8,11 @@
#pragma once

template <typename Real>
class HeatmapSolver {
class HeatmapSolver
{
public:
    class Parameters {
   class Parameters
   {
   public:
      const int xSize, ySize;
      const Real xDomainSize, yDomainSize;
@@ -73,7 +75,7 @@ HeatmapSolver<Real>::Parameters::Parameters(const TNL::Config::ParameterContaine
/***
 * Grid parameters:
 *
 * ySize|j                                          (ySize - 1) * xSize + xSize - 1
 * ySize-1|j                                (ySize - 1) * xSize + xSize - 1
 *  |------------------------------------------------------
 *  |
 *  |
@@ -86,7 +88,7 @@ HeatmapSolver<Real>::Parameters::Parameters(const TNL::Config::ParameterContaine
 *  |
 *  |------------------------------------------------------>
 *
 *  0                                                xSize|i
 *  0                                                xSize-1|i
 *
 *  j * xSize + i
 ***/
@@ -111,7 +113,8 @@ bool HeatmapSolver<Real>::solve(const HeatmapSolver<Real>::Parameters &params) c

   auto uxView = ux.getView(), auxView = aux.getView();

  auto init = [=] __cuda_callable__(int i, int j) mutable {
   auto init = [=] __cuda_callable__(int i, int j) mutable
   {
      auto index = j * params.xSize + i;

      auto x = i * hx - params.xDomainSize / 2;
@@ -125,14 +128,16 @@ bool HeatmapSolver<Real>::solve(const HeatmapSolver<Real>::Parameters &params) c
   if (!writeGNUPlot("data.txt", params, ux))
      return false;

  auto next = [=] __cuda_callable__(int i, int j) mutable {
   auto next = [=] __cuda_callable__(int i, int j) mutable
   {
      auto index = j * params.ySize + i;

      auxView[index] = (uxView[index - 1] - 2 * uxView[index] + uxView[index + 1]) * hx_inv +
                       (uxView[index - params.xSize] - 2 * uxView[index] + uxView[index + params.xSize]) * hy_inv;
   };

  auto update = [=] __cuda_callable__(int i) mutable {
   auto update = [=] __cuda_callable__(int i) mutable
   {
      uxView[i] += auxView[i] * timestep;
   };

@@ -153,7 +158,8 @@ template <typename Real>
template <typename Device>
bool HeatmapSolver<Real>::writeGNUPlot(const std::string &filename,
                                       const HeatmapSolver<Real>::Parameters &params,
                                       const TNL::Containers::Array<Real, Device> &map) const {
                                       const TNL::Containers::Array<Real, Device> &map) const
{
   std::ofstream out(filename, std::ios::out);

   if (!out.is_open())
@@ -166,7 +172,8 @@ bool HeatmapSolver<Real>::writeGNUPlot(const std::string &filename,
   return out.good();
}

int main(int argc, char * argv[]) {
int main(int argc, char *argv[])
{
   using Real = double;

   auto config = HeatmapSolver<Real>::Parameters::makeInputConfig();
+2 −2

File changed.

Contains only whitespace changes.