Commit b77efa7a authored by Kevin Moreau's avatar Kevin Moreau

- add changes relative to eXlibris_types

- add new export options for xTensor2 eval



git-svn-id: https://svn.ec-nantes.fr/eXlibris/Applis/DamageBandDyn@1876 fbbead7c-fb4d-4173-aa67-51132c73c120
parent 31924c47
......@@ -20,7 +20,7 @@ using AOMD::EntityEqualKey;
using namespace xfem;
void GetNearestVertexOtherLips(xMesh* bnd_msh,
std::hash_map<mVertex*,mVertex*, EntityHashKey, EntityEqualKey>& nearest_map, const xEval<xVector>& eval_grad_ls)
eXlibris_types::hash_map<mVertex*,mVertex*, EntityHashKey, EntityEqualKey>& nearest_map, const xEval<xVector>& eval_grad_ls)
{
unsigned int is_slave_tag = AOMD_Util::Instance()->lookupMeshDataId("is_slave_tag");
xUpperCreatorRecursive upper(2);
......
......@@ -6,7 +6,7 @@
#ifndef _DeadZoneContact_h_
#define _DeadZoneContact_h_
// Xfem
#include "hash_map.h"
#include "eXlibris_hash_map.h"
// AOMD
#include "mEntityContainer.h"
......@@ -23,7 +23,7 @@ class xVector;
}
void GetNearestVertexOtherLips(xfem::xMesh* bnd_msh,
std::hash_map<AOMD::mVertex*, AOMD::mVertex*, AOMD::EntityHashKey, AOMD::EntityEqualKey>& nearest_map,
eXlibris_types::hash_map<AOMD::mVertex*, AOMD::mVertex*, AOMD::EntityHashKey, AOMD::EntityEqualKey>& nearest_map,
const xfem::xEval<xfem::xVector>& eval_grad_ls);
#endif
......@@ -157,6 +157,20 @@ void PostProcessing::exportOnSpace(const std::string export_name, const int step
Export(evalex, pexport, export_name, integration_rule, begin, end);
pexport.closeFile();
}
if (export_manager.toExport(export_name+"_trace", step, ""))
{
xEvalUnary<xTrace> evaltr(eval);
pexport.openFile(export_manager.getFileName());
Export(evaltr, pexport, export_name, integration_rule, begin, end);
pexport.closeFile();
}
if (export_manager.toExport(export_name+"_dev", step, ""))
{
xEvalUnary<xDeviatoric> evaldev(eval);
pexport.openFile(export_manager.getFileName());
Export(evaldev, pexport, export_name, integration_rule, begin, end);
pexport.closeFile();
}
}
void PostProcessing::exportOnSpace(const std::string export_name, const int step, const xEval<xTensor2Sym>& eval, const xIntegrationRule& integration_rule,
......@@ -308,7 +322,7 @@ void PostProcessing::exportTotalEnergyOnTime(const int step, const double time)
if (step%frequency==0)
{
double total = 0.;
for (std::hash_map<std::string, double>::const_iterator it=current_map.begin(); it!=current_map.end(); ++it) total+=it->second;
for (eXlibris_types::hash_map<std::string, double>::const_iterator it=current_map.begin(); it!=current_map.end(); ++it) total+=it->second;
current_map.clear();
sensor_manager.measure(total, time, "total_global_energy");
std::cout.precision(3);
......
......@@ -111,7 +111,7 @@ private:
xfem::xExport& pexport;
xfem::xExportSensors& sensor_manager;
xfem::xExportManager& export_manager;
std::hash_map<std::string, double> current_map;
eXlibris_types::hash_map<std::string, double> current_map;
int frequency;
};
......
......@@ -31,12 +31,12 @@ void JaumannTimeIntegration::initialize(IterDomain begin, const IterDomain& end)
void JaumannTimeIntegration::restore(IterDomain begin, const IterDomain& end)
{
std::cout << red("STATE RESTORATION in JaumannTimeIntegration") << std::endl;
std::hash_map<int, xfem::xTensor2> store_map;
eXlibris_types::hash_map<int, xfem::xTensor2> store_map;
RestoreInternalVariable("jaumann_time_integration.restore", begin, end, store_map);
for (; begin!=end; ++begin)
{
AOMD::mEntity* e = *begin;
std::hash_map<int, xfem::xTensor2>::const_iterator found = store_map.find(e->getId());
eXlibris_types::hash_map<int, xfem::xTensor2>::const_iterator found = store_map.find(e->getId());
if (found!=store_map.end()) {
xAttachableTensor2<xfem::xTensor2>* attachable_tensor2 = static_cast<xAttachableTensor2<xfem::xTensor2>*>(e->getData(stress_tag));
attachable_tensor2->t = found->second;
......
......@@ -17,8 +17,8 @@ void MoveMeshToDeformed(const xEval<xVector>& eval_disp,
xMesh* mesh, const std::vector<xMesh*>& bnd_meshes,
xEntityToEntity upper_creator, xEntityToEntity upper_adjacent)
{
typedef std::hash_map<mVertex*,mEntity*, EntityHashKey, EntityEqualKey> HashMapEntity;
typedef std::hash_map<mVertex*,xVector, EntityHashKey, EntityEqualKey> HashMapVector;
typedef eXlibris_types::hash_map<mVertex*,mEntity*, EntityHashKey, EntityEqualKey> HashMapEntity;
typedef eXlibris_types::hash_map<mVertex*,xVector, EntityHashKey, EntityEqualKey> HashMapVector;
HashMapEntity move_mesh_map;
for (std::vector<xMesh*>::const_iterator itsm=bnd_meshes.begin(); itsm!=bnd_meshes.end(); ++itsm)
......@@ -91,8 +91,8 @@ void MoveMeshToInitial(const xEval<xVector>& eval_disp,
xMesh* mesh, const std::vector<xMesh*>& bnd_meshes,
xEntityToEntity upper_creator)
{
typedef std::hash_map<mVertex*,mEntity*, EntityHashKey, EntityEqualKey> HashMapEntity;
typedef std::hash_map<mVertex*,xVector, EntityHashKey, EntityEqualKey> HashMapVector;
typedef eXlibris_types::hash_map<mVertex*,mEntity*, EntityHashKey, EntityEqualKey> HashMapEntity;
typedef eXlibris_types::hash_map<mVertex*,xVector, EntityHashKey, EntityEqualKey> HashMapVector;
unsigned int init_tag = AOMD_Util::Instance()->lookupMeshDataId("initial_config");
......
......@@ -25,7 +25,7 @@
#include "xDistanceNearestPoint.h"
#include "xDistanceNearestPointGenerator.h"
// std
#include "hash_map.h"
#include "eXlibris_hash_map.h"
using AOMD::mEntity;
using AOMD::mVertex;
......@@ -106,7 +106,7 @@ xMesh* IsoZeroMeshAdaptator::buildMesh(xMesh* mesh, xLevelSet& level_set)
{
oct_xfem_interf::InterfaceOctreeToAOMD(octree, field, *new_mesh, level_set);
nonlocal_generator->setMesh(*new_mesh);
boost::shared_ptr<xSpace> space_ptr(new xSpacePolynomialLagrange("toto", xSpace::SCALAR, 1));
xfem::spacePtr_t space_ptr(new xSpacePolynomialLagrange("toto", xSpace::SCALAR, 1));
nonlocal_generator->generateNonLocalInfoForKeysAndFcts(space_ptr, 1);
}
else oct_xfem_interf::InterfaceOctreeToAOMDNoHanging(octree, field, *new_mesh, level_set);
......@@ -337,7 +337,7 @@ void NonConformRemesher::modifyOctreeLevelSet(const xLevelSet& level_set, const
{
typedef std::vector<int> IJK;
typedef boost::filter_iterator<xEntityFilter, xIter> FilterIter;
typedef std::hash_map<mEntity*, mEntity*, EntityHashKey, EntityEqualKey> HashMap;
typedef eXlibris_types::hash_map<mEntity*, mEntity*, EntityHashKey, EntityEqualKey> HashMap;
const xMesh* mesh = level_set.getSupport().getMesh();
......@@ -489,7 +489,7 @@ xMesh* NonConformRemesher::buildMesh(xLevelSet& level_set)
{
oct_xfem_interf::InterfaceOctreeToAOMD(octree, field, *new_mesh, level_set);
nonlocal_generator->setMesh(*new_mesh);
boost::shared_ptr<xSpace> space_ptr(new xSpacePolynomialLagrange("toto", xSpace::SCALAR, 1));
xfem::spacePtr_t space_ptr(new xSpacePolynomialLagrange("toto", xSpace::SCALAR, 1));
nonlocal_generator->generateNonLocalInfoForKeysAndFcts(space_ptr, 1);
}
else oct_xfem_interf::InterfaceOctreeToAOMDNoHanging(octree, field, *new_mesh, level_set);
......
......@@ -18,6 +18,8 @@
// boost
#include <boost/iterator/filter_iterator.hpp>
#include "eXlibris_hash_map.h"
/// Export value at integration point. It is limited to only one integration
/// point (internal variable)
template <typename T>
......@@ -57,7 +59,7 @@ template <typename T>
void RestoreInternalVariable(const char* filename,
boost::filter_iterator<xfem::xEntityFilter, xfem::xIter> it,
boost::filter_iterator<xfem::xEntityFilter, xfem::xIter> end,
std::hash_map<int, T>& store_map)
eXlibris_types::hash_map<int, T>& store_map)
{
struct data
{
......@@ -107,12 +109,12 @@ public:
}
void operator()(const xfem::xGeomElem* geom_integ_, const xfem::xGeomElem* geom_appro_, result_type& res_) const
{
typename std::hash_map<int, result_type>::const_iterator found = store_map.find(geom_appro_->getEntity()->getId());
typename eXlibris_types::hash_map<int, result_type>::const_iterator found = store_map.find(geom_appro_->getEntity()->getId());
if (found!=store_map.end()) res_ = found->second;
// else throw;
}
private:
std::hash_map<int, result_type> store_map;
eXlibris_types::hash_map<int, result_type> store_map;
};
template <typename T>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment