diff --git a/src/model/solid_mechanics/solid_mechanics_model_cohesive.hh b/src/model/solid_mechanics/solid_mechanics_model_cohesive.hh index c541ace51..95ac18f18 100644 --- a/src/model/solid_mechanics/solid_mechanics_model_cohesive.hh +++ b/src/model/solid_mechanics/solid_mechanics_model_cohesive.hh @@ -1,225 +1,231 @@ /** * @file solid_mechanics_model_cohesive.hh * @author Marco Vocialta * @date Thu Apr 19 10:34:00 2012 * * @brief Solid mechanics model for cohesive elements * * @section LICENSE * * Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne) * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) * * Akantu 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. * * Akantu 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 Akantu. If not, see . * */ /* -------------------------------------------------------------------------- */ #include "solid_mechanics_model.hh" /* -------------------------------------------------------------------------- */ #ifndef __AKANTU_SOLID_MECHANICS_MODEL_COHESIVE_HH__ #define __AKANTU_SOLID_MECHANICS_MODEL_COHESIVE_HH__ __BEGIN_AKANTU__ class SolidMechanicsModelCohesive : public SolidMechanicsModel { /* ------------------------------------------------------------------------ */ /* Constructors/Destructors */ /* ------------------------------------------------------------------------ */ public: typedef FEMTemplate< IntegratorCohesive, ShapeCohesive > MyFEMCohesiveType; SolidMechanicsModelCohesive(Mesh & mesh, UInt spatial_dimension = 0, const ID & id = "solid_mechanics_model_cohesive", const MemoryID & memory_id = 0); // virtual ~SolidMechanicsModelCohesive(); /* ------------------------------------------------------------------------ */ /* Methods */ /* ------------------------------------------------------------------------ */ public: /// function to print the contain of the class virtual void printself(std::ostream & stream, int indent = 0) const; /// function to perform a stress check on each facet and insert /// cohesive elements if needed void checkCohesiveStress(); /// function to insert cohesive elements on the selected facets void insertCohesiveElements(const Vector & facet_insertion); + /// function to insert cohesive elements on the selected facets by specifying + /// the material + void insertCohesiveElements(const Vector & facet_insertion, + const Vector & facet_material); + + /// initialize completely the model void initFull(std::string material_file, AnalysisMethod method = _explicit_dynamic); /// initialize completely the model for extrinsic elements void initExtrinsic(); /// initialize the model void initModel(); /// initialize cohesive material void initCohesiveMaterial(); /// build fragments and compute their data (mass, velocity..) void computeFragmentsData(); private: /// function to double a given facet and update the list of doubled /// nodes void doubleFacet(Element & facet, Vector & doubled_nodes, Vector & doubled_facets); /// function to double a subfacet given start and end index for /// local facet_to_subfacet vector, and update the list of doubled /// nodes void doubleSubfacet(const Element & subfacet, UInt start, UInt end, Vector & doubled_nodes); /// double middle nodes if facets are _segment_3 void doubleMiddleNode(Vector & doubled_nodes, const Vector & doubled_facets); /// function to update nodal parameters for doubled nodes void updateDoubledNodes(const Vector & doubled_nodes); /// build fragments list void buildFragmentsList(); /// compute fragments' mass and velocity void computeFragmentsMV(); /* ------------------------------------------------------------------------ */ /* Accessors */ /* ------------------------------------------------------------------------ */ public: /// get the cohesive element type AKANTU_GET_MACRO(CohesiveElementType, type_cohesive, ElementType); /// get the cohesive index AKANTU_GET_MACRO(CohesiveIndex, cohesive_index, UInt); /// get the facet type AKANTU_GET_MACRO(FacetType, type_facet, ElementType); /// get the facet mesh AKANTU_GET_MACRO(MeshFacets, mesh_facets, const Mesh &); /// get the sigma limit vector for automatic insertion AKANTU_GET_MACRO(SigmaLimit, sigma_lim, const Vector &); AKANTU_GET_MACRO_NOT_CONST(SigmaLimit, sigma_lim, Vector &); /// get the facets check vector AKANTU_GET_MACRO_NOT_CONST(FacetsCheck, facets_check, Vector &); /// get the stress on facets vector AKANTU_GET_MACRO(StressOnFacets, facet_stress, const Vector &); /// get the number of fragments AKANTU_GET_MACRO(NbFragment, nb_fragment, UInt); /// get the fragment_to_element vectors AKANTU_GET_MACRO_BY_ELEMENT_TYPE_CONST(FragmentToElement, fragment_to_element, UInt); /// get mass for each fragment AKANTU_GET_MACRO(FragmentsMass, fragment_mass, const Vector &); /// get average velocity for each fragment AKANTU_GET_MACRO(FragmentsVelocity, fragment_velocity, const Vector &); /// get the center of mass coordinates for each fragment AKANTU_GET_MACRO(FragmentsCenter, fragment_center, const Vector &); /// THIS HAS TO BE CHANGED AKANTU_GET_MACRO(Tangents, tangents, const Vector &); /* ------------------------------------------------------------------------ */ /* Class Members */ /* ------------------------------------------------------------------------ */ private: /// cohesive element type ElementType type_cohesive; /// facet type ElementType type_facet; /// cohesive material index in materials vector UInt cohesive_index; /// mesh containing facets and their data structures Mesh mesh_facets; /// vector containing a sigma limit for automatic insertion Vector sigma_lim; /// vector containing facets in which cohesive elements can be automatically inserted Vector facets_check; /// @todo store tangents when normals are computed: Vector tangents; /// list of facet quadrature points positions by element ByElementTypeReal elements_quad_facets; /// stress on facets on the two sides by quadrature point Vector facet_stress; /// list of facets connected to each cohesive element Vector facets_to_cohesive_el; /// fragment number for each element ByElementTypeUInt fragment_to_element; /// number of fragments UInt nb_fragment; /// mass for each fragment Vector fragment_mass; /// average velocity for each fragment Vector fragment_velocity; /// center of mass coordinates for each element Vector fragment_center; }; /* -------------------------------------------------------------------------- */ /* inline functions */ /* -------------------------------------------------------------------------- */ //#include "solid_mechanics_model_cohesive_inline_impl.cc" /// standard output stream operator inline std::ostream & operator <<(std::ostream & stream, const SolidMechanicsModelCohesive & _this) { _this.printself(stream); return stream; } __END_AKANTU__ #endif /* __AKANTU_SOLID_MECHANICS_MODEL_COHESIVE_HH__ */