Page MenuHomec4science

container_paradis.hh
No OneTemporary

File Metadata

Created
Thu, Jun 6, 09:22

container_paradis.hh

/**
* @file container_paradis.hh
*
* @author Till Junge <till.junge@epfl.ch>
*
* @date Mon Jul 28 09:52:51 2014
*
* @brief ParaDiS container of 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_CONTAINER_PARADIS_HH__
#define __LIBMULTISCALE_CONTAINER_PARADIS_HH__
/* -------------------------------------------------------------------------- */
#include "container.hh"
#include "ref_node_paradis.hh"
/* -------------------------------------------------------------------------- */
#define PARALLEL
extern "C"{
#include "Typedefs.h"
#include "Home.h"
#undef X
#undef Y
}
#undef PARALLEL
/* -------------------------------------------------------------------------- */
__BEGIN_LIBMULTISCALE__
class ReferenceManagerParaDis{
public:
template <typename Obj>
void attachObject(Obj & obj, ContainerArray<RefPARADISNode>){
LM_TOIMPLEMENT;
}
};
/* -------------------------------------------------------------------------- */
/**
* Class ContainerParadis
*
*/
class ContainerPARADISNode : public Container_base<RefPARADISNode>{
/* ------------------------------------------------------------------------ */
/* Typedefs */
/* ------------------------------------------------------------------------ */
public:
class iterator;
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public:
ContainerPARADISNode()
:Container_base<RefPARADISNode>(){
paradis_ptr=NULL;
};
~ContainerPARADISNode(){
};
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
virtual ReferenceManagerParaDis & getRefManager(){
LM_TOIMPLEMENT;
return refmanager;
};
void setGrain(Home_t* home)
{
paradis_ptr = home;
node.setHome(home);//CHANGE THIS
//node.setStressVector(paradis_ptr->getDisloNodes()->getStress());//CHANGE THIS//PROBLEM, see ref_node_paradis.h!!!!!!
};
iterator getIterator(DOFType dt = dt_local); //
RefPARADISNode & get(UInt index);
UInt nbElem(DOFType dt = dt_local){
if(this->paradis_ptr == NULL) return 0;
unsigned int nb_elem(0);
for(int i=0; i<this->paradis_ptr->newNodeKeyPtr; ++i) {
if(this->paradis_ptr->nodeKeys[i] != (Node_t *)NULL) ++nb_elem;
}
return nb_elem;
};
void init(){};
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
RefPARADISNode node;
// DisloNodes nodes;
private:
Home_t* paradis_ptr;
//! reference manager for ParaDis
ReferenceManagerParaDis refmanager;
};
__END_LIBMULTISCALE__
/* -------------------------------------------------------------------------- */
#include "iterator_paradis.hh"
/* -------------------------------------------------------------------------- */
__BEGIN_LIBMULTISCALE__
inline ContainerPARADISNode::iterator ContainerPARADISNode::getIterator(DOFType dt){
ContainerPARADISNode::iterator it(*this);
return it;
}
/* -------------------------------------------------------------------------- */
inline RefPARADISNode & ContainerPARADISNode::get(unsigned int index){
node.setIndex(index);
return node;
}
/* -------------------------------------------------------------------------- */
__END_LIBMULTISCALE__
#endif /* __LIBMULTISCALE_CONTAINER_PARADIS_HH__ */

Event Timeline