Page MenuHomec4science

stimulation_block.cc
No OneTemporary

File Metadata

Created
Sat, Nov 16, 12:41

stimulation_block.cc

/**
* @file stimulation_block.cc
*
* @author Guillaume Anciaux <guillaume.anciaux@epfl.ch>
* @author Till Junge <till.junge@epfl.ch>
*
* @date Tue Jul 29 17:03:26 2014
*
* @brief blocks nodes of a fem mesh, thus eliminating equations
*
* @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 "lib_md.hh"
#include "lib_dd.hh"
#include "lib_continuum.hh"
#include "stimulation_block.hh"
#include "ref_point_data.hh"
#include "container_mesh.hh"
__BEGIN_LIBMULTISCALE__
template <typename _Input>
void StimulationBlock<_Input>::stimulate(_Input & input, UInt stage) {
if (input.size() == 0 ) return;
static const UInt Dim = _Input::Dim;
std::vector<UInt> directions;
for (UInt i = 0 ; i < Dim ; ++i) {
if (this->block[i]) directions.push_back(i);
}
typedef std::vector<UInt>::iterator dir_iterator;
DUMP("Stimulation BLOCK "
<< " Dim = " << Dim
<< " block_x = " << this->block[0]
<< " block_y = " << this->block[1]
<< " block_z = " << this->block[2], DBG_INFO);
typename _Input::iterator it = input.getIterator();
for (typename _Input::Ref nd = it.getFirst() ; !it.end(); nd = it.getNext()) {
for (dir_iterator dir = directions.begin() ; dir != directions.end(); ++dir) {
nd.boundary(*dir) = true;
}
}
}
/* -------------------------------------------------------------------------- */
/* LMDESC BLOCK
blocks nodes of a fem mesh, thus eliminating equations
*/
/* LMEXAMPLE STIMULATION boundary BLOCK INPUT femdom DIR 1 0 1 */
/* LMHERITANCE action_interface */
template <typename _Input>
void StimulationBlock<_Input>::declareParams() {
Stimulation<_Input>::declareParams();
/* LMKEYWORD DIR
Whether to block in x direction*/
this->parseVectorKeyword("DIR", Dim, this->block,VEC_DEFAULTS(false,false,false));
}
/* -------------------------------------------------------------------------- */
DECLARE_STIMULATION(StimulationBlock,LIST_CONTINUUM_MODEL)
DECLARE_STIMULATION_REF_TOIMPLEMENT(StimulationBlock,LIST_ATOM_MODEL)
DECLARE_STIMULATION_REF_TOIMPLEMENT(StimulationBlock,LIST_DD_MODEL)
DECLARE_STIMULATION_REFPOINT_TOIMPLEMENT(StimulationBlock)
DECLARE_STIMULATION_GENERIC_MESH_TOIMPLEMENT(StimulationBlock)
__END_LIBMULTISCALE__

Event Timeline