Page MenuHomec4science

domain_paradis.hh
No OneTemporary

File Metadata

Created
Mon, Aug 5, 09:57

domain_paradis.hh

/**
* @file domain_paradis.hh
*
* @author Till Junge <till.junge@epfl.ch>
* @author Jaehyun Cho <jaehyun.cho@epfl.ch>
* @author Max Hodapp <max.hodapp@epfl.ch>
*
* @date Fri Jul 11 15:47:44 2014
*
* @brief ParaDiS domain
*
* @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/>.
*
*/
#ifndef __LIBMULTISCALE_DOMAIN_PARADIS_HH__
#define __LIBMULTISCALE_DOMAIN_PARADIS_HH__
/* -------------------------------------------------------------------------- */
#include "container_array.hh"
#include "container_paradis.hh"
#include "domain_dd.hh"
/* -------------------------------------------------------------------------- */
__BEGIN_LIBMULTISCALE__
/**
* Class DummySource
* DD dummy container (defect fictive container ?)
*/
/* -------------------------------------------------------------------------- */
/**
* Class DomainParaDiS
* domain to implement the plugin interface to PARADIS dislocation dynamics
*/
class DomainParaDiS : public DomainDD<ContainerParaDiSNode, 3> {
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public:
DomainParaDiS(LMID ID, CommGroup &group)
: LMObject(ID), DomainDD<ContainerParaDiSNode, 3>(ID, group) {
paradis_ptr = nullptr;
}
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
void performStep1() override;
void performStep2() override;
void performStep3() override;
void performStep4() override;
void performStep5() override;
void imageForce(const double *position, const double *normal, double *force);
Cube getDomainBoundingBox() override;
Cube getSubDomainBoundingBox() override;
void setDomainBoundingBox(const Cube &) override;
void setSubDomainBoundingBox(const Cube &) override;
//! compute displacement field for a set of positions
void computeDisplacements(std::vector<Real> &positions,
std::vector<Real> &displacements) override;
//! compute displacement field for a position with a given segment
void computeBarnett(Vector<3> &A, Vector<3> &B, Vector<3> &C, Vector<3> &burg,
Vector<3> &dispPointU, Vector<3> &dispPointX, Real pois);
void computeClosurePoint(Vector<3> &A, Vector<3> &B, Vector<3> &burg,
Vector<3> &C);
void computeProjectedPoint(Vector<3> &A, Vector<3> &C, Vector<3> &burg,
Vector<3> &P);
//! remesh
void remesh() override;
//! intialisation stage
void init() override;
//! parse the keywords
void declareParams() override;
//! add segments to the dd model
virtual void addSegments(std::vector<RefPointData<3>> &pos,
std::vector<RefGenericElem<3>> &conn,
std::vector<Real> &burgers,
std::vector<Real> &glide_normals) override;
UInt getNBNodes();
bool is_it_bound();
VectorProxy<3u> getXmin();
VectorProxy<3u> getXmax();
Real getShearModulus();
void freenodearm(UInt index);
void freenode(UInt index);
//! Add hybrid segments to the DD model
virtual void addHybSegments(
std::vector<RefPointData<3>>
&positions, // DD nodes in an atomistic domain
std::vector<RefGenericElem<3>>
&conn, // connectivity between DD nodes in the atomistic domain
Real threshold)
override; // max. distance between two adjacent DD nodes possibly
// generating a hybrid segment
/* ------------------------------------------------------------------------ */
/* Accessors */
/* ------------------------------------------------------------------------ */
//! set current step to a given value
void setCurrentStep(UInt ts) override {
LM_FATAL("to be implemented");
} // GUILLAUME?
//! get current step
UInt getCurrentStep() override {
LM_FATAL("to be implemented");
return 0;
}; // CHANGE THIS
//! set timestep to a given value
void setTimeStep(Real ts) override{
LM_FATAL("to be implemented")}; // CHANGE THIS
//! GetTimeStep
Real getTimeStep() override { return this->timestep; }; // CHANGE THIS
//! return the stress component (what is i and j ?)
double &get_stress_component(int i, int j) {
int indices[3][3] = {{0, 5, 4}, {5, 1, 3}, {4, 3, 2}};
return this->paradis_ptr->param->appliedStress[indices[i][j]];
}
UInt getDim() { return 3; };
Real getPoisson() { return this->paradis_ptr->param->pois; };
Real getMaxSeg() { return this->paradis_ptr->param->maxSeg; };
Real getMinSeg() { return this->paradis_ptr->param->minSeg; };
Real getBurgersMagnitude() { return this->paradis_ptr->param->burgMag; };
UInt getNBpairsInfinite() { return this->paradis_ptr->param->numPairs; };
bool getPairedIndex(int index0, int *index0_infinite) {
UInt num_pairs = this->paradis_ptr->param->numPairs;
for (int i = 0; i < (int)num_pairs; ++i) {
Pair_t pair_ind;
pair_ind = *this->paradis_ptr->pairKeys[i];
if (pair_ind.index1 == index0) {
*index0_infinite = pair_ind.index2;
return true;
} else if (pair_ind.index2 == index0) {
*index0_infinite = pair_ind.index1;
return true;
}
}
return false;
};
/* ------------------------------------------------------------------------ */
/* Functions for AMELCG */
/* ------------------------------------------------------------------------ */
double getExternalWork() { return 0; }
void setExternalWork(double) {}
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
private:
bool boundary;
int memSize;
Home_t *paradis_ptr;
Quantity<Time> timestep;
UInt numDLBCycles;
std::string control_filename;
std::string data_filename;
// ParaDis - Containers/Lists
// list of ParaDis node handles of
// "continuum" DD nodes next to the
// artificial interface
std::vector<Node_t *> nh_l_conInt;
// list of ParaDis node handles confined
// to an atomistic domain
std::vector<Node_t *> created_nodes;
// NOTE: vector changes every iteration depending on a dislocation detection
// algorithm
std::string mobility_filename;
};
/* -------------------------------------------------------------------------- */
__END_LIBMULTISCALE__
#endif /* __LIBMULTISCALE_DOMAIN_PARADIS_HH__ */

Event Timeline