Page MenuHomec4science

coupler_manager.hh
No OneTemporary

File Metadata

Created
Tue, Oct 15, 06:16

coupler_manager.hh

/**
* @file coupler_manager.hh
*
* @author Guillaume Anciaux <guillaume.anciaux@epfl.ch>
*
* @date Wed Jan 15 17:00:43 2014
*
* @brief Manager of coupling components
*
* @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_COUPLER_MANAGER_HH__
#define __LIBMULTISCALE_COUPLER_MANAGER_HH__
/* -------------------------------------------------------------------------- */
#include "coupling_interface.hh"
#include "domain_interface.hh"
/* -------------------------------------------------------------------------- */
__BEGIN_LIBMULTISCALE__
class CouplerManager : public CouplingInterface {
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public:
CouplerManager(): CouplingInterface("CouplerManager"){};
virtual ~CouplerManager(){
std::map<std::string,CouplingInterface * >::iterator it = couplers.begin();
std::map<std::string,CouplingInterface * >::iterator end = couplers.end();
while (it != end){
DUMP("deleting coupler " << it->first,DBG_MESSAGE);
delete (it->second);
++it;
}
};
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
public:
//! function which parses the line
ParseResult parseLine(std::stringstream & line,UInt Dim);
//! function that parses single keywords
void declareParams();
void coupling(CouplingStage stage);
void clearAll();
void init();
private:
//! creates the coupler based on couplerType and domain pointers
CouplingInterface * build(UInt couplerType,
const std::string & coupler_name,
DomainInterface & domA,
DomainInterface & domB,
UInt Dim);
/* ------------------------------------------------------------------------ */
/* Accessors */
/* ------------------------------------------------------------------------ */
public:
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
private:
std::map<std::string,CouplingInterface * > couplers;
};
__END_LIBMULTISCALE__
#endif /* __LIBMULTISCALE_COUPLER_MANAGER_HH__ */

Event Timeline