Commit 6231f847 authored by Gilles MARCKMANN's avatar Gilles MARCKMANN

Takes into account last namespace changes.

parent 01989b7f
......@@ -30,8 +30,8 @@ define_archos_suffixe(ARCHOS)
find_package(xTools REQUIRED)
find_package(xAOMDInterfaceGeneral REQUIRED)
find_package(xTool REQUIRED)
find_package(xInterfaceAOMDGeneral REQUIRED)
find_package(xDistMesh REQUIRED )
find_package(Trellis REQUIRED )
find_package(xSolverBase REQUIRED )
......@@ -53,8 +53,8 @@ find_package(METIS REQUIRED )
file(GLOB SOURCES src/*)
list(APPEND EXTERNAL_INCLUDES
${xTools_INCLUDE_DIR}
${xAOMDInterfaceGeneral_INCLUDE_DIR}
${xTool_INCLUDE_DIR}
${xInterfaceAOMDGeneral_INCLUDE_DIR}
${xDistMesh_INCLUDE_DIR}
${Trellis_INCLUDE_DIR}
${xSolverBase_INCLUDE_DIR}
......@@ -90,7 +90,7 @@ list(APPEND EXTERNAL_LIBRARIES
${METIS_LIBRARIES}
${ANN_LIBRARIES}
${xDistMesh_LIBRARIES}
${xTools_LIBRARIES}
${xTool_LIBRARIES}
${MPI_CXX_LIBRARIES}
${CGAL_LIBRARIES}
)
......
......@@ -19,8 +19,8 @@
#include "xGenericSparseMatrix.h"
#include "xGenericSparseMatrixTraitPolicy.h"
namespace lalg {
typedef xGenericSparseMatrix<double,
namespace xlinalg {
typedef xlinalg::xGenericSparseMatrix<double,
xTraitMatrixNonSingular,
xTraitMatrixUnSym,
xTraitMatrixSparceCSC,
......@@ -28,7 +28,7 @@ namespace lalg {
}
using namespace xfem;
using namespace lalg;
// using namespace xlinalg;
using Trellis_Util::mPoint;
using AOMD::mEntity;
using AOMD::mVertex;
......@@ -103,7 +103,7 @@ int main(int argc, char* argv[]) {
vals[0]->setVal(1.*level_set(*it));
}
xEvalField<xtools::xIdentity<double> > eval_field(field);
xEvalField<xtool::xIdentity<double> > eval_field(field);
xIntegrationRuleBasic integ_rule(1);
xexport::xExportGmshAscii pexport;
Export(eval_field, pexport, "phi_given", integ_rule, all.begin(), all.end());
......@@ -145,7 +145,7 @@ int main(int argc, char* argv[]) {
Export(eval_one, pexport, "interior_in", integ_rule, interior_in.begin(), interior_in.end());
// modes creation
xDenseMatrix coeffs(bnd_in.size(0), region.size(0));
xlinalg::xDenseMatrix coeffs(bnd_in.size(0), region.size(0));
FastMarchingModeExtension([&field](mVertex* v){ std::vector<double> vals; field.getVals(v, vals); return vals[0]; },
[&field](mVertex* v, double val){ field.setVal(v, val); },
region,
......
......@@ -7,6 +7,8 @@
#ifndef _FastMarchingInterface_h_
#define _FastMarchingInterface_h_
// Xfem
#include "xRegion.h"
//
......@@ -75,9 +77,9 @@ void FastMarchingReinit(std::function<double (AOMD::mVertex*)> get_val,
std::cout << "FastMarchingReinit requires HAVE_FASTMARCHING defined to work" << std::endl;
throw;
#else
meshinterfacexRegion mi(region);
entitystorage<meshinterfacexRegion, AOMD::mVertex, double> ls(mi);
entitystorage<meshinterfacexRegion, AOMD::mVertex, vector3d<double> > gls(mi);
xfastmarching::meshinterfacexRegion mi(region);
xfastmarching::entitystorage<xfastmarching::meshinterfacexRegion, AOMD::mVertex, double> ls(mi);
xfastmarching::entitystorage<xfastmarching::meshinterfacexRegion, AOMD::mVertex, xfastmarching::vector3d<double> > gls(mi);
for(auto it=known_begin; it!=known_end; ++it) {
auto v=static_cast<AOMD::mVertex*>(*it);
ls.set(*v, get_val(v));
......@@ -89,12 +91,12 @@ void FastMarchingReinit(std::function<double (AOMD::mVertex*)> get_val,
for(auto it=tofind_begin; it!=tofind_end; ++it) {
ls.set(*static_cast<AOMD::mVertex*>(*it), std::numeric_limits<double>::max());
}
entitytovertexiteratorconvertor<ITERKNOWN> trial_known_conv_begin(known_begin);
entitytovertexiteratorconvertor<ITERKNOWN> trial_known_conv_end(known_end);
entitytovertexiteratorconvertor<ITERKNOWNV> trial_known_volatil_conv_begin(known_volatil_begin);
entitytovertexiteratorconvertor<ITERKNOWNV> trial_known_volatil_conv_end(known_volatil_end);
entitytovertexiteratorconvertor<ITERKNOWNT> known_conv_it(known_it);
fmeik(mi, ls, trial_known_conv_begin, trial_known_conv_end,trial_known_volatil_conv_begin, trial_known_volatil_conv_end, known_conv_it, f_func, epsilon_ratio, gls);
xfastmarching::entitytovertexiteratorconvertor<ITERKNOWN> trial_known_conv_begin(known_begin);
xfastmarching::entitytovertexiteratorconvertor<ITERKNOWN> trial_known_conv_end(known_end);
xfastmarching::entitytovertexiteratorconvertor<ITERKNOWNV> trial_known_volatil_conv_begin(known_volatil_begin);
xfastmarching::entitytovertexiteratorconvertor<ITERKNOWNV> trial_known_volatil_conv_end(known_volatil_end);
xfastmarching::entitytovertexiteratorconvertor<ITERKNOWNT> known_conv_it(known_it);
xfastmarching::fmeik(mi, ls, trial_known_conv_begin, trial_known_conv_end,trial_known_volatil_conv_begin, trial_known_volatil_conv_end, known_conv_it, f_func, epsilon_ratio, gls);
for(auto it=region.begin(0); it!=region.end(0); ++it) {
auto v=static_cast<AOMD::mVertex*>(*it);
double val;
......@@ -119,10 +121,10 @@ void FastMarchingModeExtension(std::function<double (AOMD::mVertex*)> get_val,
std::cout << "FastMarchingModeExtension requires HAVE_FASTMARCHING defined to work" << std::endl;
throw;
#else
meshinterfacexRegion mi(region);
entitystorage<meshinterfacexRegion, AOMD::mVertex, double> ls(mi);
entitystorage<meshinterfacexRegion, AOMD::mVertex, vector3d<double> > gls(mi);
entitystorage<meshinterfacexRegion, AOMD::mVertex, modesValues> vn(mi);
xfastmarching::meshinterfacexRegion mi(region);
xfastmarching::entitystorage<xfastmarching::meshinterfacexRegion, AOMD::mVertex, double> ls(mi);
xfastmarching::entitystorage<xfastmarching::meshinterfacexRegion, AOMD::mVertex, xfastmarching::vector3d<double> > gls(mi);
xfastmarching::entitystorage<xfastmarching::meshinterfacexRegion, AOMD::mVertex, modesValues> vn(mi);
const int nb_modes=coeffs.nline();
int i=0;
for(auto it=known_begin; it!=known_end; ++it, ++i) {
......@@ -136,13 +138,13 @@ void FastMarchingModeExtension(std::function<double (AOMD::mVertex*)> get_val,
ls.set(*static_cast<AOMD::mVertex*>(*it), std::numeric_limits<double>::max());
}
const std::set<const AOMD::mVertex*> empty;
entitytovertexiteratorconvertor<ITERKNOWN> known_conv_begin(known_begin);
entitytovertexiteratorconvertor<ITERKNOWN> known_conv_end(known_end);
entitytovertexiteratorconvertor< std::set<const AOMD::mVertex*>::const_iterator> known_volatil_conv_begin(empty.begin());
entitytovertexiteratorconvertor< std::set<const AOMD::mVertex*>::const_iterator> known_volatil_conv_end(empty.end());
xfastmarching::entitytovertexiteratorconvertor<ITERKNOWN> known_conv_begin(known_begin);
xfastmarching::entitytovertexiteratorconvertor<ITERKNOWN> known_conv_end(known_end);
xfastmarching::entitytovertexiteratorconvertor< std::set<const AOMD::mVertex*>::const_iterator> known_volatil_conv_begin(empty.begin());
xfastmarching::entitytovertexiteratorconvertor< std::set<const AOMD::mVertex*>::const_iterator> known_volatil_conv_end(empty.end());
std::vector<const AOMD::mVertex*> vec;
vec.reserve(nb_modes);
entitytovertexiteratorconvertor<std::back_insert_iterator<std::vector<const AOMD::mVertex*>>> dummy_it(std::back_inserter(vec));
xfastmarching::entitytovertexiteratorconvertor<std::back_insert_iterator<std::vector<const AOMD::mVertex*>>> dummy_it(std::back_inserter(vec));
fmeik(mi, ls, known_conv_begin, known_conv_end,known_volatil_conv_begin, known_volatil_conv_end, dummy_it, f_func, epsilon_ratio, gls, vn);
int j=0;
for(auto it=region.begin(0); it!=region.end(0); ++it, ++j) {
......
......@@ -93,7 +93,7 @@ void Formulation::transferDispField(double coeff) {
deleteDispField("int_fds");
applyEssentialEnv(coeff);
declareDofs();
xEvalField<xtools::xIdentity<xtensor::xVector> > eval_disp_field(disp_field);
xEvalField<xtool::xIdentity<xtensor::xVector> > eval_disp_field(disp_field);
post_pro.exportOnSpace("transfered_disp", Observer::tell<int>("step"), eval_disp_field, geom.getIntegRuleBasic(0), geom.begin(), geom.end());
}
......@@ -163,15 +163,15 @@ void Formulation::writeCurrentToOldMaterialVariables() {
ApplyCommandOnIntegrationRule(visit_command, geom.getIntegRuleSmart(), geom.begin(), geom.end());
}
void Formulation::readDisp(lalg::xCSRVector& vec) {
void Formulation::readDisp(xlinalg::xCSRVector& vec) {
Visit(xReadVectorVisitor<>(vec.begin()), double_manager.begin(dofs), double_manager.end(dofs));
}
void Formulation::writeDisp(const lalg::xCSRVector& vec) {
void Formulation::writeDisp(const xlinalg::xCSRVector& vec) {
Visit(xWriteSolutionVisitor<>(vec.begin()), double_manager.begin(dofs), double_manager.end(dofs));
}
void Formulation::addDisp(const lalg::xCSRVector& vec) {
void Formulation::addDisp(const xlinalg::xCSRVector& vec) {
Visit(xAddSolutionVisitor<>(vec.begin()), double_manager.begin(dofs), double_manager.end(dofs));
}
......@@ -196,7 +196,7 @@ void Formulation::assembleStiffnessMatrix(LinearSystem& system, std::string matr
void Formulation::assembleMassMatrix(LinearSystem& system) {
xUniformMaterialSensitivity<double> eval_density("density");
xFormBilinearWithLaw<xValOperator<xtools::xIdentity<xtensor::xVector>>, xEval<double>, xValOperator<xtools::xIdentity<xtensor::xVector>>> form_bilinear(eval_density);
xFormBilinearWithLaw<xValOperator<xtool::xIdentity<xtensor::xVector>>, xEval<double>, xValOperator<xtool::xIdentity<xtensor::xVector>>> form_bilinear(eval_density);
Assemble(form_bilinear, system.getAssemblerLumpedEqu(), geom.getIntegRuleSmart(), disp_field, disp_field, geom.begin(), geom.end());
}
......@@ -220,16 +220,16 @@ void Formulation::assembleNaturalEnv(LinearSystem& system) {
else if(phys[9]=='Y') { val(1)=env.getValue(); }
else if(phys[9]=='Z') { val(2)=env.getValue(); }
xEvalConstant<xtensor::xVector> flux(val);
xFormLinearWithLoad<xValOperator<xtools::xIdentity<xtensor::xVector> >, xEvalConstant<xtensor::xVector> > lin(flux);
xFormLinearWithLoad<xValOperator<xtool::xIdentity<xtensor::xVector> >, xEvalConstant<xtensor::xVector> > lin(flux);
xClassRegion bc(&mesh, env.Entity, env.getDimension());
Assemble(lin, system.getAssembler(), geom.getIntegRuleBasic(bc_integ_order), disp_field, bc.begin(), bc.end(), xUpperAdjacency());
}
else if(phys=="PRESSURE") {
assert(env.Type==FIX || env.Type==FIX_AND_MEASURE);
xEvalNormal eval_normal;
xtools::xScale<xtensor::xVector> scale(env.getValue());
xEvalUnary<xtools::xScale<xtensor::xVector> > eval_pressure(scale, eval_normal);
xFormLinearWithLoad<xValOperator<xtools::xIdentity<xtensor::xVector> >, xEval<xtensor::xVector> > lin(eval_pressure);
xtool::xScale<xtensor::xVector> scale(env.getValue());
xEvalUnary<xtool::xScale<xtensor::xVector> > eval_pressure(scale, eval_normal);
xFormLinearWithLoad<xValOperator<xtool::xIdentity<xtensor::xVector> >, xEval<xtensor::xVector> > lin(eval_pressure);
xClassRegion bc(&mesh, env.Entity, env.getDimension());
Assemble(lin, system.getAssembler(), geom.getIntegRuleBasic(bc_integ_order), disp_field, bc.begin(), bc.end(), xUpperAdjacency());
}
......@@ -244,8 +244,8 @@ void Formulation::assembleNaturalEnv(LinearSystem& system) {
else if(phys[7]=='Z' && phys[8]=='Z') { val(2,2)=env.getValue(); }
xEvalNormal eval_normal;
xEvalConstant<xtensor::xTensor2> eval_stress(val);
xEvalBinary<xtools::xMult<xtensor::xTensor2, xtensor::xVector, xtensor::xVector> > eval_traction(eval_stress, eval_normal);
xFormLinearWithLoad<xValOperator<xtools::xIdentity<xtensor::xVector> >, xEval<xtensor::xVector> > lin(eval_traction);
xEvalBinary<xtool::xMult<xtensor::xTensor2, xtensor::xVector, xtensor::xVector> > eval_traction(eval_stress, eval_normal);
xFormLinearWithLoad<xValOperator<xtool::xIdentity<xtensor::xVector> >, xEval<xtensor::xVector> > lin(eval_traction);
xClassRegion bc(&mesh, env.Entity, env.getDimension());
Assemble(lin, system.getAssembler(), geom.getIntegRuleBasic(bc_integ_order), disp_field, bc.begin(), bc.end(), xUpperAdjacency());
}
......@@ -309,7 +309,7 @@ void Formulation::exportStep(int step) {
}
CustomValueDoubleSelector::which_val=size_disp_value;
xEvalField<xtools::xIdentity<xtensor::xVector> > eval_disp(disp_field);
xEvalField<xtool::xIdentity<xtensor::xVector> > eval_disp(disp_field);
post_pro.exportOnSpace("disp", step, eval_disp, integ_rule, begin, end);
post_pro.exportOnSpace("disp_basic", step, eval_disp, geom.getIntegRuleBasic(0), begin, end);
post_pro.exportOnTime("disp", step, eval_disp);
......
......@@ -21,7 +21,7 @@ namespace xtls {
class xEvalTLSDamageFunction;
}
class xParseData;
namespace lalg {
namespace xlinalg {
class xCSRVector;
}
......@@ -89,14 +89,14 @@ public:
// gives the prescribed value from main.dat.
virtual void applyEssentialEnv(double);
// Reads from disp field dof values to xCSRVector.
void readDisp(lalg::xCSRVector&);
// Reads from disp field dof values to xlinalg::xCSRVector.
void readDisp(xlinalg::xCSRVector&);
// Writes to disp field dof values from xCSRVector.
void writeDisp(const lalg::xCSRVector&);
// Writes to disp field dof values from xlinalg::xCSRVector.
void writeDisp(const xlinalg::xCSRVector&);
// Appends to disp field dof values from xCSRVector.
void addDisp(const lalg::xCSRVector&);
// Appends to disp field dof values from xlinalg::xCSRVector.
void addDisp(const xlinalg::xCSRVector&);
// Export function
void exportStep(int);
......
......@@ -26,7 +26,7 @@
#include "NonUniformMaterialSensitivity.h"
using namespace xfem;
using namespace lalg;
// using namespace xlinalg;
using namespace xtls;
DynFormulation::DynFormulation(TLSGeom& geom, TLSSolver& tls_solver,
......@@ -52,13 +52,13 @@ DynFormulation::DynFormulation(TLSGeom& geom, TLSSolver& tls_solver,
tls_solver.registerMeanVector("mean_Dd");
}
void DynFormulation::readSpeed(lalg::xCSRVector& vec) {
void DynFormulation::readSpeed(xlinalg::xCSRVector& vec) {
CustomValueDoubleSelector::which_val=1;
readDisp(vec);
CustomValueDoubleSelector::which_val=0;
}
void DynFormulation::writeSpeed(const lalg::xCSRVector& vec) {
void DynFormulation::writeSpeed(const xlinalg::xCSRVector& vec) {
CustomValueDoubleSelector::which_val=1;
writeDisp(vec);
CustomValueDoubleSelector::which_val=0;
......@@ -105,10 +105,10 @@ void DynFormulation::computeLSAdvanceMeanFields() {
void DynFormulation::computeDeltaLevelSetField(double time_step) {
OldAndCurrent_c::current();
const xCSRVector& Y=tls_solver.getMeanVector("mean_Y");
const xCSRVector& Yc=tls_solver.getMeanVector("mean_Yc");
const xCSRVector& Dd=tls_solver.getMeanVector("mean_Dd");
xCSRVector& delta_phi=tls_solver.getMeanVector("delta_phi");
const xlinalg::xCSRVector& Y=tls_solver.getMeanVector("mean_Y");
const xlinalg::xCSRVector& Yc=tls_solver.getMeanVector("mean_Yc");
const xlinalg::xCSRVector& Dd=tls_solver.getMeanVector("mean_Dd");
xlinalg::xCSRVector& delta_phi=tls_solver.getMeanVector("delta_phi");
xfem::xGeomElem geo_integ(*geom.begin());// this is a hack to get the (unique) material.
xUniformMaterialSensitivity<double> eval_celerity("rayleigh_celerity");
double cr;
......
......@@ -18,8 +18,8 @@ public:
DynFormulation(TLSGeom&, TLSSolver&,
const xfem::xData&, const xParseData&,
PreProcessing&, PostProcessing&);
void readSpeed(lalg::xCSRVector&);
void writeSpeed(const lalg::xCSRVector&);
void readSpeed(xlinalg::xCSRVector&);
void writeSpeed(const xlinalg::xCSRVector&);
void updateCurrentState(double, double);
double getTimeStep() const;
......
......@@ -28,7 +28,7 @@
#include "NonUniformMaterialSensitivity.h"
using namespace xfem;
using namespace lalg;
// using namespace xlinalg;
QSFormulation::QSFormulation(TLSGeom& geom, TLSSolver& tls_solver,
const xData& data, const xParseData& parse_data,
......@@ -307,13 +307,13 @@ void QSFormulation::cutCrack() {
declareDispMeasField();
}
void QSFormulation::writeDisp(const xCSRVector& vec, std::string name) {
void QSFormulation::writeDisp(const xlinalg::xCSRVector& vec, std::string name) {
selectValueDouble(name);
Formulation::writeDisp(vec);
selectValueDouble("disp_ref");
}
void QSFormulation::addDisp(const xCSRVector& vec, std::string name) {
void QSFormulation::addDisp(const xlinalg::xCSRVector& vec, std::string name) {
selectValueDouble(name);
Formulation::addDisp(vec);
selectValueDouble("disp_ref");
......@@ -326,7 +326,7 @@ void QSFormulation::writeCurrentToOld() {
xtensor::xVector QSFormulation::computeRefForce() {
const int nb_dofs = double_manager_meas.size(dofs);
xCSRVector Fint(nb_dofs);
xlinalg::xCSRVector Fint(nb_dofs);
xAssemblerBasic<> assembler_Fint(Fint);
NonUniformMaterialSensitivity_c<xtensor::xTensor2> eval_stress("stress_ref", variab_manager);
xFormLinearWithLoad<xGradOperator<xtensor::xSymmetrize>, xEval<xtensor::xTensor2>> form_linear(eval_stress);
......@@ -399,9 +399,9 @@ xtensor::xVector QSFormulation::computeRefDisp() {
xClassRegion bc(&mesh, env.Entity, env.getDimension());
xtensor::xVector vec;
vec(i)=1.;
xEvalField<xtools::xIdentity<xtensor::xVector> > eval_disp(disp_field);
xEvalField<xtool::xIdentity<xtensor::xVector> > eval_disp(disp_field);
xEvalConstant<xtensor::xVector> eval_dir(vec);
xEvalBinary<xtools::xMult<xtensor::xVector, xtensor::xVector, double> > eval(eval_disp, eval_dir);
xEvalBinary<xtool::xMult<xtensor::xVector, xtensor::xVector, double> > eval(eval_disp, eval_dir);
xIntegrateEvalCommand<xEval<double> > command(eval, ref_disp(i));
ApplyCommandOnIntegrationRule(command, geom.getIntegRuleBasic(), bc.begin(), bc.end());
}
......@@ -438,7 +438,7 @@ bool QSFormulation::exportStep(int step) {
SmoothApproNonUniformMaterialSensitivity_c<xtensor::xTensor2> eval(str, variab_manager);
post_pro.exportOnSpace(str, step, eval, geom.getIntegRuleSmart(), begin, end);
}
xEvalField<xtools::xIdentity<xtensor::xVector> > eval_disp(disp_field);
xEvalField<xtool::xIdentity<xtensor::xVector> > eval_disp(disp_field);
post_pro.exportOnSpace("disp_ref", step, eval_disp, integ_rule, begin, end);
post_pro.exportOnSpace("disp_ref_basic", step, eval_disp, geom.getIntegRuleBasic(0), begin, end);
......@@ -507,7 +507,7 @@ void QSFormulation::saveStep(int step) {
void QSFormulation::restoreStep(PreProcessing& pre_pro) {
pre_pro.loadField("disp", geom.getMesh(), disp_field);
xEvalField<xtools::xIdentity<xtensor::xVector> > eval_disp(disp_field);
xEvalField<xtool::xIdentity<xtensor::xVector> > eval_disp(disp_field);
post_pro.exportOnSpace("restored_disp_basic", pre_pro.getStep(), eval_disp, geom.getIntegRuleBasic(0), geom.begin(), geom.end());
tls_solver.swapOldAndCurrentLevelSetField();
updateMaterialVariables(tls_solver.getDamageEval());
......
......@@ -31,12 +31,12 @@ public:
// Computes load factor
double computeLoadFactor();
// Writes to disp field dof values from xCSRVector, a specific
// Writes to disp field dof values from xlinalg::xCSRVector, a specific
// disp field is selected by the string
void writeDisp(const lalg::xCSRVector&, std::string);
void writeDisp(const xlinalg::xCSRVector&, std::string);
// Appends to disp field dof values from xCSRVector.
void addDisp(const lalg::xCSRVector&, std::string);
// Appends to disp field dof values from xlinalg::xCSRVector.
void addDisp(const xlinalg::xCSRVector&, std::string);
// Writes current values of level set field and material variables
// to old values
......
......@@ -58,7 +58,6 @@
#endif
using namespace xfem;
using namespace lalg;
QSFormulRemeshAniso::QSFormulRemeshAniso(TLSGeom& geom, TLSSolver& tls_solver,
const xData& data, const xParseData& parse_data,
......@@ -321,17 +320,17 @@ void QSFormulRemeshAniso::buildLSAdaptationField(){
// xRegion targetRegion = geom.getRegion("nonlocal");
meshinterfacexRegion mi(targetRegion);
entitystorage<meshinterfacexRegion, AOMD::mVertex, double> ls(mi);
xfastmarching::meshinterfacexRegion mi(targetRegion);
xfastmarching::entitystorage<xfastmarching::meshinterfacexRegion, AOMD::mVertex, double> ls(mi);
entitytovertexiteratorconvertor<xIter> known_conv_begin(sm_bnd_nonlocal.begin(0));
entitytovertexiteratorconvertor<xIter> known_conv_end(sm_bnd_nonlocal.end(0));
xfastmarching::entitytovertexiteratorconvertor<xIter> known_conv_begin(sm_bnd_nonlocal.begin(0));
xfastmarching::entitytovertexiteratorconvertor<xIter> known_conv_end(sm_bnd_nonlocal.end(0));
// entitytovertexiteratorconvertor<xIter> tofind_conv_begin(geom.begin(0));
// entitytovertexiteratorconvertor<xIter> tofind_conv_end(geom.end(0));
entitytovertexiteratorconvertor<xIter> tofind_conv_begin(geom.begin(0, "local"));
entitytovertexiteratorconvertor<xIter> tofind_conv_end(geom.end(0, "local"));
xfastmarching::entitytovertexiteratorconvertor<xIter> tofind_conv_begin(geom.begin(0, "local"));
xfastmarching::entitytovertexiteratorconvertor<xIter> tofind_conv_end(geom.end(0, "local"));
std::function<double (const AOMD::mVertex&)> fmFunction = [](const mEntity& v) { return 1.; };
......@@ -352,8 +351,8 @@ void QSFormulRemeshAniso::buildLSAdaptationField(){
//fmeik(mi, ls, known_conv_begin, known_conv_end, tofind_conv_begin, tofind_conv_end, fmFunction);
std::cout<<"size of int_nonlocal "<<std::distance(geom.begin(0, "int_nonlocal"), geom.end(0, "int_nonlocal"))<<std::endl;
entitytovertexiteratorconvertor<xIter> tofind_conv_begin2(geom.begin(0, "int_nonlocal"));
entitytovertexiteratorconvertor<xIter> tofind_conv_end2(geom.end(0, "int_nonlocal"));
xfastmarching::entitytovertexiteratorconvertor<xIter> tofind_conv_begin2(geom.begin(0, "int_nonlocal"));
xfastmarching::entitytovertexiteratorconvertor<xIter> tofind_conv_end2(geom.end(0, "int_nonlocal"));
//TODO
// fmeik(mi, ls, known_conv_begin, known_conv_end, tofind_conv_begin2, tofind_conv_end2, fmFunction);
......@@ -498,9 +497,9 @@ void QSFormulRemeshAniso::remesh() {
//xMesh* meshForRemeshing=&geom.getMesh();
//Misc evaluators
xEvalField<xtools::xIdentity<xtensor::xVector> > eval_disp(disp_field);
xEvalField<xtool::xIdentity<xtensor::xVector> > eval_disp(disp_field);
xEvalGradField<xtensor::xSymmetrize> eval_strain(disp_field);
xEvalLevelSet<xtools::xIdentity<double> > eval_lsetAdapt(lsetAdapt);
xEvalLevelSet<xtool::xIdentity<double> > eval_lsetAdapt(lsetAdapt);
//Adapters for the evaluators that are defined on geom.getMesh, but exported on meshForRemeshing (backupMesh)
xEvalOnOtherMesh<double> eval_phi_on_backupMesh(tls_solver.getPhiEval(),geom.getMesh() );
......@@ -613,7 +612,7 @@ void QSFormulRemeshAniso::remesh() {
xReadFromParaview(entree,"deplacement",disp_field,*mesh);
disp_field.getDoubleManager()->PrintForDebug("aft_read_disp.dbg");
xEvalField<xtools::xIdentity<xtensor::xVector> > eval_disp1(disp_field);
xEvalField<xtool::xIdentity<xtensor::xVector> > eval_disp1(disp_field);
//xEvalConstant<double> eval_disp_(1.);
post_pro.exportOnSpace("read_disp", Observer::tell<int>("step"), eval_disp1, geom.getIntegRuleSmart(), geom.begin(), geom.end());
......@@ -622,7 +621,7 @@ void QSFormulRemeshAniso::remesh() {
// xexport::xPostProVTU postProVTU2(mesh);
// postProVTU2.openFile("DispRead.vtu");
// xEvalField<xtools::xIdentity<xtensor::xVector> > eval_disp2(disp_field);
// xEvalField<xtool::xIdentity<xtensor::xVector> > eval_disp2(disp_field);
// postProVTU2.exportVectorAtNode(eval_disp2,"deplacement");
// postProVTU2.closeFile();
......@@ -751,7 +750,7 @@ void QSFormulRemeshAniso::remesh() {
std::list<AOMD::mEntity*> QSFormulRemeshAniso::constructDelocalizedList(xLevelSet &lsetAdapt) {
std::list<AOMD::mEntity*> delocalized_list;
xEvalLevelSet<xtools::xIdentity<double> > eval_chi(lsetAdapt);
xEvalLevelSet<xtool::xIdentity<double> > eval_chi(lsetAdapt);
post_pro.exportOnSpace("lsAdapt_computed_eval",Observer::tell<int>("step"),eval_chi,geom.getIntegRuleBasic(0), geom.begin("tls"), geom.end("tls"));
LocateHotPointsCommand locate_hot_points(eval_chi, 0., delocalized_list);
ApplyCommandOnIntegrationRule(locate_hot_points, geom.getIntegRuleBasic(0), geom.begin("tls"), geom.end("tls"));
......
......@@ -42,15 +42,15 @@ public:
void QSFormulationSuperimposed::assembleNaturalEnv(LinearSystem& system) {
NonUniformMaterialSensitivity_c<xtensor::xTensor4> eval_stiffness("secant_matrix", variab_manager);
xEvalBinary<xtools::xMult<xtensor::xTensor4, xtensor::xTensor2, xtensor::xTensor2>> eval_stress(eval_stiffness, eval_strain_superimposed);
xEvalBinary<xtool::xMult<xtensor::xTensor4, xtensor::xTensor2, xtensor::xTensor2>> eval_stress(eval_stiffness, eval_strain_superimposed);
xFormLinearWithLoad<xGradOperator<xtensor::xSymmetrize>, xEval<xtensor::xTensor2> > form_linear(eval_stress);
xFilteredRegion<xIter, xEntityFilter> superimposed(geom.begin(), geom.end(), xAcceptOnZoneID(101));
system.setAssemblerCoeff(-1.);
Assemble(form_linear, system.getAssembler(), geom.getIntegRuleSmart(), disp_field, superimposed.begin(), superimposed.end());
system.setAssemblerCoeff(1.);
MyNormal eval_normal;
xEvalBinary<xtools::xMult<xtensor::xTensor2, xtensor::xVector, xtensor::xVector> > eval_traction(eval_stress_superimposed, eval_normal);
xFormLinearWithLoad<xValOperator<xtools::xIdentity<xtensor::xVector> >, xEval<xtensor::xVector> > lin(eval_traction);
xEvalBinary<xtool::xMult<xtensor::xTensor2, xtensor::xVector, xtensor::xVector> > eval_traction(eval_stress_superimposed, eval_normal);
xFormLinearWithLoad<xValOperator<xtool::xIdentity<xtensor::xVector> >, xEval<xtensor::xVector> > lin(eval_traction);
xClassRegion bc(&geom.getMesh(), 12, 1);
Assemble(lin, system.getAssembler(), geom.getIntegRuleBasic(bc_integ_order), disp_field, bc.begin(), bc.end(), xUpperAdjacency());
}
......
......@@ -119,7 +119,7 @@ PreProcessing::PreProcessing(std::string archive_filename) :
// tar file in future may/will be dispatched or not
// ideal : archive dispatched , read in // , following load balancing information restart information are dispatched on new set of proc
assert(xtools::workInProgress());
assert(xtool::workInProgress());
if(system(NULL)==0) {
......
......@@ -48,7 +48,7 @@ void IntegrationPointCreator::operator()(mEntity* e_appro) const {
std::vector<Trellis_Util::mPoint> points;
points.reserve(nb_gauss_points);
lalg::xDenseMatrix mat(nb_gauss_points, nb_gauss_points);
xlinalg::xDenseMatrix mat(nb_gauss_points, nb_gauss_points);
for(int k=0; k<nb_gauss_points; ++k) {
geo_appro.setUVW(k);
const Trellis_Util::mPoint& uvw=geo_appro.getUVW();
......@@ -79,7 +79,7 @@ void IntegrationPointCreator::operator()(mEntity* e_appro) const {
std::vector<mEntity*> partition;
AddFromPartition(partition_tag, partition)(e_appro);
lalg::xCSRVector vec(nb_gauss_points);
xlinalg::xCSRVector vec(nb_gauss_points);
for(auto ep: partition) {
xfem::xGeomElem geo_integ(ep);
geo_integ.SetIntegrationPointNumberForDegree(rhs_degree);
......@@ -114,7 +114,7 @@ void IntegrationPointCreator::operator()(mEntity* e_appro) const {
}
}
lalg::xCSRVector weights(nb_gauss_points);
xlinalg::xCSRVector weights(nb_gauss_points);
solve(mat, vec, weights);
xAttachableGaussPoints* att=new xAttachableGaussPoints;
......
......@@ -13,19 +13,19 @@
#include "xGraphMatrix.h"
using namespace xfem;
using namespace lalg;
// using namespace xlinalg;
void LinearSystem::declareVector(std::string name, int dim) {
std::map<std::string, xCSRVector*>::const_iterator found=vectors.find(name);
std::map<std::string, xlinalg::xCSRVector*>::const_iterator found=vectors.find(name);
if(found!=vectors.end()) {
std::cout<<"Error: vector already declared"<<std::endl;
std::abort();
}
vectors.insert(std::make_pair(name, new xCSRVector(dim)));
vectors.insert(std::make_pair(name, new xlinalg::xCSRVector(dim)));
}
const lalg::xCSRVector& LinearSystem::getVector(std::string name) const {
std::map<std::string, xCSRVector*>::const_iterator found=vectors.find(name);
const xlinalg::xCSRVector& LinearSystem::getVector(std::string name) const {
std::map<std::string, xlinalg::xCSRVector*>::const_iterator found=vectors.find(name);
if(found==vectors.end()) {
std::cout<<"Error: vector not declared"<<std::endl;
std::abort();
......@@ -33,8 +33,8 @@ const lalg::xCSRVector& LinearSystem::getVector(std::string name) const {
return *(found->second);
}
lalg::xCSRVector& LinearSystem::getVector(std::string name) {
std::map<std::string, xCSRVector*>::iterator found=vectors.find(name);
xlinalg::xCSRVector& LinearSystem::getVector(std::string name) {
std::map<std::string, xlinalg::xCSRVector*>::iterator found=vectors.find(name);
if(found==vectors.end()) {
std::cout<<"Error: vector not declared"<<std::endl;
std::abort();
......@@ -46,7 +46,7 @@ double LinearSystem::getVectorNorm(std::string name) const {
return getVector(name).two_norm();
}
void LinearSystem::writeVector(const lalg::xCSRVector& vector, std::string name) {
void LinearSystem::writeVector(const xlinalg::xCSRVector& vector, std::string name) {
getVector(name)=vector;
}
......@@ -64,7 +64,7 @@ void LinearSystem::solve(std::string rhs_name, std::string sol_name) {
}
void LinearSystem::emplaceDiagSolve(std::string name) {
xCSRVector& vec=getVector(name);
xlinalg::xCSRVector& vec=getVector(name);
int size=vec.size();
int nnz=matrix->getNNZ();
int* index1;
......@@ -77,7 +77,7 @@ void LinearSystem::emplaceDiagSolve(std::string name) {
}
void LinearSystem::axpy(double a, std::string x_name, std::string y_name) {
lalg::axpy(a, getVector(x_name), getVector(y_name));
xlinalg::axpy(a, getVector(x_name), getVector(y_name));
}
void LinearSystem::initAssembler(std::string name) {
......@@ -104,9 +104,9 @@ LinearSystem::LinearSystem() :
has_graph(true), is_connected(false) {
#ifdef MUMPS
// Solver options
solver.setParam(xLinearSystemSolverMumpsBase::ICNTL,25,0);// Resolution even if null-space (0 = default value)
solver.setParam(xLinearSystemSolverMumpsBase::ICNTL,24,1);// Detection of null-space
solver.setParam(xLinearSystemSolverMumpsBase::CNTL,3,0.);// Tol for null pivot
solver.setParam(xlinalg::xLinearSystemSolverMumpsBase::ICNTL,25,0);// Resolution even if null-space (0 = default value)
solver.setParam(xlinalg::xLinearSystemSolverMumpsBase::ICNTL,24,1);// Detection of null-space
solver.setParam(xlinalg::xLinearSystemSolverMumpsBase::CNTL,3,0.);// Tol for null pivot
#endif
}
......@@ -115,7 +115,7 @@ LinearSystem::~LinearSystem() {
}
void LinearSystem::initGraph(int dim) {
graph=new xGraphMatrix(dim, dim, is_sym);
graph=new xlinalg::xGraphMatrix(dim, dim, is_sym);
}
void LinearSystem::declareMatrix(int dim) {
......@@ -154,7 +154,7 @@ void LinearSystem::clear() {
delete graph;
graph=nullptr;
}
for(std::map<std::string, xCSRVector*>::iterator it=vectors.begin();
for(std::map<std::string, xlinalg::xCSRVector*>::iterator it=vectors.begin();
it!=vectors.end(); ++it) {
delete it->second;
}
......
......@@ -21,7 +21,7 @@
#include "xInitMPI.h"
#endif
namespace lalg {
namespace xlinalg {
class xGraphMatrix;
class xCSRVector;
}
......@@ -29,8 +29,8 @@ class xCSRVector;
class LinearSystem {
public:
#ifdef TAUCS
typedef lalg::xLinearSystemSolverTaucs<> Solver_t;
typedef lalg::xGenericSparseMatrix<double,
typedef xlinalg::xLinearSystemSolverTaucs<> Solver_t;
typedef xlinalg::xGenericSparseMatrix<double,
xTraitMatrixDefinitePositive,
xTraitMatrixLowerSym,
Solver_t::matrix_storage,
......@@ -38,8 +38,8 @@ public:
static const bool is_sym=true;
#endif
#ifdef MUMPS
typedef lalg::xLinearSystemSolverMumpsDistributed<> Solver_t;
typedef lalg::xGenericSparseMatrix<double,
typedef xlinalg::xLinearSystemSolverMumpsDistributed<> Solver_t;
typedef xlinalg::xGenericSparseMatrix<double,
xTraitMatrixDefinitePositive,
xTraitMatrixLowerSym,
Solver_t::matrix_storage,
......@@ -47,16 +47,16 @@ public:
static const bool is_sym=true;
#endif
#ifdef SUPERLU
typedef lalg::xLinearSystemSolverSuperLU<> Solver_t;
typedef lalg::xGenericSparseMatrix<double,
typedef xlinalg::xLinearSystemSolverSuperLU<> Solver_t;
typedef xlinalg::xGenericSparseMatrix<double,
xTraitMatrixNonSingular,
xTraitMatrixUnSym,
Solver_t::matrix_storage,
Solver_t::matrix_indexing> Matrix_t;
static const bool is_sym=false;
#endif
typedef xfem::xAssemblerBasic<Matrix_t, lalg::xCSRVector, double> Assembler_t;
typedef xfem::xAssemblerLumped<Matrix_t, lalg::xCSRVector, double> AssemblerLumpedEqu_t; // TODO Equ doesn't work anymore
typedef xfem::xAssemblerBasic<Matrix_t, xlinalg::xCSRVector, double> Assembler_t;
typedef xfem::xAssemblerLumped<Matrix_t, xlinalg::xCSRVector, double> AssemblerLumpedEqu_t; // TODO Equ doesn't work anymore
// Constructor and destructor
LinearSystem();
......@@ -69,20 +69,20 @@ public:
bool hasGraph() { return has_graph; }
// Gets matrix graph
lalg::xGraphMatrix& getGraph() { return *graph; }
xlinalg::xGraphMatrix& getGraph() { return *graph; }
// Declares matrix (square) or vector with specific name (string)
void declareMatrix(int);
void declareVector(std::string, int);
// Gets vector
const lalg::xCSRVector& getVector(std::string) const;
lalg::xCSRVector& getVector(std::string);
const xlinalg::xCSRVector& getVector(std::string) const;
xlinalg::xCSRVector& getVector(std::string);
double getVectorNorm(std::string) const;
// Input vector from outside the class
void writeVector(const lalg::xCSRVector&, std::string);
void writeVector(const xlinalg::xCSRVector&, std::string);
// Second vector takes first vector values
void copyVector(std::string, std::string);
......@@ -127,11 +127,11 @@ public:
void exportMatrix(std::string);
private:
lalg::xGraphMatrix* graph;
xlinalg::xGraphMatrix* graph;
const bool has_graph;
bool is_connected;