Commit 9a79eb3d authored by Gilles MARCKMANN's avatar Gilles MARCKMANN

change copyrights headers with a generic one


git-svn-id: https://svn.ec-nantes.fr/eXlibris/Applis/TLSDuctile@2353 fbbead7c-fb4d-4173-aa67-51132c73c120
parent cd8bdd9c
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#include "Algorithm.h"
#include "FormulationQS.h"
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#ifndef _TLSDuctile_Algorithm_h_
#define _TLSDuctile_Algorithm_h_
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#include "Export.h"
#include "Observer.h"
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#ifndef _TLSDuctile_Export_h_
#define _TLSDuctile_Export_h_
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#ifndef _FastMarchingInterface_h_
#define _FastMarchingInterface_h_
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#include "Export.h"
#include "Formulation.h"
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#ifndef _TLSDuctile_Formulation_h_
#define _TLSDuctile_Formulation_h_
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#include "Export.h"
#include "FormulationDyn.h"
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#ifndef _TLSDuctile_FormulationDyn_h_
#define _TLSDuctile_FormulationDyn_h_
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#ifndef _TLSDuctile_FormulationQS_h_
#define _TLSDuctile_FormulationQS_h_
......@@ -17,40 +16,35 @@ public:
PreProcessing&, PostProcessing&);
virtual ~QSFormulation();
// Updates level set field, and material variables. In formulations,
// update is to take in a large sense (it also delocalizes,
// reinitializes, enrichs, transfers data).
// Updates level set field and material variables
virtual void updateCurrentState();
// Perturbs level set field and updates material variables.
// Perturbs level set field and updates material variables
virtual bool updateCurrentStateForced();
// Computes load factor variation.
// Computes load factor variation
virtual void computeLoadFactorVariation();
// Computes load factor.
// Computes load factor
double computeLoadFactor();
// Writes to disp field dof values from xCSRVector, a specific
// disp field is selected by the string.
// disp field is selected by the string
void writeDisp(const lalg::xCSRVector&, std::string);
// Appends to disp field dof values from xCSRVector.
void addDisp(const lalg::xCSRVector&, std::string);
// Writes current values of level set field and material variables
// to old values.
// to old values
void writeCurrentToOld();
// Exports for post processing.
// Exports for post processing
virtual bool exportStep(int);
// Saves for restoration.
// Saves for restoration
virtual void saveStep(int);
protected:
// Restores phi field and old phi field, computes delocalization matrix.
void restoreStep(PreProcessing&);
// Calls tls solver to compute all required mean fields to update phi.
// Required mean fields are declared in the constructor.
void computeLSAdvanceMeanFields();
......@@ -62,25 +56,13 @@ protected:
// Computes delta phi and writes it to tls solver.
virtual void computeDeltaLevelSetField();
// Updates, delocalizes and reinitializes phi.
virtual void updateLevelSetField();
// Updates at one node only (Perturbs), delocalizes and reinitializes phi.
void updateLevelSetFieldForced();
virtual void updateLevelSetField();
// Reinitializes phi.
void reinitLevelSetField();
// Clears measurement displacement field.
void clearDispMeasField();
// Declares measurement displacement field.
void declareDispMeasField();
// Computes dual (energetically) force of the imposed displacement.
xfem::xVector computeRefForce();
// Computes dual (energetically) displacement of the imposed stress.
xfem::xVector computeRefDisp();
protected:
TLSSolver& tls_solver;
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#include "FormulationQSRemeshAniso.h"
#include "TLSGeom.h"
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#ifndef _TLSDuctile_FormulationQSRemeshAniso_h_
#define _TLSDuctile_FormulationQSRemeshAniso_h_
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#include "FormulationQSSuperimposed.h"
#include "TLSGeom.h"
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#ifndef _TLSDuctile_FormulationQSSuperimposed_h_
#define _TLSDuctile_FormulationQSSuperimposed_h_
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#include "Export.h"
#include "Formulation.h"
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#ifndef _TLSDuctile_Import_h_
#define _TLSDuctile_Import_h_
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#include "MeshGeneration.h"
#include "Integration.h"
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#ifndef _TLSDuctile_Integration_
#define _TLSDuctile_Integration_
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#include "LinearSystem.h"
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#ifndef _TLSDuctile_LinearSystem_h_
#define _TLSDuctile_LinearSystem_h_
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#include "Material.h"
#include "MaterialFunction.h"
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#ifndef _TLSDuctile_Material_h_
#define _TLSDuctile_Material_h_
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#include "MaterialElasticDamage.h"
#include "MaterialFunction.h"
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#ifndef _TLSDuctile_MaterialElasticDamage_h_
#define _TLSDuctile_MaterialElasticDamage_h_
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#include "MaterialElasticPlasticDamage.h"
#include "MaterialFunction.h"
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#ifndef _TLSDuctile_MaterialElasticPlasticDamage_h_
#define _TLSDuctile_MaterialElasticPlasticDamage_h_
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#include "MaterialFunction.h"
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#ifndef _TLSDuctile_MaterialFunction_h_
#define _TLSDuctile_MaterialFunction_h_
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#include "MeshGeneration.h"
#include "xRegion.h"
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#ifndef _TLSDuctile_MeshGeneration_h_
#define _TLSDuctile_MeshGeneration_h_
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#include "Observer.h"
#include <iostream>
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#ifndef _TLSDuctile_Observer_h_
#define _TLSDuctile_Observer_h_
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#ifndef _TLSDuctile_TLSDuctile_h_
#define _TLSDuctile_TLSDuctile_h_
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#include "Export.h"
#include "Import.h"
......@@ -152,11 +151,10 @@ TLSGeom::TLSGeom(xData& data,
xMesh* comp_mesh;
std::list<mEntity*> nonlocal_list;
if(pre_pro.doRestart()) {
// to do a clean restart without loss uncomment this 2 lines (only if there is no crack)
// data.ReadMesh();
// comp_mesh=data.mesh;
// comp_mesh=data.mesh;// TODO stored mesh as node position perturbed w.r.t. original mesh
comp_mesh=new xMesh;
pre_pro.loadMesh("comp", *comp_mesh);// TODO, Warning: the loaded mesh has node location slightly different from original one. This is because we export the mesh in saveStep in ASCII.
pre_pro.loadMesh("comp", *comp_mesh);
pre_pro.loadDomain("nonlocal", *comp_mesh, nonlocal_list);
}
else {
......@@ -801,18 +799,11 @@ void TLSGeom::buildCompMesh() {
comp_mesh.modifyAllState();// TODO maybe improvable
comp_mesh.bdryLinkSetup();// TODO maybe improvable
for(auto it=sm_duplicated.begin(0); it!=sm_duplicated.end(0); ++it) {
AddNeighbors(*it, sm_duplicated, 1); // needed for fast marching
}
xRegion integ(&getMesh("integ"));
std::for_each(integ.begin(), integ.end(), PartitionCreator(partition_tag, xAttached(duplicated_tag)));
auto step=Observer::tell<int>("step");
post_pro.exportOnSpace("comp_mesh", step, comp_mesh);
xEvalConstant<double> eval_one(1.);
xIntegrationRuleBasic integ_rule(0);
post_pro.exportOnSpace("sm_duplicated", step, eval_one, integ_rule, sm_duplicated.begin(), sm_duplicated.end());
}
void TLSGeom::createIntegrationPoints() {
......@@ -859,93 +850,96 @@ void TLSGeom::cleanCrack() {
}
void TLSGeom::saveStep(int step) {
if(isRegisteredMesh("integ")) {
post_pro.saveMesh("integ", step, getMesh("integ"));
}
xMesh& mesh=getMesh();
post_pro.saveMesh("comp", step, mesh);
xRegion nonlocal(&mesh.getSubMesh("nonlocal"));
post_pro.saveDomain("nonlocal", step, nonlocal.begin(), nonlocal.end());
}
// void classifyUnconnectedRegions(const xMesh& m, const xSubMesh& sm, int dim, std::list<xSubMesh*>& sm_disc_list) {
// assert(sm_disc_list.empty());
// xAcceptInSubMesh is_in_sm(sm);
// if(dim==0) {
// dim=m.dim();
// for(auto it=sm.begin(0); it!=sm.end(0); ++it) {
// mEntity* n=*it;
// // look for new region
// bool is_new_region=true;
// for(std::list<xSubMesh*>::iterator itl=sm_disc_list.begin(); itl!=sm_disc_list.end(); ++itl) {
// if((*itl)->find(n)) {
// is_new_region=false;
// break;
// }
// }
// // add new region and fill it
// if(is_new_region) {
// std::ostringstream oss;
// oss<<sm_disc_list.size();
// sm_disc_list.push_back(new xSubMesh(sm.getName()+"_disc_"+oss.str(), m));
// xSubMesh* sm_disc=sm_disc_list.back();
// xAcceptInSubMesh is_in_disc(*sm_disc);
// std::list<mEntity*> totreat;
// totreat.push_back(n);
// sm_disc->add(n);
// while(!totreat.empty()) {
// mEntity* nn=totreat.back();
// totreat.pop_back();
// for(int i=0; i<nn->size(dim); ++i) {
// mEntity* f=nn->get(dim,i);
// if(is_in_sm(f)) {
// for(int j=0; j<f->size(0); ++j) {
// mEntity* nnn=f->get(0,j);
// if(nnn!=nn && is_in_sm(nnn) && !is_in_disc(nnn)) {
// totreat.push_back(nnn);
// sm_disc->add(nnn);
// }
// }
// }
// }
// }
// }
// }
// }
// else {
// assert(dim==2||dim==3);
// for(auto it=sm.begin(dim); it!=sm.end(dim); ++it) {
// mEntity* f=*it;
// // look for new region
// bool is_new_region=true;
// for(std::list<xSubMesh*>::iterator itl=sm_disc_list.begin(); itl!=sm_disc_list.end(); ++itl) {
// if((*itl)->find(f)) {
// is_new_region=false;
// break;
// }
// }
// // add new region and fill it
// if(is_new_region) {
// std::ostringstream oss;
// oss<<sm_disc_list.size();
// sm_disc_list.push_back(new xSubMesh(sm.getName()+"_disc_"+oss.str(), m));
// xSubMesh* sm_disc=sm_disc_list.back();
// xAcceptInSubMesh is_in_disc(*sm_disc);
// std::list<mEntity*> totreat;
// totreat.push_back(f);
// sm_disc->add(f);
// while(!totreat.empty()) {
// mEntity* ff=totreat.back();
// totreat.pop_back();
// for(int i=0; i<ff->size(0); ++i) {
// mEntity* n=ff->get(0,i);
// for(int j=0; j<n->size(dim); ++j) {
// mEntity* fff=n->get(dim,j);
// if(fff!=ff && is_in_sm(fff) && !is_in_disc(fff)) {
// totreat.push_back(fff);
// sm_disc->add(fff);
// }
// }
// }
// }
// }
// }
// }
// }
void classifyUnconnectedRegions(const xMesh& m, const xSubMesh& sm, int dim, std::list<xSubMesh*>& sm_disc_list) {
assert(sm_disc_list.empty());
xAcceptInSubMesh is_in_sm(sm);
if(dim==0) {
dim=m.dim();
for(auto it=sm.begin(0); it!=sm.end(0); ++it) {
mEntity* n=*it;
// look for new region
bool is_new_region=true;
for(std::list<xSubMesh*>::iterator itl=sm_disc_list.begin(); itl!=sm_disc_list.end(); ++itl) {
if((*itl)->find(n)) {
is_new_region=false;
break;
}
}
// add new region and fill it
if(is_new_region) {
std::ostringstream oss;
oss<<sm_disc_list.size();
sm_disc_list.push_back(new xSubMesh(sm.getName()+"_disc_"+oss.str(), m));
xSubMesh* sm_disc=sm_disc_list.back();
xAcceptInSubMesh is_in_disc(*sm_disc);
std::list<mEntity*> totreat;
totreat.push_back(n);
sm_disc->add(n);
while(!totreat.empty()) {
mEntity* nn=totreat.back();
totreat.pop_back();
for(int i=0; i<nn->size(dim); ++i) {
mEntity* f=nn->get(dim,i);
if(is_in_sm(f)) {
for(int j=0; j<f->size(0); ++j) {
mEntity* nnn=f->get(0,j);
if(nnn!=nn && is_in_sm(nnn) && !is_in_disc(nnn)) {
totreat.push_back(nnn);
sm_disc->add(nnn);
}
}
}
}
}
}
}
}
else {
assert(dim==2||dim==3);
for(auto it=sm.begin(dim); it!=sm.end(dim); ++it) {
mEntity* f=*it;
// look for new region
bool is_new_region=true;
for(std::list<xSubMesh*>::iterator itl=sm_disc_list.begin(); itl!=sm_disc_list.end(); ++itl) {
if((*itl)->find(f)) {
is_new_region=false;
break;
}
}
// add new region and fill it
if(is_new_region) {
std::ostringstream oss;
oss<<sm_disc_list.size();
sm_disc_list.push_back(new xSubMesh(sm.getName()+"_disc_"+oss.str(), m));
xSubMesh* sm_disc=sm_disc_list.back();
xAcceptInSubMesh is_in_disc(*sm_disc);
std::list<mEntity*> totreat;
totreat.push_back(f);
sm_disc->add(f);
while(!totreat.empty()) {
mEntity* ff=totreat.back();
totreat.pop_back();
for(int i=0; i<ff->size(0); ++i) {
mEntity* n=ff->get(0,i);
for(int j=0; j<n->size(dim); ++j) {
mEntity* fff=n->get(dim,j);
if(fff!=ff && is_in_sm(fff) && !is_in_disc(fff)) {
totreat.push_back(fff);
sm_disc->add(fff);
}
}
}
}
}
}
}
}
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#ifndef _TLSDuctile_TLSGeom_h_
#define _TLSDuctile_TLSGeom_h_
......
/*
Copyright © 2004 Nicolas MOES, Fabien CAZES, Kévin MOREAU and Benoît LE All Right Reserved
TLSDuctile source code is subject to non-permissive licence,
see the LICENSE files for conditions.
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#include "Export.h"
#include "FastMarchingInterface.h"
......@@ -80,6 +79,26 @@ TLSSolver::~TLSSolver() {
delete space_factory;
}
void TLSSolver::restoreStep(PreProcessing& pre_pro) {
Observer::listen("step", pre_pro.getStep());
auto integ_rule=geom.getIntegRuleBasic(0);
auto begin=geom.begin("tls");
auto end=geom.end("tls");
OldAndCurrent_c::old();
pre_pro.loadField("old_phi", geom.getMesh(), field);
post_pro.exportOnSpace("restored_old_phi", pre_pro.getStep(), eval_phi, integ_rule, begin, end);
OldAndCurrent_c::current();
pre_pro.loadField("phi", geom.getMesh(), field);
post_pro.exportOnSpace("restored_phi", pre_pro.getStep(), eval_phi, integ_rule, begin, end);
xEvalGradField<xIdentity<xVector> > eval_grad_phi(field);
geom.updateBndAndInt(eval_grad_phi);
if(isDelocalized()) {
computeModesFastMarching();
}
}
void TLSSolver::deleteState() {
DeleteState(field, geom.begin(0, "tls"), geom.end(0, "tls"));
double_manager.clear_subset(dofs);
......@@ -276,15 +295,9 @@ void TLSSolver::transferLevelSetField() {
transferDomains();
declareField("duplicated");
deleteState();
// TransferField(field, field,
// [](xValue<double>* v1, xValue<double>* v2) { v2->setVal(v1->getVal()); },
// geom.begin(0, "duplicated"), geom.end(0, "duplicated"));
// it is better than a transfer since new duplicated nodes (same location) receive different values (one from left, one from right in 1D)
FastMarchingReinit(field,
geom.getRegion("duplicated"),
geom.begin(0, "bnd_fds"), geom.end(0, "bnd_fds"),
geom.begin(0, "duplicated"), geom.end(0, "duplicated"),
[](const mEntity& v) { return 1.; }, false);
TransferField(field, field,
[](xValue<double>* v1, xValue<double>* v2) { v2->setVal(v1->getVal()); },
geom.begin(0, "duplicated"), geom.end(0, "duplicated"));
deleteField("int_fds");
declareState();
post_pro.exportOnSpace("transfered_phi", Observer::tell<int>("step"), eval_phi, geom.getIntegRuleBasic(0), geom.begin("tls"), geom.end("tls"));
......@@ -382,6 +395,13 @@ bool TLSSolver::isDelocalized() const {
return isNewlyDelocalized() || geom.isDelocalized();
}
void TLSSolver::saveStep(int step) {
OldAndCurrent_c::old();
post_pro.saveField("old_phi", step, field, geom.getRegion("tls"));
OldAndCurrent_c::current();
post_pro.saveField("phi", step, field, geom.getRegion("tls"));
}
void TLSSolver::exportStep(int step) {
auto integ_rule=geom.getIntegRulePartition(0);
auto begin=geom.begin("tls");
......@@ -416,26 +436,7 @@ const xEval<double>& TLSSolver::getPhiMinusLcEval() const {
return eval_phi_minus_lc;
}
void TLSSolver::saveStep(int step) {
OldAndCurrent_c::old();
post_pro.saveField("old_phi", step, field, geom.getRegion("tls"));
OldAndCurrent_c::current();
post_pro.saveField("phi", step, field, geom.getRegion("tls"));
}
void TLSSolver::restoreStep(PreProcessing& pre_pro) {
Observer::listen("step", pre_pro.getStep());
auto integ_rule=geom.getIntegRuleBasic(0);
auto begin=geom.begin("tls");
auto end=geom.end("tls");