Page MenuHomec4science

domain_akantu.hh
No OneTemporary

File Metadata

Created
Tue, May 28, 10:40

domain_akantu.hh

/**
* @file domain_akantu.hh
*
* @author Guillaume Anciaux <guillaume.anciaux@epfl.ch>
* @author Till Junge <till.junge@epfl.ch>
* @author Srinivasa Babu Ramisetti <srinivasa.ramisetti@epfl.ch>
*
* @date Mon Jul 21 10:32:33 2014
*
* @brief This is the model wrapping Akantu
*
* @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_AKANTU_HH__
#define __LIBMULTISCALE_DOMAIN_AKANTU_HH__
/* -------------------------------------------------------------------------- */
#include <vec_akantu.hh>
namespace akantu {
class Mesh;
// #include <mesh.hh>
}
/* -------------------------------------------------------------------------- */
#include "domain_continuum.hh"
#include "ref_elem_akantu.hh"
#include "container_akantu.hh"
#include "parser.hh"
/* -------------------------------------------------------------------------- */
namespace akantu {
class SolidMechanicsModel;
class HeatTransferModel;
}
/* -------------------------------------------------------------------------- */
__BEGIN_LIBMULTISCALE__
/**
* Class DomainAkantu
*/
template <UInt Dim>
class DomainAkantu
: public DomainContinuum<ContainerElemsAkantu<Dim>,
ContainerNodesAkantu<Dim>,
Dim >
{
public:
friend class DomainContinuumInterface;
/* ------------------------------------------------------------------------ */
/* Typedefs */
/* ------------------------------------------------------------------------ */
//! type definition for points
// typedef FilterMesh<DomainAkantu, Dim> FilterPoint;
//! type definition for vectors (template entry)
typedef VecAkantu _Vec_;
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
DomainAkantu(DomainID ID,CommGroup GID);
~DomainAkantu();
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
//! init function
virtual void init();
//! initialize the Akantu material objects
void initMaterial();
//! initialize the Akantu Mesh object
void initMesh();
//! position update
void performStep1();
//! velocity update
void performStep3();
//! scaling the mesh
void scaleMesh();
//! shifting the mesh
void shiftMesh();
//! make parallel communication to proceed assembly process
virtual void fixChanges(){LM_TOIMPLEMENT};
//! get initial position vector
_Vec_ & getP0(){return *position0;};
//! get initial position vector
_Vec_ & getV(){return *velocity;};
//! get displacement vector
_Vec_ & getU(){return *displacement;};
//! get displacement vector
_Vec_ & getAcceleration(){return *acceleration;};
//! get displacement vector
_Vec_ & getAppliedForce(){return *applied_force;};
//! get displacement vector
_Vec_ & getForce(){return *residual;};
//! get displacement vector
_Vec_ & getMass(){LM_TOIMPLEMENT;};
//! get mass of node i
Real getMass(UInt i){LM_TOIMPLEMENT;};
//! \todo not yet implemented
Real getEpot();
//! set current step to a given value
void setCurrentStep(UInt ts);
//! set timestep to a given value
void setTimeStep(Real ts);
//! get current step to a given value
UInt getCurrentStep();
void getSubDomainDimensions(Real * xmin,Real * xmax);
void getDomainDimensions(Real * xmin,Real * xmax);
/************* functions for AMELCG **************/
//! return product of force by descent direction (for AMELCG)
Real getFdotDir(){LM_TOIMPLEMENT; return 0;};
//! return max of forces (for AMELCG)
Real getFMax(){LM_TOIMPLEMENT; return 0;};
//! return max of direction vector (for AMELCG)
Real getDirMax(){LM_TOIMPLEMENT; return 0;};
//! return norm 2 of forces (for AMELCG)
Real getFNorm2(){LM_TOIMPLEMENT; return 0;};
//! return stuff for AMELCG
Real getFdotOldF(){LM_TOIMPLEMENT; return 0;};
//! update direction AMELCG
void updateDirection(Real beta){LM_TOIMPLEMENT;};
//! return stuff for AMELCG
void saveForceVector(){LM_TOIMPLEMENT; };
//! displace in descent direction with given magnitude
void displaceTowardsDirection(Real alpha){LM_TOIMPLEMENT; };
//! get amount of work done by external forces
double getExternalWork(){LM_TOIMPLEMENT; return 0;};
//! set amount of work done by external forces
void setExternalWork(double work){LM_TOIMPLEMENT; };
//! returns whether an md domain is perdiodic in direction dir
virtual bool isPeriodic(UInt dir){return this->pbc[dir];}
protected:
//! function for keyword parsing
void declareParams();
//! stores initial slave displacements
void buildSlaveDisplacements();
//! initialize material stuff (if necessary)
// void InitMaterial();
void checkBoundaryInputSanity();
void enableNeumanBndyConditions();
inline bool haveToApplyNeumann(){return this->surface_tag != "";}
public:
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
protected:
//! filename from which to load the mesh
std::string mesh_filename;
//! Akantu mesh object
akantu::Mesh * mesh;
//! Akantu solidmechanics model
akantu::SolidMechanicsModel * model;
//! filename from which to load the material object
std::string material_filename;
//! storage for pbc activation: one bool per direction
UInt pbc[3];
//! storage for scale factors: one real per direction
Quantity<Length,3> scale;
//! storage for shift factors: one real per direction
Quantity<Length,3> shift;
//! interatomic distance for the LJ linearization
Quantity<Length> r0;
//! cutoff radius for the LJ linearization
Quantity<Length> rcut;
//! epsilon energy parameter for the LJ linearization
Quantity<Energy> epsilon;
//! sigma distance parameter for the LJ linearization
Quantity<Length> sigma;
//! mass parameter for the LJ linearization
Quantity<Mass> atomic_mass;
//! for the 1d case parameter to control the mesh generation
Quantity<Length> elem_size;
//! initial position vector
_Vec_ * position0;
//! velocity vector
_Vec_ * velocity;
//! displacement vector
_Vec_ * displacement;
//! acceleration vector
_Vec_ * acceleration;
//! applied force vector
_Vec_ * applied_force;
//! residual vector
_Vec_ * residual;
//! mass vector
_Vec_ * mass;
/*! uniform traction or stress to be applied as traction (for traction
* boundary conditions)*/
Quantity<Pressure, 3*Dim> boundary_stress;
/*! Surface tag for the boundary where traction should be applied (tags
* in the mesh have to repect gmsh convention: contiguous, starting at 1)
*/
std::string surface_tag;
//! starting time for application of boundary conditions
UInt boundary_start;
//! type of neumann boundary condition. can be neglected if not used
bool boundary_is_traction;
//! whether the neumann conditions have already been applied
bool boundary_has_been_applied;
//! akantu parser
akantu::Parser akantu_parser;
};
/* -------------------------------------------------------------------------- */
__END_LIBMULTISCALE__
#endif /* __LIBMULTISCALE_DOMAIN_AKANTU_HH__ */

Event Timeline