Commit 75e5050b authored by Kévin Moreau's avatar Kévin Moreau

Add small changes related to outputs (damage_peak, peak_step) and implement...

Add small changes related to outputs (damage_peak, peak_step) and implement primitve for exponential hardening function
parent 48b7be4b
Pipeline #224 skipped
......@@ -206,8 +206,9 @@ double QSFormulation::computeLoadFactor() {
std::cout<<"load factor "<<load_factor<<" ref force norm "<<ref_force_norm<< " force norm "<<load_factor*ref_force_norm<<" ref disp norm "<<ref_disp_norm<<" disp norm "<<load_factor*ref_disp_norm<<std::endl;
if(isPeakForce()) {
OldAndCurrent_c::old();
post_pro.exportOnSpace("damage_peak", 0, tls_solver.getDamageEval(), geom.getIntegRulePartition(0), geom.begin(), geom.end());
post_pro.exportOnSpace("damage_peak", 0, tls_solver.getDamageEval(), geom.getIntegRuleSmart(), geom.begin(), geom.end());
OldAndCurrent_c::current();
post_pro.exportOnTime("peak_step", Observer::tell<int>("step"), 1.);
}
return load_factor;
}
......
......@@ -132,8 +132,7 @@ double ExponentialHardeningFunction::getGrad(double x) const {
return c*exp(c*x);
}
double ExponentialHardeningFunction::getPrimitive(double x) const {
std::cout<<"TODO"<<std::endl;
return 0.;
return exp(c*x)/c;
}
RationalHardeningFunction::RationalHardeningFunction(const std::string& filename) {
......
......@@ -385,6 +385,10 @@ void TLSGeom::computeNonlocalBoundingBox() const {
post_pro.exportOnTime("nonlocal_bb_max_x", step, max(0));
post_pro.exportOnTime("nonlocal_bb_max_y", step, max(1));
post_pro.exportOnTime("nonlocal_bb_max_z", step, max(2));
// if(max(0)>4.e-4) {
// std::abort();
// }
}
void TLSGeom::updateNonlocal(const std::list<mEntity*>& delocalized_list) {
......
......@@ -326,16 +326,8 @@ void TLSSolver::delocalizeMeanField() {
auto int_in_nonlocal=geom.getRegion("int_in_nonlocal");
lalg::xDenseMatrix coeffs(bnd_in_nonlocal.size(0), nonlocal.size(0));
// TODO refactor this it is too complicated
std::function<void (mVertex* v, double val)> set_val;
if(epsilon_ratio==0) {
set_val=[](mVertex* v, double val){};
}
else {
set_val=[this](mVertex* v, double val){ this->field.setVal(v, val); };
}
FastMarchingModeExtension([this](mVertex* v){ std::vector<double> vals; this->field.getVals(v, vals); return vals[0]; },
set_val,
[](mVertex* v, double val){},
nonlocal,
bnd_in_nonlocal.begin(0), bnd_in_nonlocal.end(0),
int_in_nonlocal.begin(0), int_in_nonlocal.end(0),
......
......@@ -14,6 +14,7 @@ nb_step_max = 999
export_manager = {
disp 10
damage 10
sm_nonlocal 10 }
export_sensors_label = { load_factor 1 force_y 1 dissipated_energy 1 }
sm_nonlocal 10
damage_peak 1 }
export_sensors_label = { load_factor 1 force_y 1 dissipated_energy 1 peak_step 1 }
export_sensors_point = { }
......@@ -10,7 +10,7 @@ delta_phi_max_ratio = 0.99
do_forced_delocalization = 0
do_crack_cut = 1
fit_to_vertices_ratio = -1.e-2
nb_step_max = 600
nb_step_max = 2000
export_manager = {
disp 10
eps_ref 10
......@@ -21,7 +21,13 @@ export_manager = {
analytic_disp 1
analytic_strain 1
analytic_stress 1 }
export_sensors_label = { load_factor 1 force_y 1 singularity_exponent 1 dissipated_energy 1 nonlocal_bb_max_x 1 }
export_sensors_label = {
load_factor 1
force_y 1
dissipated_energy 1
nonlocal_bb_max_x 1
singularity_exponent 1
peak_step 1 }
export_sensors_point = { }
do_infinite_mapping = 1
do_post_pro_filtering = 1
......
// can be changed
r=0.5e-3;
R=1.3*r;
rho=1.e-4;
costheta=0.70710678118;
sintheta=0.70710678118;
Nn=10;
rho=1.75107329606e-06;
costheta=0.923879532511287;
sintheta=0.382683432365090;
Nn=20;
a=1.;
lc=5.e-5;
lcmin=lc/Nn;
......@@ -27,8 +27,8 @@ Point(10) = {0, -R, 0, a};
Point(11) = {r-s, 0, 0, a};
Point(12) = {l-s, 0, 0, a};
Point(13) = {l*costheta-rho/sintheta, 0, 0, a};
Point(14) = {l*costheta-rho/sintheta+rho*sintheta, rho*costheta, 0, a};
Point(15) = {l*costheta-rho/sintheta+rho*sintheta, -rho*costheta, 0, a};
Point(14) = {l*costheta-rho*costheta*costheta/sintheta, rho*costheta, 0, a};
Point(15) = {l*costheta-rho*costheta*costheta/sintheta, -rho*costheta, 0, a};
Line(1) = {14, 5};
Line(2) = {5, 6};
Line(3) = {6, 7};
......@@ -51,6 +51,8 @@ Physical Line(13) = {2, 3, 5, 6};
Physical Surface(101) = {14};
Physical Surface(102) = {16};
Transfinite Line {11} = 6 Using Progression 1;
Field[1]=Attractor;
Field[1].NNodesByEdge=Nn;
Field[1].EdgesList={12};
......
......@@ -56,6 +56,8 @@ public:
A((lambda+3.*mu-alpha*(lambda+mu))/((lambda+mu)*(1.-alpha))),
B((lambda+3.*mu+alpha*(lambda+mu))/((lambda+mu)*(1.-alpha))) {}
void operator()(const xfem::xGeomElem* appro, const xfem::xGeomElem* integ, xfem::xVector& res) const {
// TODO
return xVector(0.);
Trellis_Util::mPoint pt=integ->getXYZ();
const double omega_leguillon=2.*M_PI-omega;
const double rho=1.e-4;
......@@ -113,7 +115,6 @@ int main(int argc, char* argv[]) {
xParseData parse_data;
parse_data.registerInt("do_infinite_mapping");
parse_data.registerInt("do_post_pro_filtering");
parse_data.registerInt("do_superimposed");
parse_data.registerDouble("infinite_mapping_offset");
parse_data.registerDouble("notch_angle");
parse_data.registerDouble("internal_radius");
......
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