Page MenuHomec4science

bridging_atomic_continuum.hh
No OneTemporary

File Metadata

Created
Sat, May 25, 04:14

bridging_atomic_continuum.hh

/**
* @file bridging_atomic_continuum.hh
*
* @author Guillaume Anciaux <guillaume.anciaux@epfl.ch>
*
* @date Thu Oct 03 16:50:49 2013
*
* @brief Bridging object between atomistic and finite elements
*
* @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 BRIDGING_ATOMIC_CONTINUUM_H
#define BRIDGING_ATOMIC_CONTINUUM_H
/* -------------------------------------------------------------------------- */
#include "bridging.hh"
#include "lib_continuum.hh"
#include "lib_md.hh"
/* -------------------------------------------------------------------------- */
__BEGIN_LIBMULTISCALE__
/** this class represent a low-level bridging zone. The Belytschko Method
for instance is based on it.
association between points and elements and the shape values through the
smatrix object
are built by this method
*/
template <typename DomainA, typename DomainC, UInt Dim>
class BridgingAtomicContinuum
: public Bridging<typename DomainA::ContainerAtoms,
typename DomainC::ContainerPoints, Dim> {
/* ------------------------------------------------------------------------ */
/* Typedefs */
/* ------------------------------------------------------------------------ */
public:
typedef Bridging<typename DomainA::ContainerAtoms,
typename DomainC::ContainerPoints, Dim>
Parent;
typedef typename DomainA::ContainerAtoms::Ref RefAtom;
typedef typename DomainA::ContainerAtoms::iterator IteratorAtoms;
typedef typename DomainA::ContainerAtoms ContainerAtoms;
typedef typename DomainC::ContainerElems::Ref RefElem;
typedef UInt RefIndexNode;
typedef typename DomainC::ContainerNodes::Ref RefNode;
typedef typename DomainC::ContainerElems::iterator IteratorElems;
typedef typename DomainC::ContainerNodes::iterator IteratorNodes;
typedef ContainerArray<RefAtom> ContainerAtomsSubset;
typedef ContainerArray<RefIndexNode> ContainerNodesSubset;
typedef ContainerArray<RefElem> ContainerElemsSubset;
typedef typename ContainerArray<RefIndexNode>::iterator IteratorNodesSubset;
typedef typename ContainerArray<RefElem>::iterator IteratorElemsSubset;
typedef typename ContainerArray<RefAtom>::iterator IteratorAtomsSubset;
typedef typename DomainC::_Vec_ _Vec_;
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public:
BridgingAtomicContinuum(const std::string &name, DomainA &A, DomainC &C);
virtual ~BridgingAtomicContinuum();
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
public:
//! method which cleans the memory of the object for a new restart
virtual void clearAll();
//! generic initializing function
void init();
//! project atomic values on mesh interpolated solution
virtual void projectAtomicDOFsOnMesh(FieldType field);
//! project atomic values on mesh interpolated solution and fill into the
//! buffer
virtual void projectAtomicDOFsOnMesh(FieldType field,
ContainerArray<Real> &buffer);
//! average atomic velocities per elements
virtual void averageDOFsOnElements(ContainerArray<Real> &data_mesh,
FieldType field);
//! Perform a leastsquare on a set of atoms returning and nodal array
void leastSquareAtomicDOFs(ContainerArray<Real> &data_mesh, FieldType field);
//! Perform a leastsquare on a set of atoms returning and nodal array
void leastSquareAtomicData(ContainerArray<Real> &data_mesh,
ContainerArray<Real> &data_atom, UInt stride);
//! build atomic DOFs vector noise (u-sum_I \varphi_I u_I)
void buildAtomicDOFsNoiseVector(std::vector<Real> &v_out, FieldType field);
//! function to call to synch migrated data along with atoms
virtual void updateForMigration();
//! attach a vector to the bridging zone (coherency will be maintained w
//! atomic migrations)
void attachVector(ContainerArray<Real> &tab);
protected:
//! method that check coherency of DOFs redistribution based on atomic
//! positions
void checkPositionCoherency();
//! simple research of a given atom by coordinates and prUInt out ref to
//! screen
void searchAtomInLocalPool(typename Parent::ContainerPointsSubset &container,
Vector<Dim> &X);
//! create an array with interpolated field on atomic sites (field =
//! 0:disp,1:vel)
void interpolateAtomicDOFs(FieldType field);
//! create an array with interpolated field on atomic sites (field =
//! 0:disp,1:vel) and fill the buffer
void interpolateAtomicDOFs(FieldType field_code,
ContainerArray<Real> &buffer);
//! set atomic sites from an interpolated array computed with
//! 'InterpolateAtomicDOFs (field = 0:disp,1:vel)
void setAtomicDOFs(FieldType field);
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
public:
//! atomic domain
DomainA &domA;
//! continuum domain
DomainC &domC;
protected:
//! field sizes (disp,vel,force = Dim , temperature = 1)
UInt field_sizes[4];
//! group ID of the continuum side
CommGroup &comm_group_continuum;
//! group IF of the atomic side
CommGroup &comm_group_atomic;
//! flag if in group continuum
bool is_in_continuum;
//! flag if in group atomic
bool is_in_atomic;
};
__END_LIBMULTISCALE__
/* -------------------------------------------------------------------------- */
#endif // BRIDGING

Event Timeline