diff --git a/src/continuum/akantu/akantu_dof_wrapper.cc b/src/continuum/akantu/akantu_dof_wrapper.cc index 2a99cdd..1aff04d 100644 --- a/src/continuum/akantu/akantu_dof_wrapper.cc +++ b/src/continuum/akantu/akantu_dof_wrapper.cc @@ -1,143 +1,143 @@ /** * @file akantu_dof_wrapper.cc * * @author Guillaume Anciaux * * @date Tue Jul 22 14:47:56 2014 * * @brief This is a helper class to manage Akantu models * * @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 . * */ #include "akantu_dof_wrapper.hh" #include "lm_common.hh" #include /* -------------------------------------------------------------------------- */ __BEGIN_LIBMULTISCALE__ /* -------------------------------------------------------------------------- */ template AkantuDOFWrapper::AkantuDOFWrapper() : solid_mechanics_model(NULL), material_per_element(NULL), material_local_numbering(NULL), connectivity(NULL) { solid_mechanics_model = NULL; #ifdef AKANTU_HEAT_TRANSFER - heat_transfer_model = NULL; + // heat_transfer_model = NULL; #endif } /* -------------------------------------------------------------------------- */ template AkantuDOFWrapper::~AkantuDOFWrapper() {} /* -------------------------------------------------------------------------- */ template akantu::Array &AkantuDOFWrapper::getForce() { return *this->force; } /* -------------------------------------------------------------------------- */ // template // void AkantuDOFWrapper::setForce(akantu::Array &force) { // this->force = &force; // } // /* -------------------------------------------------------------------------- // */ template const akantu::Array & AkantuDOFWrapper::getGradU(UInt material_index) { return *this->grad_u[material_index]; } /* -------------------------------------------------------------------------- */ template const akantu::Array & AkantuDOFWrapper::getStress(UInt material_index) { return *this->stresses[material_index]; } /* -------------------------------------------------------------------------- */ template void AkantuDOFWrapper::printself(std::ostream &stream) const { stream << "AkantuDOFWrapper: " << this << " " << this->nb_nodes_per_element; } /* -------------------------------------------------------------------------- */ template void AkantuDOFWrapper::setSolidMechanicsModel( akantu::SolidMechanicsModel &model, akantu::Array &force) { this->force = &force; this->solid_mechanics_model = &model; akantu::Mesh &mesh = model.getMesh(); this->type = *mesh.elementTypes(Dim).begin(); LM_ASSERT(mesh.elementTypes(Dim).begin() != mesh.elementTypes(Dim).end(), "There are no element of the right dimension in the mesh"); if (this->type == akantu::_not_defined) LM_FATAL("The element type " << this->type << " coming from Akantu is not a valid type"); this->material_per_element = &(model.getMaterialByElement(this->type)); this->material_local_numbering = &(model.getMaterialLocalNumbering(this->type)); UInt nb_mat = model.getNbMaterials(); for (UInt mat_id = 0; mat_id < nb_mat; ++mat_id) { akantu::Material ¤t_material = model.getMaterial(mat_id); this->grad_u.push_back(¤t_material.getGradU(this->type)); this->stresses.push_back(¤t_material.getStress(this->type)); } this->connectivity = mesh.getConnectivity(this->type).storage(); this->nb_nodes_per_element = mesh.getNbNodesPerElement(this->type); this->nb_quadrature_points = model.getFEEngine().getNbIntegrationPoints(this->type); } /* -------------------------------------------------------------------------- */ template akantu::SolidMechanicsModel &AkantuDOFWrapper::getSolidMechanicsModel() { LM_ASSERT(solid_mechanics_model, "solid mechanics model was not correctly initialized"); return *solid_mechanics_model; } /* -------------------------------------------------------------------------- */ #ifdef AKANTU_HEAT_TRANSFER -template -akantu::HeatTransferModel &AkantuDOFWrapper::getHeatTransferModel() { - LM_ASSERT(heat_transfer_model, - "heat transfer model was not correctly initialized"); - return *heat_transfer_model; -} +// template +// akantu::HeatTransferModel &AkantuDOFWrapper::getHeatTransferModel() { +// LM_ASSERT(heat_transfer_model, +// "heat transfer model was not correctly initialized"); +// return *heat_transfer_model; +// } #endif /* -------------------------------------------------------------------------- */ template class AkantuDOFWrapper<1u>; template class AkantuDOFWrapper<2u>; template class AkantuDOFWrapper<3u>; __END_LIBMULTISCALE__ diff --git a/src/continuum/akantu/akantu_dof_wrapper.hh b/src/continuum/akantu/akantu_dof_wrapper.hh index b95ad3e..f11afef 100644 --- a/src/continuum/akantu/akantu_dof_wrapper.hh +++ b/src/continuum/akantu/akantu_dof_wrapper.hh @@ -1,139 +1,139 @@ /** * @file akantu_dof_wrapper.hh * * @author Guillaume Anciaux * @author Till Junge * @author Srinivasa Babu Ramisetti * * @date Mon Jun 16 17:13:26 2014 * * @brief This is a helper class to manage Akantu models * * @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 . * */ #ifndef __LIBMULTISCALE_AKANTU_DOF_WRAPPER_HH__ #define __LIBMULTISCALE_AKANTU_DOF_WRAPPER_HH__ /* -------------------------------------------------------------------------- */ #include "lm_common.hh" /* -------------------------------------------------------------------------- */ #include /* -------------------------------------------------------------------------- */ namespace akantu { #ifdef AKANTU_HEAT_TRANSFER class HeatTransferModel; #endif } // namespace akantu /* -------------------------------------------------------------------------- */ __BEGIN_LIBMULTISCALE__ /* -------------------------------------------------------------------------- */ template class AkantuDOFWrapper { public: using MyFEM = typename akantu::SolidMechanicsModel::MyFEEngineType; AkantuDOFWrapper(); ~AkantuDOFWrapper(); //! get solidmechanics model object akantu::SolidMechanicsModel &getSolidMechanicsModel(); const akantu::SolidMechanicsModel &getSolidMechanicsModel() const; //! set solidmechanics model object virtual void setSolidMechanicsModel(akantu::SolidMechanicsModel &model, akantu::Array &force); //! set force vector // virtual void setForce(akantu::Array &force); //! get force vector akantu::Array &getForce(); #ifdef AKANTU_HEAT_TRANSFER //! get heattransfer model object - akantu::HeatTransferModel &getHeatTransferModel(); + // akantu::HeatTransferModel &getHeatTransferModel(); //! set heattransfer model object - virtual void setHeatTransferModel(akantu::HeatTransferModel &model); + // virtual void setHeatTransferModel(akantu::HeatTransferModel &model); #endif //! return the initialization state bool isInitialized() const; //! return the element type const inline akantu::ElementType &getType() { return this->type; } inline UInt getNbNodesPerElem() { return this->nb_nodes_per_element; } inline UInt *getConnectivity() { return this->connectivity; } //! return the id of the material of the element index inline const UInt &getMaterialID(UInt index) { return (*this->material_per_element)(index); } //! return the id in its material of element index inline const UInt &getIDInMaterial(UInt index) { return (*this->material_local_numbering)(index); } inline const UInt &getNbQuadraturePoints() { return this->nb_quadrature_points; } const akantu::Array &getGradU(UInt material_index); const akantu::Array &getStress(UInt material_index); /// function to print the contain of the class virtual void printself(std::ostream &stream) const; private: akantu::SolidMechanicsModel *solid_mechanics_model; #ifdef AKANTU_HEAT_TRANSFER - akantu::HeatTransferModel *heat_transfer_model; + // akantu::HeatTransferModel *heat_transfer_model; #endif //! element type in the mesh akantu::ElementType type; //! material id per element const akantu::Array *material_per_element; //! gives the index used in material for each element const akantu::Array *material_local_numbering; //! pointers of strain vectors ordered by material std::vector *> grad_u; //! pointers of stress vectors ordered by material std::vector *> stresses; //! pointers of stress vectors ordered by material akantu::Array *force; //! connectivity array UInt *connectivity; //! nb nodes per element UInt nb_nodes_per_element; UInt nb_quadrature_points; }; /* -------------------------------------------------------------------------- */ template inline std::ostream &operator<<(std::ostream &os, AkantuDOFWrapper &q) { q.printself(os); return os; } __END_LIBMULTISCALE__ #endif /* __LIBMULTISCALE_AKANTU_DOF_WRAPPER_HH__ */ diff --git a/src/continuum/akantu/container_akantu.cc b/src/continuum/akantu/container_akantu.cc index 4a9feb7..bfa6e5a 100644 --- a/src/continuum/akantu/container_akantu.cc +++ b/src/continuum/akantu/container_akantu.cc @@ -1,224 +1,225 @@ /** * @file container_akantu.cc * * @author Guillaume Anciaux * @author Till Junge * * @date Tue Jul 22 14:47:56 2014 * * @brief This is the generic container to Akantu 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 . * */ #include "container_akantu.hh" #include "lm_common.hh" #include #ifdef AKANTU_HEAT_TRANSFER #include #endif // AKANTU_HEAT_TRANSFER /* -------------------------------------------------------------------------- */ __BEGIN_LIBMULTISCALE__ /* -------------------------------------------------------------------------- */ template RefElemAkantu<_Dim> &ContainerElemsAkantu<_Dim>::get(UInt index) { ref.index = index; return ref; } /* -------------------------------------------------------------------------- */ template UInt ContainerElemsAkantu<_Dim>::size() const { if (!this->isInitialized()) return 0; auto &&model = this->getSolidMechanicsModel(); auto &&mesh = model.getFEEngine().getMesh(); return mesh.getNbElement(_Dim); } /* -------------------------------------------------------------------------- */ template void ContainerNodesAkantu<_Dim>::setSolidMechanicsModel( akantu::SolidMechanicsModel &model, akantu::Array &force) { AkantuDOFWrapper<_Dim>::setSolidMechanicsModel(model, force); ref.setAkantuPointers(*this); ref.index = 0; } /* -------------------------------------------------------------------------- */ template UInt ContainerNodesAkantu<_Dim>::size() const { if (!this->isInitialized()) return 0; auto &&model = this->getSolidMechanicsModel(); auto &&mesh = model.getMesh(); return mesh.getNbNodes(); // UInt cpt = 0; // for (UInt n = 0; n < mesh.getNbNodes(); ++n) { // if (mesh.isPureGhostNode(n)) { // if (dt & dt_ghost) // ++cpt; // } else if (mesh.isLocalOrMasterNode(n)) { // if (dt & dt_local_master or dt & dt_local) // ++cpt; // } else if (dt & dt_local_slave or dt & dt_local) { // ++cpt; // } // } // return cpt; } /* -------------------------------------------------------------------------- */ template ContainerElemsAkantu<_Dim>::ContainerElemsAkantu(const LMID &id) : LMObject(id) {} /* -------------------------------------------------------------------------- */ template ContainerElemsAkantu<_Dim>::~ContainerElemsAkantu() {} /* -------------------------------------------------------------------------- */ template void ContainerElemsAkantu<_Dim>::setSolidMechanicsModel( akantu::SolidMechanicsModel &model, akantu::Array &force) { AkantuDOFWrapper<_Dim>::setSolidMechanicsModel(model, force); ref.setAkantuPointers(*this); } /* -------------------------------------------------------------------------- */ #ifdef AKANTU_HEAT_TRANSFER -template -void ContainerElemsAkantu<_Dim>::setHeatTransferModel( - akantu::HeatTransferModel &model) { - AkantuDOFWrapper<_Dim>::setHeatTransferModel(model); -} +// template +// void ContainerElemsAkantu<_Dim>::setHeatTransferModel( +// akantu::HeatTransferModel &model) { +// AkantuDOFWrapper<_Dim>::setHeatTransferModel(model); +// } #endif /* -------------------------------------------------------------------------- */ template void ContainerElemsAkantu<_Dim>::setRef() { ref.setAkantuPointers(*this); } /* -------------------------------------------------------------------------- */ -template -void ContainerElemsAkantu<_Dim>::setHeatTransferFlag(bool flag) { - ref.setHeatTransferFlag(flag); -} +// template +// void ContainerElemsAkantu<_Dim>::setHeatTransferFlag(bool flag) { +// ref.setHeatTransferFlag(flag); +// } /* -------------------------------------------------------------------------- */ -template bool ContainerElemsAkantu<_Dim>::getHeatTransferFlag() { - return ref.getHeatTransferFlag(); -} +// template bool ContainerElemsAkantu<_Dim>::getHeatTransferFlag() { +// return ref.getHeatTransferFlag(); +// } /* -------------------------------------------------------------------------- */ template typename ContainerElemsAkantu<_Dim>::iterator ContainerElemsAkantu<_Dim>::begin() { typename ContainerElemsAkantu<_Dim>::iterator it(*this); return it; } /* -------------------------------------------------------------------------- */ template typename ContainerElemsAkantu<_Dim>::iterator ContainerElemsAkantu<_Dim>::end() { typename ContainerElemsAkantu<_Dim>::iterator it(*this); it.ref.index = this->size(); return it; } /* -------------------------------------------------------------------------- */ template ContainerNodesAkantu<_Dim>::ContainerNodesAkantu(const LMID &id) : LMObject(id) { DUMP("This function still have to be implemented", DBG_DETAIL); } /* -------------------------------------------------------------------------- */ template ContainerNodesAkantu<_Dim>::~ContainerNodesAkantu() {} /* -------------------------------------------------------------------------- */ #ifdef AKANTU_HEAT_TRANSFER // template // void ContainerNodesAkantu<_Dim>::setHeatTransferModel( // akantu::HeatTransferModel &model) { // AkantuDOFWrapper<_Dim>::setHeatTransferModel(model); // ref.field_temperature = model.getTemperature().storage(); // ref.field_temperatureVar = model.getTemperatureRate().storage(); // ref.field_external_heat_rate = model.getExternalHeatRate().storage(); // ref.field_capacity = model.getCapacityLumped().storage(); // ref.field_heat_rate = model.getResidual().storage(); // ref.index = 0; // } #endif /* -------------------------------------------------------------------------- */ template RefNodeAkantu<_Dim> &ContainerNodesAkantu<_Dim>::get(UInt index) { ref.index = index; return ref; } /* -------------------------------------------------------------------------- */ template typename ContainerNodesAkantu<_Dim>::iterator ContainerNodesAkantu<_Dim>::begin() { typename ContainerNodesAkantu<_Dim>::iterator it(*this); return it; } /* -------------------------------------------------------------------------- */ template typename ContainerNodesAkantu<_Dim>::iterator ContainerNodesAkantu<_Dim>::end() { typename ContainerNodesAkantu<_Dim>::iterator it(*this); it.ref.index = this->size(); return it; } /* -------------------------------------------------------------------------- */ -template -void ContainerNodesAkantu<_Dim>::setHeatTransferFlag(bool flag) { - ref.setHeatTransferFlag(flag); -} -/* -------------------------------------------------------------------------- */ -template bool ContainerNodesAkantu<_Dim>::getHeatTransferFlag() { - return ref.getHeatTransferFlag(); -} +// template +// void ContainerNodesAkantu<_Dim>::setHeatTransferFlag(bool flag) { +// ref.setHeatTransferFlag(flag); +// } +// /* -------------------------------------------------------------------------- +// */ template bool +// ContainerNodesAkantu<_Dim>::getHeatTransferFlag() { +// return ref.getHeatTransferFlag(); +// } /* -------------------------------------------------------------------------- */ template class ContainerNodesAkantu<1u>; template class ContainerNodesAkantu<2u>; template class ContainerNodesAkantu<3u>; template class ContainerElemsAkantu<1u>; template class ContainerElemsAkantu<2u>; template class ContainerElemsAkantu<3u>; __END_LIBMULTISCALE__ diff --git a/src/continuum/akantu/container_akantu.hh b/src/continuum/akantu/container_akantu.hh index 24e961d..2742c13 100644 --- a/src/continuum/akantu/container_akantu.hh +++ b/src/continuum/akantu/container_akantu.hh @@ -1,191 +1,192 @@ /** * @file container_akantu.hh * * @author Guillaume Anciaux * @author Till Junge * @author Srinivasa Babu Ramisetti * @author Nicolas Richart * * @date Tue Jul 22 14:47:56 2014 * * @brief This is the generic container to Akantu 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 . * */ #ifndef __LIBMULTISCALE_CONTAINER_AKANTU_HH__ #define __LIBMULTISCALE_CONTAINER_AKANTU_HH__ /* -------------------------------------------------------------------------- */ #include "container.hh" #include "ref_elem_akantu.hh" #include "ref_node_akantu.hh" /* -------------------------------------------------------------------------- */ #include "akantu_dof_wrapper.hh" /* -------------------------------------------------------------------------- */ __BEGIN_LIBMULTISCALE__ template inline akantu::SolidMechanicsModel & AkantuDOFWrapper::getSolidMechanicsModel() { LM_ASSERT(solid_mechanics_model, "solid mechanics model was not correctly initialized"); return *solid_mechanics_model; } /* -------------------------------------------------------------------------- */ template inline const akantu::SolidMechanicsModel & AkantuDOFWrapper::getSolidMechanicsModel() const { LM_ASSERT(solid_mechanics_model, "solid mechanics model was not correctly initialized"); return *solid_mechanics_model; } /* -------------------------------------------------------------------------- */ #ifdef AKANTU_HEAT_TRANSFER -template -inline akantu::HeatTransferModel & -AkantuDOFWrapper::getHeatTransferModel() { - LM_ASSERT(heat_transfer_model, - "heat transfer model was not correctly initialized"); - return *heat_transfer_model; -} +// template +// inline akantu::HeatTransferModel & +// AkantuDOFWrapper::getHeatTransferModel() { +// LM_ASSERT(heat_transfer_model, +// "heat transfer model was not correctly initialized"); +// return *heat_transfer_model; +// } #endif /* -------------------------------------------------------------------------- */ #ifdef AKANTU_HEAT_TRANSFER -template -inline void -AkantuDOFWrapper::setHeatTransferModel(akantu::HeatTransferModel &model) { - this->heat_transfer_model = &model; -} +// template +// inline void +// AkantuDOFWrapper::setHeatTransferModel(akantu::HeatTransferModel &model) +// { +// this->heat_transfer_model = &model; +// } #endif /* -------------------------------------------------------------------------- */ template inline bool AkantuDOFWrapper::isInitialized() const { if (solid_mechanics_model) return true; #ifdef AKANTU_HEAT_TRANSFER - if (heat_transfer_model) - return true; + // if (heat_transfer_model) + // return true; #endif return false; } /* -------------------------------------------------------------------------- */ template class ContainerElemsAkantu : public Container_base>, public AkantuDOFWrapper { public: class iterator; using Ref = RefElemAkantu; public: ContainerElemsAkantu(const LMID &id); ~ContainerElemsAkantu(); //! return an associated iterator iterator begin(); //! return an associated iterator iterator end(); //! get an item from its index RefElemAkantu &get(UInt index); //! return the number of contained items UInt size() const; //! function that clear the container void empty(); //! will initialize the local solid mechanics reference when this function is //! to be called void setSolidMechanicsModel(akantu::SolidMechanicsModel &model, akantu::Array &force); #ifdef AKANTU_HEAT_TRANSFER //! will initialize the local heat transfer reference when this function is to //! be called - void setHeatTransferModel(akantu::HeatTransferModel &model); + // void setHeatTransferModel(akantu::HeatTransferModel &model); #endif //! will set the reference void setRef(); //! set heat transfer flag - void setHeatTransferFlag(bool flag); + // void setHeatTransferFlag(bool flag); //! return heat transfer flag - bool getHeatTransferFlag(); + // bool getHeatTransferFlag(); protected: Ref ref; }; /* -------------------------------------------------------------------------- */ template class ContainerNodesAkantu : public Container_base>, public AkantuDOFWrapper<_Dim> { public: class iterator; using Ref = RefNodeAkantu<_Dim>; static const UInt Dim = _Dim; ContainerNodesAkantu(const LMID &id); ~ContainerNodesAkantu(); decltype(auto) filter(int dt) { return Container_base::template filter(dt); } //! return an associated iterator iterator begin(); //! return an associated iterator iterator end(); //! function that clear the container void empty(); //! will initialize the local reference when this function is to be called void setSolidMechanicsModel(akantu::SolidMechanicsModel &model, akantu::Array &force); #ifdef AKANTU_HEAT_TRANSFER //! will initialize the local heat transfer reference when this function is //! to be called - void setHeatTransferModel(akantu::HeatTransferModel &model); + // void setHeatTransferModel(akantu::HeatTransferModel &model); #endif //! set heat transfer flag - void setHeatTransferFlag(bool flag); + // void setHeatTransferFlag(bool flag); //! return heat transfer flag - bool getHeatTransferFlag(); + // bool getHeatTransferFlag(); //! will set the reference // void setRef(); //! get an item from its index Ref &get(UInt index); //! return the number of contained items UInt size() const; protected: //! reference to be returned in the case of a get call Ref ref; }; __END_LIBMULTISCALE__ /* -------------------------------------------------------------------------- */ #include "iterator_akantu.hh" /* -------------------------------------------------------------------------- */ #endif /* __LIBMULTISCALE_CONTAINER_AKANTU_HH__ */ diff --git a/src/continuum/akantu/iterator_akantu.cc b/src/continuum/akantu/iterator_akantu.cc index 2ac8f28..519ec4f 100644 --- a/src/continuum/akantu/iterator_akantu.cc +++ b/src/continuum/akantu/iterator_akantu.cc @@ -1,105 +1,105 @@ /** * @file iterator_akantu.cc * * @author Guillaume Anciaux * @author Srinivasa Babu Ramisetti * * @date Tue Jul 22 14:47:56 2014 * * @brief This is the generic iterator over Akantu 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 . * */ #include "container_akantu.hh" #include "lm_common.hh" /* -------------------------------------------------------------------------- */ __BEGIN_LIBMULTISCALE__ // template // RefElemAkantu &ContainerElemsAkantu::iterator::getFirst() { // actual_nb_elem = this->my_cont.size(); // if (actual_nb_elem == 0) // this->end_flag = true; // else { // ref.setAkantuPointers( // static_cast &>(this->my_cont)); // this->end_flag = false; // } // return ref; // } /* -------------------------------------------------------------------------- */ template inline ContainerElemsAkantu::iterator::iterator( ContainerElemsAkantu &c) : iterator_base>(c), actual_nb_elem(c.size()) { - ref.setHeatTransferFlag(c.getHeatTransferFlag()); + // ref.setHeatTransferFlag(c.getHeatTransferFlag()); ref.setAkantuPointers(static_cast &>(c)); } /* -------------------------------------------------------------------------- */ // template // RefNodeAkantu &ContainerNodesAkantu::iterator::getFirst() { // actual_nb_elem = this->my_cont.size(dt_all); // if (actual_nb_elem == 0) // this->end_flag = true; // else { // ref.setAkantuPointers( // static_cast &>(this->my_cont)); // ref.index = 0; // this->end_flag = false; // } // while (!(this->dt & ref.getDOFType())) { // this->getNext(); // if (this->end_flag) // break; // } // return ref; // } /* -------------------------------------------------------------------------- */ template ContainerNodesAkantu::iterator::iterator(ContainerNodesAkantu &c) : iterator_base>(c), actual_nb_elem(c.size()) { - ref.setHeatTransferFlag(c.getHeatTransferFlag()); + // ref.setHeatTransferFlag(c.getHeatTransferFlag()); ref.setAkantuPointers(static_cast &>(c)); ref.index = 0; } /* -------------------------------------------------------------------------- */ template class ContainerNodesAkantu<3>; template class ContainerElemsAkantu<3>; template class ContainerNodesAkantu<2>; template class ContainerElemsAkantu<2>; template class ContainerNodesAkantu<1>; template class ContainerElemsAkantu<1>; __END_LIBMULTISCALE__ diff --git a/src/continuum/akantu/ref_elem_akantu.cc b/src/continuum/akantu/ref_elem_akantu.cc index f4ccd49..2407693 100644 --- a/src/continuum/akantu/ref_elem_akantu.cc +++ b/src/continuum/akantu/ref_elem_akantu.cc @@ -1,83 +1,83 @@ /** * @file ref_elem_akantu.cc * * @author Guillaume Anciaux * * @date Tue Jun 24 22:58:02 2014 * * @brief This is a reference to Akantu elements * * @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 . * */ #include "ref_elem_akantu.hh" #include "lm_common.hh" #include "ref_node_akantu.hh" #include #ifdef AKANTU_HEAT_TRANSFER #include #endif // AKANTU_HEAT_TRANSFER /* -------------------------------------------------------------------------- */ __BEGIN_LIBMULTISCALE__ template inline void RefElemAkantu<_Dim>::setAkantuPointers(AkantuDOFWrapper<_Dim> &dof) { model = &dof.getSolidMechanicsModel(); this->fem = &model->getFEEngineClass(); this->dofs = &dof; index = 0; nd.setAkantuPointers(dof); #ifdef AKANTU_HEAT_TRANSFER - if (nd.getHeatTransferFlag()) - heat_transfer_model = &dof.getHeatTransferModel(); + // if (nd.getHeatTransferFlag()) + // heat_transfer_model = &dof.getHeatTransferModel(); #endif } /* -------------------------------------------------------------------------- */ template inline Real RefElemAkantu<_Dim>::getEPot() { return model->getEnergy("potential", this->dofs->getType(), index); } /* -------------------------------------------------------------------------- */ #ifdef AKANTU_HEAT_TRANSFER template inline Real RefElemAkantu<_Dim>::getEThermal() { return heat_transfer_model->getEnergy("thermal", this->dofs->getType(), index); } #endif /* -------------------------------------------------------------------------- */ template Real RefElemAkantu<_Dim>::getEKin() { return code_unit_system.mvv2e * model->getEnergy("kinetic", this->dofs->getType(), index); } /* -------------------------------------------------------------------------- */ template class RefElemAkantu<1u>; template class RefElemAkantu<2u>; template class RefElemAkantu<3u>; __END_LIBMULTISCALE__