Page MenuHomec4science

compute_add_ddsegments.cc-old
No OneTemporary

File Metadata

Created
Thu, Jul 18, 06:38

compute_add_ddsegments.cc-old

/**
* @file compute_add_ddsegments.cc
*
* @author Guillaume Anciaux <guillaume.anciaux@epfl.ch>
* @author Max Hodapp <max.hodapp@epfl.ch>
*
* @date Wed Jul 30 09:55:56 2014
*
* @brief This compute allows to add segments to a DDD model
*
* @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 "compute_add_ddsegments.hh"
#include "action_manager.hh"
#include "communicator.hh"
#include "domain_dd_interface.hh"
#include "domain_multiscale.hh"
#include "filter.hh"
#include "filter_manager.hh"
#include "lib_continuum.hh"
#include "lib_dd.hh"
#include "lib_md.hh"
#include "lm_common.hh"
#include "ref_point_data.hh"
/* -------------------------------------------------------------------------- */
__BEGIN_LIBMULTISCALE__
/* -------------------------------------------------------------------------- */
template <typename Cont> void ComputeAddDDSegments<Cont>::build(Cont &cont) {
DomainInterface *dom_ptr =
DomainMultiScale::getManager().getObject(this->dom);
ComputeInterface *burgers_ptr = dynamic_cast<ComputeInterface *>(
FilterManager::getManager().getObject(this->burgers));
if (burgers_ptr == NULL)
LM_FATAL("Input " << this->burgers << " is not valid");
burgers_ptr->build();
ComputeInterface *glide_normals_ptr = dynamic_cast<ComputeInterface *>(
FilterManager::getManager().getObject(this->glide_normals));
if (glide_normals_ptr == NULL)
LM_FATAL("Input " << this->glide_normals << " is not valid");
glide_normals_ptr->build();
if (DomainDDInterface *ptr = dynamic_cast<DomainDDInterface *>(dom_ptr)) {
LM_TOIMPLEMENT;
//if (isHyb == 1)
// ptr->addHybSegments(cont.getContainerNodes().getArray(),
// cont.getContainerElems().getArray(), threshold);
//else
// ptr->addSegments(cont.getContainerNodes().getArray(),
// cont.getContainerElems().getArray(), *burgers_ptr,
// *glide_normals_ptr);
} else {
LM_FATAL("Invalid domain input (" << this->dom << ")"
<< " for the compute " << this->getID());
}
}
/* -------------------------------------------------------------------------- */
/* LMDESC ADD_DDSEGMENTS
Add dislocation dynamics segments to the provided model
*/
/* LMEXAMPLE
COMPUTE addDDSegments ADD_DDSEGMENTS INPUT points DOMAIN dd_part BURGERS
burgers_compute GLIDE_PLANE glide_normals_compute\ \
*/
template <typename Cont> void ComputeAddDDSegments<Cont>::declareParams() {
Compute<Cont>::declareParams();
/* LMKEYWORD DOMAIN
Specify the domain ID to be used to generate the displacement data
*/
this->parseKeyword("DOMAIN", this->dom);
/* LMKEYWORD BURGERS
Specify the filter ID where per segment burgers are stored
*/
this->parseKeyword("BURGERS", this->burgers);
/* LMKEYWORD GLIDE_PLANE
Specify the filter ID where per segment glide plane normals are stored
*/
this->parseKeyword("GLIDE_PLANE", this->glide_normals);
/* LMKEYWORD IS_HYB
Check if one or more hybrid segments are added to an existing DD line
(default: 0)
*/
this->parseKeyword("IS_HYB", this->isHyb, 0);
/* LMKEYWORD THRESHOLD
Threshold for the distance between two adjacent nodes possibly forming a
hybrid segment
*/
this->parseKeyword("THRESHOLD", this->threshold, 0.);
};
/* -------------------------------------------------------------------------- */
DECLARE_COMPUTE_REF_TOIMPLEMENT(ComputeAddDDSegments, LIST_DD_MODEL);
DECLARE_COMPUTE_REF_TOIMPLEMENT(ComputeAddDDSegments, LIST_ATOM_MODEL);
DECLARE_COMPUTE_REF_TOIMPLEMENT(ComputeAddDDSegments, LIST_CONTINUUM_MODEL);
DECLARE_COMPUTE_REFPOINT_TOIMPLEMENT(ComputeAddDDSegments);
DECLARE_COMPUTE_GENERIC_MESH(ComputeAddDDSegments);
__END_LIBMULTISCALE__

Event Timeline