/* Fesslix - Stochastic Analysis
 * Copyright (C) 2010-2014 Wolfgang Betz
 *
 * Fesslix is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Fesslix 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Fesslix.  If not, see <http://www.gnu.org/licenses/>. 
 */

#ifndef fesslix_flxdyna_H
#define fesslix_flxdyna_H

#include "flxlibs_interface.h"



// -------------------------- dyna_new ----------------------------------------------------------------------

class FlxObjDynaNew : public FlxObjBase {
  private:
    FlxString* fname;
    FlxFunction* fNdof;
    FlxFunction* fNt;
    void task();
  public:
    FlxObjDynaNew( const bool dolog, FlxString* fname, FlxFunction* fNdof, FlxFunction* fNt) : FlxObjBase(dolog), fname(fname), fNdof(fNdof), fNt(fNt) {}
    ~FlxObjDynaNew();
};

/**
* @brief object read class: 
*/
class FlxObjReadDynaNew : public FlxObjReadBase {
  public:
    FlxObjReadDynaNew() : FlxObjReadBase(true) {}
    FlxObjBase* read ();
};


// -------------------------- dyna_set ----------------------------------------------------------------------

class FlxObjDynaSet : public FlxObjBase {
  private:
    FlxString* fname;
    const std::string id;
    const std::string cname;
    FlxFunction* fun;
    FlxFunction* fun2;
    FlxString* str;
    void task();
  public:
    FlxObjDynaSet( const bool dolog, FlxString* fname, const std::string id, const std::string cname, FlxFunction* fun, FlxFunction* fun2, FlxString* str) : FlxObjBase(dolog), fname(fname), id(id), cname(cname), fun(fun), fun2(fun2), str(str) {}
    ~FlxObjDynaSet();
};

/**
* @brief object read class: 
*/
class FlxObjReadDynaSet : public FlxObjReadBase {
  public:
    FlxObjReadDynaSet() : FlxObjReadBase(true) {}
    FlxObjBase* read ();
};


// -------------------------- dyna_series ----------------------------------------------------------------------

class FlxObjDynaSeries : public FlxObjBase {
  private:
    FlxString* fname;
    std::string mID;
    FlxString* fV;
    void task();
  public:
    FlxObjDynaSeries( const bool dolog, FlxString* fname, std::string mID, FlxString* fV) : FlxObjBase(dolog), fname(fname), mID(mID), fV(fV) {}
    ~FlxObjDynaSeries();
};

/**
* @brief object read class: 
*/
class FlxObjReadDynaSeries : public FlxObjReadBase {
  public:
    FlxObjReadDynaSeries() : FlxObjReadBase(true) {}
    FlxObjBase* read ();
};

// -------------------------- dyna_series_excite ----------------------------------------------------------------------

class FlxObjDynaSeriesExcite : public FlxObjBase {
  private:
    FlxString* fname;
    FlxString* rpevstr;
    FlxString* fM;
    FlxFunction* fun;
    const bool ue;	// unexcite
    void task();
  public:
    FlxObjDynaSeriesExcite( const bool dolog, FlxString* fname, FlxString* rpevstr, FlxString* fM, FlxFunction* fun, const bool ue) : FlxObjBase(dolog), fname(fname), rpevstr(rpevstr), fM(fM), fun(fun), ue(ue) {}
    ~FlxObjDynaSeriesExcite();
};

/**
* @brief object read class: 
*/
class FlxObjReadDynaSeriesExcite : public FlxObjReadBase {
  public:
    FlxObjReadDynaSeriesExcite();
    FlxObjBase* read ();
};


// -------------------------- dyna_solve ----------------------------------------------------------------------

class FlxObjDynaSolve : public FlxObjBase {
  private:
    FlxString* fname;
    const bool solve_a;
    void task();
  public:
    FlxObjDynaSolve( const bool dolog, FlxString* fname, const bool solve_a) : FlxObjBase(dolog), fname(fname), solve_a(solve_a) {}
    ~FlxObjDynaSolve();
};

/**
* @brief object read class: 
*/
class FlxObjReadDynaSolve : public FlxObjReadBase {
  public:
    FlxObjReadDynaSolve();
    FlxObjBase* read ();
};

// -------------------------- dyna_outp ----------------------------------------------------------------------

class FlxObjDynaOutp : public FlxObjOutputBase {
  private:
    FlxString* fname;
    const std::string xva_str;
    
    void outp_xva();
    void outp_mck();
    void task();
  public:
    FlxObjDynaOutp( const bool dolog, const std::string ostreamV, FlxString* fname, const std::string xva_str) : FlxObjOutputBase(dolog,ostreamV), fname(fname), xva_str(xva_str) {}
    ~FlxObjDynaOutp();
};

/**
* @brief object read class: 
*/
class FlxObjReadDynaOutp : public FlxObjReadOutputBase {
  public:
    FlxObjReadDynaOutp() : FlxObjReadOutputBase(true) {}
    FlxObjBase* read ();
};

// -------------------------- dyna_vec ----------------------------------------------------------------------

class FlxObjDynaVec : public FlxObjBase {
  private:
    FlxString* fname;
    const char id;
    FlxString* mtxconstname;
    FlxFunction* dof_fun;
    void task();
  public:
    FlxObjDynaVec( const bool dolog, FlxString* fname, const char id, FlxString* mtxconstname, FlxFunction* dof_fun) : FlxObjBase(dolog), fname(fname),id(id), mtxconstname(mtxconstname), dof_fun(dof_fun) {}
    ~FlxObjDynaVec();
};

/**
* @brief object read class: FlxObjDynaVec
*/
class FlxObjReadDynaVec : public FlxObjReadBase {
  public:
    FlxObjReadDynaVec() : FlxObjReadBase(true) {}
    FlxObjBase* read ();
};

// -------------------------- dyna_natfreq ----------------------------------------------------------------------

class FunDyna_natfreq : public FunBaseFun_onePara {
  private:
    const std::string projName;
  public:
    FunDyna_natfreq(const std::string projName, std::vector<FunBase*> *ParaListV) : FunBaseFun_onePara(ParaListV), projName(projName) {}
    const tdouble calc();
    const std::string write();
    const std::string write_v() { return "dyna_natfreq"; }
};

/**
* @brief arithmetic read class of FunFEMelInfo
*/
class FunReadDyna_natfreq : public FunReadFunBase, public FlxReaderBase2 {
  public:
    FunReadDyna_natfreq() : FunReadFunBase(true) {}
    FunBase* read ( bool errSerious );
};




#endif // fesslix_flxdyna_H

