Page MenuHomec4science

domain_meca1d.hh
No OneTemporary

File Metadata

Created
Sat, Oct 12, 09:33

domain_meca1d.hh

/**
* @file domain_meca1d.hh
*
* @author Guillaume Anciaux <guillaume.anciaux@epfl.ch>
* @author Srinivasa Babu Ramisetti <srinivasa.ramisetti@epfl.ch>
*
* @date Fri Jul 11 15:47:44 2014
*
* @brief Domain for the 1D finite element engine of LibMultiScale
*
* @section LICENSE
*
* Copyright INRIA and CEA
*
* The LibMultiScale is a C++ parallel framework for the multiscale
* coupling methods dedicated to material simulations. This framework
* provides an API which makes it possible to program coupled simulations
* and integration of already existing codes.
*
* This Project was initiated in a collaboration between INRIA Futurs Bordeaux
* within ScAlApplix team and CEA/DPTA Ile de France.
* The project is now continued at the Ecole Polytechnique Fédérale de Lausanne
* within the LSMS/ENAC laboratory.
*
* This software is governed by the CeCILL-C license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL-C
* license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy,
* modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited
* liability.
*
* In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software,
* that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or
* data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security.
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-C license and that you accept its terms.
*
*/
#ifndef __LIBMULTISCALE_DOMAIN_MECA1D_HH__
#define __LIBMULTISCALE_DOMAIN_MECA1D_HH__
/* -------------------------------------------------------------------------- */
#include "domain_continuum.hh"
#include "ref_elem_meca1d.hh"
#include "ref_node_meca1d.hh"
#include "mesh_meca1d.hh"
#include "container_meca1d.hh"
/* -------------------------------------------------------------------------- */
__BEGIN_LIBMULTISCALE__
/**
* Class DomainContinuum
* Domain implementation by our 1D implementation
*/
class DomainMeca1D : public DomainContinuum<ContainerElemsMeca1D,ContainerNodesMeca1D,1u>{
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public:
DomainMeca1D(DomainID ID,CommGroup GID):
DomainContinuum<ContainerElemsMeca1D,ContainerNodesMeca1D,1u>(ID,GID),
mymesh(NULL){
multiple_timestep_freq =1;
arlequin_flag = false;
elastic_flag = false;
thermal_flag = false;
}
/* ------------------------------------------------------------------------ */
/* Typedefs */
/* ------------------------------------------------------------------------ */
typedef MeshMeca1D::VecMeca1D _Vec_;
/* ------------------------------------------------------------------------ */
/* Friends */
/* ------------------------------------------------------------------------ */
friend class DomainContinuumInterface;
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
public:
virtual void init();
//! position update
void performStep1();
//! velocity update
void performStep3();
//!force and acceleration updates
void performStep2();
//! parallel synch empty here because not parallel
virtual void fixChanges(){};
//! returns whether an md domain is perdiodic in direction dir
virtual bool isPeriodic(UInt dir);
protected:
//! updates temperature derivatives
void updateHeatRate(int i);
//! implementation to allow each line to be parsed
void declareParams();
private:
UInt UpdateNodeForce(UInt i);
/* ------------------------------------------------------------------------ */
/* Accessors */
/* ------------------------------------------------------------------------ */
public:
//! set current step to a given value
void setCurrentStep(UInt ts){current_step = ts;};
//! set internal timestep to a given value
void setTimeStep(Real ts){LM_TOIMPLEMENT;};
//! get current step to a given value
UInt getCurrentStep(){return current_step;};
//! get mass vector
Array & getMass(){return mymesh->m;};
//! get initial position vector
Array & getP0(){return mymesh->p0;};
//! get initial position vector
Array & getV(){return mymesh->v;};
//! get displacement vector
Array & getU(){return mymesh->u;};
//! get displacement vector
Array & getF(){LM_TOIMPLEMENT;return mymesh->u;};
//! get temperature vector
Array & getT(){LM_TOIMPLEMENT;return mymesh->u;};
//! get temperature variation vector
Array & getTVar(){LM_TOIMPLEMENT;return mymesh->u;};
//! get temperature capacity vector
Array & getCapacity(){LM_TOIMPLEMENT;return mymesh->u;};
//! get acceleration vector
Array & getAcceleration(){LM_TOIMPLEMENT;return mymesh->u;};
//! get mass of node i
Real getMass(UInt i){return mymesh->m[i];};
/************* functions for AMELCG **************/
//! return product of force by descent direction (for AMELCG)
Real getFdotDir(){return 0;};
//! return max of forces (for AMELCG)
Real getFMax(){return 0;};
//! return max of direction vector (for AMELCG)
Real getDirMax(){return 0;};
//! return norm 2 of forces (for AMELCG)
Real getFNorm2(){return 0;};
//! return stuff for AMELCG
Real getFdotOldF(){return 0;};
//! update direction AMELCG
void updateDirection(Real beta){};
//! return stuff for AMELCG
void saveForceVector(){};
//! displace in descent direction with given magnitude
void displaceTowardsDirection(Real alpha){};
//! get amount of work done by external forces
Real getExternalWork(){return 0;};
//! set amount of work done by external forces
void setExternalWork(Real work){};
void getSubDomainDimensions(Real * xmin,Real * xmax){LM_TOIMPLEMENT;};
void getDomainDimensions(Real * xmin,Real * xmax){
*xmax = mymesh->p0[mymesh->nbNodes()-1];
*xmax = mymesh->p0[0];
};
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
private:
//! associated mesh
MeshMeca1D * mymesh;
//! cutoff radius for the cauchy born rule
Quantity<Length> rcut;
//! interatomic initial distance
Quantity<Length> r0;
//! sigma parameter for lennard jones
Quantity<Length> sigma;
//! epsilon parameter for lennard jones
Quantity<Energy> epsilon;
//! multiple timestep flag
UInt multiple_timestep_freq;
/* ------------------------------------------------------------------------ */
//old material stuff
/* ------------------------------------------------------------------------ */
//! size of elements
Quantity<Length> element_size;
//! flag for arlequin
bool arlequin_flag;
//! flag for elastic material
bool elastic_flag;
//! flag for activating thermal computations
bool thermal_flag;
//! thermal capacity
Real capacity;
//! thermal conductivity
Real conductivity;
//! atomic mass
Quantity<Mass> mass;
//! file where to laod the nodal cooedinates
std::string mesh_file;
};
/* -------------------------------------------------------------------------- */
__END_LIBMULTISCALE__
#endif /* __LIBMULTISCALE_DOMAIN_MECA1D_HH__ */

Event Timeline