Commit 13fff61a authored by Rastiello Giuseppe's avatar Rastiello Giuseppe

Swiching initial implementation into two QSFormulationMultiDam by derivation

Note: QSFormulationMultiDam is derived from QSFormulation; a
optional parameter is introduced to use the standard formulation or the new
version in TLSSolver initialization; implementation of QSFormulationMultiDam
is reduced by removing methods defined in QSFormulation; a new test case
is added.
parent a30380ff
Pipeline #228 skipped
This diff is collapsed.
......@@ -13,7 +13,7 @@ class QSFormulation : public Formulation {
public:
QSFormulation(TLSGeom&, TLSSolver&,
const xfem::xData&, const xParseData&,
PreProcessing&, PostProcessing&);
PreProcessing&, PostProcessing&, bool multi_dam = false);
virtual ~QSFormulation();
// Updates level set field and material variables
......@@ -26,7 +26,7 @@ public:
virtual void computeLoadFactorVariation();
// Computes load factor
double computeLoadFactor();
virtual double computeLoadFactor();
// Writes to disp field dof values from xCSRVector, a specific
// disp field is selected by the string
......@@ -50,11 +50,11 @@ protected:
// Calls tls solver to compute all required mean fields to update phi.
// Required mean fields are declared in the constructor.
void computeLSAdvanceMeanFields();
virtual void computeLSAdvanceMeanFields();
// Calls tls solver to compute all required mean fields to compute equilibrium.
// Required mean fields are declared in the constructor.
void computeEquilibriumMeanFields();
virtual void computeEquilibriumMeanFields();
// Computes delta phi and writes it to tls solver.
virtual void computeDeltaLevelSetField();
......
This diff is collapsed.
/*
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#ifndef _TLSDuctile_FormulationQSMultiDam_h_
#define _TLSDuctile_FormulationQSMultiDam_h_
#include "FormulationQS.h"
class PreProcessing;
class TLSSolver;
class QSFormulationMultiDam : public QSFormulation {
public:
QSFormulationMultiDam(TLSGeom&, TLSSolver&,
const xfem::xData&, const xParseData&,
PreProcessing&, PostProcessing&);
virtual ~QSFormulationMultiDam();
// Updates level set field and material variables
void updateCurrentState();
// Computes load factor variation
void computeLoadFactorVariation();
// Computes load factor
double computeLoadFactor();
// Exports for post processing
bool exportStep(int);
protected:
// Calls tls solver to compute all required mean fields to update phi.
// Required mean fields are declared in the constructor.
void computeLSAdvanceMeanFields();
// Calls tls solver to compute all required mean fields to compute equilibrium.
// Required mean fields are declared in the constructor.
void computeEquilibriumMeanFields();
// Computes delta phi and writes it to tls solver.
void computeDeltaLevelSetField();
void updateLevelSetField();
};
#endif
......@@ -12,6 +12,7 @@
#include "TLSSolver.h"
// quasistatic
#include "FormulationQS.h"
#include "FormulationQSMultiDam.h"
#include "Algorithm.h"
// dynamic
#include "FormulationDyn.h"
......
......@@ -17,6 +17,7 @@ if(TLSDUCTILE_TEST_DAM)
dam_crack
dam_hole
dam_homogeneous
dam_homogeneous_multiDam
# dam_inclusion
dam_notch
dam_pressured_cylinder
......
enable_testing()
add_test(dam_homogeneous_multiDam ${CMAKE_CURRENT_BINARY_DIR}/data/reference.py ${CMAKE_CURRENT_BINARY_DIR}/)
MATERIAL_CLASS = elastic_damage_nonlinear
NAME = truc
PLANE_STATE = plane_strain
YOUNG_MODULUS = 210.e9
POISSON_RATIO = 0.3
Y_CRIT = 1.32e5
ASYM_RATIO = 1.
HARDENING = exponential
HARDENING_COEFF = 4.
integ_order = 3
disp_space_type = PolyLagrange
disp_space_dim = V2Dxy
disp_space_order = 1
disp_bc_integ_order = 1
mean_field_space_type = PolyLagrange
damage_shape = Poly2Revert
lc = 0.5
delta_phi_max_ratio = 0.99
do_forced_delocalization = 1
do_crack_cut = 1
nb_step_max = 201
export_manager = {
disp 50
damage 50
sm_local 50
sm_nonlocal 50
sm_transition 50
sm_bnd_local 50
sm_bnd_nonlocal 50
mean_a 50
mean_b 50
mean_c 50
mean_alpha 50
mean_beta 50
phi 50
delta_phi 50
strain 50
strain_33 50
stress 50
stress_33 50 }
export_sensors_label = { load_factor 1 force_y 1 dissipated_energy 1 }
export_sensors_point = { }
MESH_FILE_TYPE = msh
PROCEDURE_PARAM_FILE = info.dat
MESH_FILE = mesh.msh
ZONE 101 = { MAT_CLASS = ElastoDam MAT_PARAM = mate.mat }
BC_LINE 11 = { DISPLACEMENT_Y FIX = 0. }
BC_LINE 13 = { DISPLACEMENT_Y FIX_AND_MEASURE = 3. }
BC_LINE 14 = { DISPLACEMENT_X FIX = 0. }
Point(1) = {0, 0, 0, 1.0};
Point(2) = {2, 0, 0, 1.0};
Point(3) = {2, 3, 0, 1.0};
Point(4) = {0, 3, 0, 1.0};
Line(5) = {1, 2};
Line(6) = {2, 3};
Line(7) = {3, 4};
Line(8) = {4, 1};
Line Loop(9) = {5, 6, 7, 8};
Plane Surface(10) = {9};
Physical Line(11) = {5};
Physical Line(12) = {6};
Physical Line(13) = {7};
Physical Line(14) = {8};
Physical Surface(101) = {10};
Transfinite Line {5, 7} = 40 Using Progression 1;
Transfinite Line {6, 8} = 60 Using Progression 1;
This diff is collapsed.
Point(1) = {0, 0, 0, 1.0};
Point(2) = {2, 0, 0, 1.0};
Point(3) = {2, 3, 0, 1.0};
Point(4) = {0, 3, 0, 1.0};
Line(5) = {1, 2};
Line(6) = {2, 3};
Line(7) = {3, 4};
Line(8) = {4, 1};
Line Loop(9) = {5, 6, 7, 8};
Plane Surface(10) = {9};
Physical Line(11) = {5};
Physical Line(12) = {6};
Physical Line(13) = {7};
Physical Line(14) = {8};
Physical Surface(101) = {10};
Transfinite Line {5, 7} = 60 Using Progression 1;
Transfinite Line {6, 8} = 90 Using Progression 1;
This diff is collapsed.
This diff is collapsed.
Point(1) = {0, 0, 0, 1.0};
Point(2) = {2, 0, 0, 1.0};
Point(3) = {2, 3, 0, 1.0};
Point(4) = {0, 3, 0, 1.0};
Line(5) = {1, 2};
Line(6) = {2, 3};
Line(7) = {3, 4};
Line(8) = {4, 1};
Line Loop(9) = {5, 6, 7, 8};
Plane Surface(10) = {9};
Physical Line(11) = {5};
Physical Line(12) = {6};
Physical Line(13) = {7};
Physical Line(14) = {8};
Physical Surface(101) = {10};
Transfinite Line {5, 7} = 80 Using Progression 1;
Transfinite Line {6, 8} = 120 Using Progression 1;
This diff is collapsed.
n=40;
Point(1) = {0, 0, 0, 1.0};
Point(2) = {1, 0, 0, 1.0};
Point(3) = {1, 1, 0, 1.0};
Point(4) = {0, 1, 0, 1.0};
Line(5) = {1, 2};
Line(6) = {2, 3};
Line(7) = {3, 4};
Line(8) = {4, 1};
Line Loop(9) = {5, 6, 7, 8};
Plane Surface(10) = {9};
Physical Line(11) = {5};
Physical Line(12) = {6};
Physical Line(13) = {7};
Physical Line(14) = {8};
Physical Surface(101) = {10};
Transfinite Line {5, 6, 7, 8} = n Using Progression 1;
This diff is collapsed.
n=80;
Point(1) = {0, 0, 0, 1.0};
Point(2) = {1, 0, 0, 1.0};
Point(3) = {1, 1, 0, 1.0};
Point(4) = {0, 1, 0, 1.0};
Line(5) = {1, 2};
Line(6) = {2, 3};
Line(7) = {3, 4};
Line(8) = {4, 1};
Line Loop(9) = {5, 6, 7, 8};
Plane Surface(10) = {9};
Physical Line(11) = {5};
Physical Line(12) = {6};
Physical Line(13) = {7};
Physical Line(14) = {8};
Physical Surface(101) = {10};
Transfinite Line {5, 6, 7, 8} = n Using Progression 1;
This diff is collapsed.
n=120;
Point(1) = {0, 0, 0, 1.0};
Point(2) = {1, 0, 0, 1.0};
Point(3) = {1, 1, 0, 1.0};
Point(4) = {0, 1, 0, 1.0};
Line(5) = {1, 2};
Line(6) = {2, 3};
Line(7) = {3, 4};
Line(8) = {4, 1};
Line Loop(9) = {5, 6, 7, 8};
Plane Surface(10) = {9};
Physical Line(11) = {5};
Physical Line(12) = {6};
Physical Line(13) = {7};
Physical Line(14) = {8};
Physical Surface(101) = {10};
Transfinite Line {5, 6, 7, 8} = n Using Progression 1;
This diff is collapsed.
/*
This source code is subject to non-permissive licence,
see the TLSDuctile/LICENSE file for conditions.
*/
#include "TLSDuctile.h"
int main(int argc, char* argv[]) {
RegisterMaterials();
std::string data_filename, archive_filename;
ParseArgs(argc, argv, data_filename, archive_filename);
xfem::xData data;
xParseData parse_data;
ReadData(data_filename, data, parse_data);
PreProcessing pre_pro(archive_filename);
PostProcessing post_pro(parse_data);
TLSGeom tls_geom(data, parse_data, pre_pro, post_pro);
TLSSolver tls_solver(tls_geom, parse_data, pre_pro, post_pro);
QSFormulationMultiDam formulation(tls_geom, tls_solver, data, parse_data, pre_pro, post_pro);
Algorithm algorithm(formulation, parse_data);
algorithm.run(pre_pro.getStep());
return 0;
}
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