root/src/grid_fef.cpp

/* [<][>][^][v][top][bottom][index][help] */
   1 /*! \file grid.h
   2 
   3     \brief <Program Name>
   4 
   5      Revision history:
   6 
   7           Revised by Christian Power dd.mm.yyyy
   8           Originally written by Christian Power
   9                (power22c@gmail.com) 27. Januar 2016
  10 
  11      This programm implements a basic expression calculator.
  12      Input from cin; output to cout.  The grammar for input is: etc.
  13 
  14      Created by Christian Power on 27.01.2016
  15      Copyright (c) 2016 Christian Power.  All rights reserved.
  16  */
  17 
  18 #include "grid.h"
  19 
  20 using Scal_FEfun = Esfem::Grid::Scal_FEfun;
  21 using Vec_FEfun = Esfem::Grid::Vec_FEfun;
  22 
  23 // ----------------------------------------------------------------------
  24 // Implementation Scal_FEfun
  25 
  26 Scal_FEfun::Scal_FEfun(const std::string& fun_name, const Grid_and_time& gt)
  27   : fun {fun_name, gt.fe_space()}
  28  { 
  29    fun.clear(); 
  30  }
  31 Scal_FEfun& Scal_FEfun::operator=(const Scal_FEfun& other){
  32   fun.assign(other.fun);
  33   return *this;
  34 }
  35 Scal_FEfun& Scal_FEfun::operator+=(const double d){
  36   for(auto it = fun.dbegin(); it != fun.dend(); ++it) *it += d;
  37   return *this;
  38 }
  39 Scal_FEfun& Scal_FEfun::operator*=(const double d){
  40   for(auto it = fun.dbegin(); it != fun.dend(); ++it) *it *= d;
  41   return *this;
  42 }
  43 Scal_FEfun::Scal_FEfun(const Scal_FEfun& other, const Grid_and_time& gt)
  44   : fun {other.name() + "+", gt.fe_space()}
  45 { 
  46   fun.assign(other.fun); 
  47 }
  48 
  49 // ----------------------------------------------------------------------
  50 // Implemenation Vec_FEfun
  51 
  52 Vec_FEfun::Vec_FEfun(const std::string& fun_name, const Grid_and_time& gt)
  53   : fun {fun_name, gt.vec_fe_space()}
  54 { 
  55   fun.clear(); 
  56 }
  57 Vec_FEfun::Vec_FEfun(const Vec_FEfun& other, const Grid_and_time& gt)
  58   : fun {other.name() + "+", gt.vec_fe_space()}
  59 { 
  60   fun.assign(other.fun); 
  61 }
  62 Vec_FEfun& Vec_FEfun::operator=(const Vec_FEfun& other){
  63   fun.assign(other.fun);
  64   return *this;
  65 }
  66 
  67 Vec_FEfun& Vec_FEfun::operator+=(const double d){
  68   for(auto it = fun.dbegin(); it != fun.dend(); ++it) *it += d;
  69   return *this;
  70 }
  71 Vec_FEfun& Vec_FEfun::operator*=(const double d){
  72   for(auto it = fun.dbegin(); it != fun.dend(); ++it) *it *= d;
  73   return *this;
  74 }

/* [<][>][^][v][top][bottom][index][help] */