Commit c315a587 authored by Benoit LE's avatar Benoit LE

Modified exportOnSpace to be able to use a xEntityToEntity

parent 8db78585
......@@ -66,49 +66,52 @@ public:
template<typename ITER>
void exportOnSpace(const std::string export_name, const int step, const xfem::xEval<double>& eval,
const xfem::xIntegrationRule& integration_rule, ITER begin, ITER end) {
const xfem::xIntegrationRule& integration_rule, ITER begin, ITER end,
xfem::xEntityToEntity integ2appro = xtool::xIdentity < AOMD::mEntity * >()) {
if(export_manager.toExport(export_name, step, "")) {
exportOnSpace(export_name, eval, integration_rule, begin, end);
exportOnSpace(export_name, eval, integration_rule, begin, end, integ2appro);
}
}
template<typename ITER>
void exportOnSpace(const std::string export_name, const int step, const xfem::xEval<xtensor::xVector>& eval,
const xfem::xIntegrationRule& integration_rule, ITER begin, ITER end) {
const xfem::xIntegrationRule& integration_rule, ITER begin, ITER end,
xfem::xEntityToEntity integ2appro = xtool::xIdentity < AOMD::mEntity * >()) {
if(export_manager.toExport(export_name, step, "")) {
exportOnSpace(export_name, eval, integration_rule, begin, end);
exportOnSpace(export_name, eval, integration_rule, begin, end), integ2appro;
}
for(int i=0; i<3; ++i) {
if(export_manager.toExport(export_name+"_"+std::to_string(i+1), step, "")) {
xtensor::xExtractCompVector extract(i);
xfem::xEvalUnary<xtensor::xExtractCompVector> evalex(extract, eval);
exportOnSpace(export_name, evalex, integration_rule, begin, end);
exportOnSpace(export_name, evalex, integration_rule, begin, end, integ2appro);
}
}
}
template<typename ITER>
void exportOnSpace(const std::string export_name, const int step, const xfem::xEval<xtensor::xTensor2>& eval,
const xfem::xIntegrationRule& integration_rule, ITER begin, ITER end) {
const xfem::xIntegrationRule& integration_rule, ITER begin, ITER end,
xfem::xEntityToEntity integ2appro = xtool::xIdentity < AOMD::mEntity * >()) {
if(export_manager.toExport(export_name, step, "")) {
exportOnSpace(export_name, eval, integration_rule, begin, end);
exportOnSpace(export_name, eval, integration_rule, begin, end, integ2appro);
}
for(int i=0; i<3; ++i) {
for(int j=0; j<3; ++j) {
if(export_manager.toExport(export_name+"_"+std::to_string(i+1)+std::to_string(j+1), step, "")) {
xtensor::xExtractCompTensor extract(i,j);
xfem::xEvalUnary<xtensor::xExtractCompTensor> evalex(extract, eval);
exportOnSpace(export_name, evalex, integration_rule, begin, end);
exportOnSpace(export_name, evalex, integration_rule, begin, end, integ2appro);
}
}
}
if(export_manager.toExport(export_name+"_tr", step, "")) {
xfem::xEvalUnary<xtensor::xTrace> evaltr(eval);
exportOnSpace(export_name, evaltr, integration_rule, begin, end);
exportOnSpace(export_name, evaltr, integration_rule, begin, end, integ2appro);
}
if(export_manager.toExport(export_name+"_dev", step, "")) {
xfem::xEvalUnary<xtensor::xDeviatoric> evaldev(eval);
exportOnSpace(export_name, evaldev, integration_rule, begin, end);
exportOnSpace(export_name, evaldev, integration_rule, begin, end, integ2appro);
}
}
......@@ -159,10 +162,11 @@ public:
void archiveSave(int step);
private:
template<typename EVAL, typename ITER>
void exportOnSpace(const std::string& export_name, const EVAL& eval, const xfem::xIntegrationRule& integration_rule, ITER begin, ITER end) {
void exportOnSpace(const std::string& export_name, const EVAL& eval, const xfem::xIntegrationRule& integration_rule, ITER begin, ITER end,
xfem::xEntityToEntity integ2appro = xtool::xIdentity < AOMD::mEntity * >()) {
pexport.openFile(export_manager.getFileName());
xfem::xFilteredRegion<ITER, xfem::xEntityFilter> fr(begin, end, filter);
Export(eval, pexport, export_name, integration_rule, fr.begin(), fr.end());
Export(eval, pexport, export_name, integration_rule, fr.begin(), fr.end(),integ2appro);
pexport.closeFile();
}
......
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