Page MenuHomec4science

stimulation_next_event.cc
No OneTemporary

File Metadata

Created
Wed, Jul 10, 05:23

stimulation_next_event.cc

/**
* @file stimulation_next_event.cc
*
* @author Jaehyun Cho <jaehyun.cho@epfl.ch>
*
* @date Thu Sep 18 16:13:19 2014
*
* @brief allows to explicitly set the global variable nb_step_next_event
*
* @section LICENSE
*
* Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne)
* Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
*
* LibMultiScale 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 3 of the License, or (at your option) any
* later version.
*
* LibMultiScale 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 LibMultiScale. If not, see <http://www.gnu.org/licenses/>.
*
*/
/* -------------------------------------------------------------------------- */
#include "lm_common.hh"
#include "stimulation_next_event.hh"
#include "lib_md.hh"
#include "lib_continuum.hh"
#include "lib_dd.hh"
/* -------------------------------------------------------------------------- */
__BEGIN_LIBMULTISCALE__
/* LMDESC NEXT_EVENT
allows to explicitly set the global variable nb\_step\_next\_event
*/
/* LMHERITATE action_interface */
/* LMEXAMPLE STIMULATION gts NEXT_EVENT INPUT NULL FREQ 1200 */
template <typename Cont>
void StimulationNextEvent<Cont>::declareParams(){
Stimulation<Cont>::declareParams();
/* LMKEYWORD INCR
This specifies by how much to increment nb\_step\_next\_event
*/
this->parseKeyword("INCR",this->incr,lm_uint_max);
/* LMKEYWORD VAL
This specifies value to which nb\_step\_next\_event is to be set
*/
this->parseKeyword("VAL",this->val,lm_uint_max);
}
/* -------------------------------------------------------------------------- */
template <typename Cont>
void StimulationNextEvent<Cont>::stimulate(Cont & cont, UInt stage){
if (this->incr != lm_uint_max) {
nb_step_next_event += incr;
} else {
nb_step_next_event = val;
}
//DUMP("nb_step_next_event has been set to " << nb_step_next_event, DBG_MESSAGE);
}
/* -------------------------------------------------------------------------- */
DECLARE_STIMULATION(StimulationNextEvent,LIST_ATOM_MODEL);
DECLARE_STIMULATION(StimulationNextEvent,LIST_CONTINUUM_MODEL);
DECLARE_STIMULATION(StimulationNextEvent,LIST_DD_MODEL);
DECLARE_STIMULATION_REFPOINT(StimulationNextEvent);
DECLARE_STIMULATION_GENERIC_MESH(StimulationNextEvent);
/* -------------------------------------------------------------------------- */
__END_LIBMULTISCALE__

Event Timeline