Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F78726363
stimulation_impulse.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Aug 22, 15:34
Size
2 KB
Mime Type
text/x-c++
Expires
Sat, Aug 24, 15:34 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20087791
Attached To
rLIBMULTISCALE LibMultiScale
stimulation_impulse.cc
View Options
/**
* @file stimulation_impulse.cc
*
* @author Guillaume Anciaux <guillaume.anciaux@epfl.ch>
*
* @date Wed Jul 09 21:59:47 2014
*
* @brief This stimulator sets an initial impulse displacement field generating
* a wave
*
* @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 "stimulation_impulse.hh"
#include "lib_continuum.hh"
#include "lib_dd.hh"
#include "lib_md.hh"
#include "lm_common.hh"
#include "ref_point_data.hh"
/* -------------------------------------------------------------------------- */
__BEGIN_LIBMULTISCALE__
StimulationImpulse::StimulationImpulse(const std::string &name)
: LMObject(name), impulse_compute("computeImpulse:" + name) {}
/* -------------------------------------------------------------------------- */
StimulationImpulse::~StimulationImpulse() {}
/* -------------------------------------------------------------------------- */
void StimulationImpulse::init() { impulse_compute.init(); }
/* -------------------------------------------------------------------------- */
template <typename Cont> void StimulationImpulse::stimulate(Cont &cont) {
constexpr UInt Dim = Cont::Dim;
impulse_compute.compute(cont);
UInt index = 0;
for (auto &&at : cont) {
Vector<Dim> disp;
for (UInt i = 0; i < Dim; ++i)
disp[i] = impulse_compute.evalArrayOutput()[index * Dim + i];
at.displacement() = disp;
++index;
}
}
/* -------------------------------------------------------------------------- */
/* LMDESC IMPULSE
This stimulator sets an initial impulse displacement field that will generate
a wave. It uses the IMPULSE compute to generate a displacement field.
*/
/* LMHERITANCE compute_impulse */
/* LMEXAMPLE STIMULATION impulse IMPULSE INPUT central_md LWAVE WaveLength*r0
* DIRECTION 0 INTENSITY 1.1e-3 ONESHOT 0 */
void StimulationImpulse::declareParams() {
StimulationInterface::declareParams();
this->addSubParsableObject(impulse_compute);
}
/* -------------------------------------------------------------------------- */
DECLARE_STIMULATION_MAKE_CALL(StimulationImpulse)
__END_LIBMULTISCALE__
Event Timeline
Log In to Comment