Page MenuHomec4science

point_association.hh
No OneTemporary

File Metadata

Created
Wed, Jul 3, 13:32

point_association.hh

/**
* @file point_association.hh
*
* @author Guillaume Anciaux <guillaume.anciaux@epfl.ch>
* @author Till Junge <till.junge@epfl.ch>
*
* @date Sun Feb 02 17:45:17 2014
*
* @brief Coupling tool to associate point-like DOFs
*
* @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_POINT_ASSOCIATION_HH__
#define __LIBMULTISCALE_POINT_ASSOCIATION_HH__
#define TIMER
#include "compute_compatibility.hh"
#include "compute_periodic_position.hh"
#include "compute_python.hh"
#include "compute_true_displacement.hh"
#include "container_array.hh"
#include "dof_association.hh"
#include "filter_point.hh"
/* -------------------------------------------------------------------------- */
__BEGIN_LIBMULTISCALE__
/* -------------------------------------------------------------------------- */
template <typename ContainerA, typename ContainerB>
class PointAssociation : public DofAssociation<ContainerA, ContainerB> {
public:
PointAssociation(const std::string &name, ContainerA &contA,
ContainerB &contB);
virtual ~PointAssociation();
public:
//! method to clear every data or object allocated (for a reuse)
virtual void clearAll();
//! Init this object: select points for each domain and find associations
virtual void init();
//! copy field values from model A to B
template <FieldType field> inline void enforceField();
//! mix a field between the two models
template <FieldType field> inline void mixField();
//! set a field to zero (used for usually used to squash the pad atom forces
template <FieldType field1, FieldType field2> inline void zeroFields();
//! function to be called to update the duo vector and parallel structures
void updateForMigration();
private:
/** Filters the degrees of freedom geometrically and then by the list of
applicable points*/
template <typename container, typename PointList>
void buildPointList(container &cont, PointList &pointList);
//! function that fills the grid for association
void fillGrid();
//! function that perfoms the association
void associate();
protected:
//! Prepare buffer for synchronisation
template <FieldType ftype> inline void prepareSynchronisation();
inline void prepareSynchronisationDisplacement();
//! synchronise buffers
template <FieldType ftype> inline void synchronise();
//! apply the buffer
template <FieldType ftype> inline void applyBuffer();
template <bool pbc_x, bool pbc_y, bool pbc_z>
inline void applyBufferPosition();
void declareParams();
//! after receiving the association vectors, build the final set of points
void filterPointListAForUnmatched();
void filterPointListBForUnmatched();
//! internal function to check that the communication scheme works fine
void checkPositionCoherency();
//! compute the weight for the arlequin style
void computeWeights();
//! generic containers that contain the point references to be coupled
casted_component<FilterPoint>::cast<typename ContainerA::ContainerSubset>
pointsAlist;
casted_component<FilterPoint>::cast<typename ContainerB::ContainerSubset>
pointsBlist;
//! generic containers that contain the point references initially selected
//! with filterpoint
casted_component<FilterPoint>::cast<typename ContainerA::ContainerSubset>
unmatchedA;
casted_component<FilterPoint>::cast<typename ContainerB::ContainerSubset>
unmatchedB;
//! container for field variables to sync
ContainerArray<Real> field_buffer;
//! number of associations found by associate
UInt assoc_found;
//! tolerance to be used when comparing atomic positions
Real tolerance;
//! file path to the filteratom file
std::string path;
//! file path to the python script to generate the weights
std::string weight_path;
//! the weights: generated by python
ComputePython weights;
//! the weights of model A
ComputeCompatibility weightsA;
//! the weights of model B
ComputeCompatibility weightsB;
//! necessary to deal with periodic boundary conditions in the pad
bool pbc[3];
//! flag that decide if checkcoherency should be called
bool check_coherency;
ComputeTrueDisplacement true_disp;
};
__END_LIBMULTISCALE__
/* -------------------------------------------------------------------------- */
#include "point_association_inline_impl.hh"
__BEGIN_LIBMULTISCALE__
__END_LIBMULTISCALE__
#endif /* __LIBMULTISCALE_POINT_ASSOCIATION_HH__ */

Event Timeline