Page MenuHomec4science

cluster_grow.hh
No OneTemporary

File Metadata

Created
Mon, Nov 11, 21:06

cluster_grow.hh

/**
*
* @author Guillaume Anciaux <guillaume.anciaux@epfl.ch>
*
* @section LICENSE
*
* Copyright (©) 2016 EPFL (Ecole Polytechnique Fédérale de
* Lausanne) Laboratory (LSMS - Laboratoire de Simulation en Mécanique des
* Solides)
*
* Tamaas 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.
*
* Tamaas 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 Tamaas. If not, see <http://www.gnu.org/licenses/>.
*
*/
/* -------------------------------------------------------------------------- */
#ifndef __CLUSTER_GROW_HH__
#define __CLUSTER_GROW_HH__
/* -------------------------------------------------------------------------- */
#include "contact_area.hh"
/* -------------------------------------------------------------------------- */
#include <queue>
/* -------------------------------------------------------------------------- */
__BEGIN_TAMAAS__
class ClusterGrow {
/* ------------------------------------------------------------------------ */
/* Typedefs */
/* ------------------------------------------------------------------------ */
public:
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public:
ClusterGrow(Map2d<int> & area,
int initial_state,
int to_check_state = -1,
int contact_state = 1,
int no_contact_state = 0);
virtual ~ClusterGrow();
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
public:
//! start grow of a cluster from a given point
template <bool periodic>
void grow(UInt i, UInt j);
private:
void addIndicesToExplore(std::vector<std::pair<UInt,UInt> > & indices_to_add);
/* ------------------------------------------------------------------------ */
/* Accessors */
/* ------------------------------------------------------------------------ */
public:
UInt getNbClusters(){
UInt tmp = current_state - 2;
return tmp;
};
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
private:
int current_state;
const int to_check_state ;
const int contact_state ;
const int no_contact_state;
Map2d<int> & area;
std::queue<std::pair<UInt,UInt> > index_to_explore;
};
/* -------------------------------------------------------------------------- */
__END_TAMAAS__
#endif /* __CLUSTER_GROW_HH__ */

Event Timeline