Page MenuHomec4science

domain_dd.hh
No OneTemporary

File Metadata

Created
Thu, May 23, 19:40

domain_dd.hh

/**
* @file domain_dd.hh
*
* @author Guillaume Anciaux <guillaume.anciaux@epfl.ch>
*
* @date Fri Jul 11 15:47:44 2014
*
* @brief Generic DD domain
*
* @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_DOMAIN_DD_HH__
#define __LIBMULTISCALE_DOMAIN_DD_HH__
/* -------------------------------------------------------------------------- */
#include "component_libmultiscale.hh"
#include "container_dd.hh"
#include "domain_dd_interface.hh"
/* -------------------------------------------------------------------------- */
__BEGIN_LIBMULTISCALE__
class FilterManager;
class ActionManager;
/**
* Class DomainDD
*
*/
template <typename ContNodes, typename ContSources, typename ContObstacles,
UInt Dim>
class DomainDD
: public DomainDDInterface,
public ComponentLMOutTyped<
ContainerDD<ContNodes, ContSources, ContObstacles>, OUTPUT_REF> {
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public:
DomainDD(DomainID ID, CommGroup GID)
: DomainDDInterface(ID, GID),
ComponentLMOutTyped<ContainerDD<ContNodes, ContSources, ContObstacles>,
OUTPUT_REF>(Dim),
dd_container(nodes, sources, obstacles){};
virtual ~DomainDD(){};
/* ------------------------------------------------------------------------ */
/* Typedefs */
/* ------------------------------------------------------------------------ */
typedef ContNodes ContainerNodes;
typedef typename ContainerNodes::iterator IteratorNodes;
typedef typename ContainerNodes::Ref RefNode;
typedef typename ContainerNodes::Ref RefPoint;
typedef ContSources ContainerSources;
typedef typename ContainerSources::iterator IteratorSources;
typedef typename ContainerSources::Ref RefSource;
typedef ContObstacles ContainerObstacles;
typedef typename ContainerObstacles::iterator IteratorObstacles;
typedef typename ContainerObstacles::Ref RefObstacle;
typedef ContainerDD<ContNodes, ContSources, ContObstacles> ContainerPoints;
typedef typename ContainerPoints::ContainerSubset ContainerSubset;
//****************************************************************
// TEMPORARY
//****************************************************************
typedef ContainerPoints Output;
static const COutputType output_type = OUTPUT_REF;
/* ------------------------------------------------------------------------ */
/* Accessors */
/* ------------------------------------------------------------------------ */
ContainerPoints &getContainer();
ContainerPoints &getOutput() { return this->getContainer(); };
//! return the container of nodes
ContainerNodes &getContainerNodes();
//! return the container of sources
virtual ContainerSources &getContainerSources();
//! return the container of obstacles
virtual ContainerObstacles &getContainerObstacles();
//! return a reference to the geometry
Geometry &getGeom();
//! return the potential energy
Real getEpot() { return 0; };
void build(){};
virtual void declareParams();
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
//! restart from xml file function
void readXMLFile(const std::string &filename) {
LM_FATAL("not yet implemented");
}
//! connect and build the adapted object
void connect(FactoryMultiScale<FilterInterface> &f);
//! connect and build the adapted object
void connect(FactoryMultiScale<ActionInterface> &f);
/* ------------------------------------------------------------------------ */
/* Functions fo AMELCG */
/* ------------------------------------------------------------------------ */
//! return product of force by descent direction (for AMELCG)
Real getFdotDir() { return 0; };
//! return max of forces (for AMELCG)
Real getFMax() { return 0; };
//! return max of direction vector (for AMELCG)
Real getDirMax() { return 0; };
//! return norm 2 of forces (for AMELCG)
Real getFNorm2() { return 0; };
//! return stuff for AMELCG
Real getFdotOldF() { return 0; };
//! update direction AMELCG
void updateDirection(Real beta){};
//! return stuff for AMELCG
void saveForceVector(){};
//! displace in descent direction with given magnitude
void displaceTowardsDirection(Real alpha){};
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
protected:
//! domain geometry
GeomID geom;
//! constrained geometry
GeomID geom_constrained;
ContainerNodes nodes;
ContainerSources sources;
ContainerObstacles obstacles;
ContainerPoints dd_container;
};
/* -------------------------------------------------------------------------- */
__END_LIBMULTISCALE__
#endif /* __LIBMULTISCALE_DOMAIN_DD_HH__ */

Event Timeline