Page MenuHomec4science

dof_association.hh
No OneTemporary

File Metadata

Created
Tue, Jun 4, 17:22

dof_association.hh

/**
* @file dof_association.hh
*
* @author Guillaume Anciaux <guillaume.anciaux@epfl.ch>
*
* @date Tue Jan 21 12:37:46 2014
*
* @brief Mother of all object which associates DOFs for coupling purpose
*
* @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_DOF_ASSOCIATION_HH__
#define __LIBMULTISCALE_DOF_ASSOCIATION_HH__
/* -------------------------------------------------------------------------- */
#include "compute_extract.hh"
#include "dof_association_interface.hh"
#include "duo_distributed_vector.hh"
#include "lm_parsable.hh"
#include "spatial_grid_libmultiscale.hh"
/* -------------------------------------------------------------------------- */
__BEGIN_LIBMULTISCALE__
template <typename ContainerA, typename ContainerB>
class DofAssociation : public DofAssociationInterface {
public:
DofAssociation(const std::string &name, ContainerA &cA, ContainerB &cB);
virtual ~DofAssociation();
public:
//! delete grid structure to sort elements
void deleteGrid();
protected:
void declareParams();
//! exchange geometries: for coarse desc of communication scheme
template <typename ContA, typename ContB>
void exchangeGeometries(ContA &subA, ContB &subB);
void exchangeGeometries(Cube &cube);
protected:
//! the spatial grid used to speedup the association build
SpatialGridLibMultiScale<UInt, ContainerA::Dim> *grid;
//! Container of whatever
ContainerA &contA;
//! Container of whatever
ContainerB &contB;
};
/* -------------------------------------------------------------------------- */
template <typename ContainerA, typename ContainerB>
template <typename ContA, typename ContB>
void DofAssociation<ContainerA, ContainerB>::exchangeGeometries(ContA &subA,
ContB &subB) {
if (comm_group_A == comm_group_B)
return;
Cube localGeom;
if (in_group_A)
localGeom = subA->getBoundingBox();
if (in_group_B)
localGeom = subB->getBoundingBox();
exchangeGeometries(localGeom);
}
/* -------------------------------------------------------------------------- */
__END_LIBMULTISCALE__
#endif /* __LIBMULTISCALE_DOF_ASSOCIATION_HH__ */

Event Timeline