44 #ifndef MUMECH_PROBLEM_H 45 #define MUMECH_PROBLEM_H 81 virtual int give_nLC (
void)
const = 0;
111 if (d == 2) twodim =
true;
112 else if (d == 3) twodim =
false;
113 else _errorr (
"wrong dimension number, choose 2 or 3");
159 friend class printBenchmarkResultsVtk;
202 double problem_size_A[3];
203 double problem_size_B[3];
242 void read_input_file (
const char *filename);
245 void input_data_initialize_and_check_consistency (
void);
248 void convert_to_equivalent_problem (
void);
251 void print_equivalent_problem (
const char *filename);
271 long giveFieldsOfPoint (
double **displc,
double **strain,
double **stress,
const double *coords,
272 char ptFlag,
int rs,
int nrs,
276 long giveFieldsOfPointOneRS (
double *displc,
double *strain,
double *stress,
const double *coords,
293 void printFieldsOnMeshVTK (
const char *mesh_file_out,
const char *mesh_file,
294 char ptFlag,
int rs,
int nrs,
313 void printFieldsOnMeshGrid (
const char *mesh_file_out,
const double *p1,
const double *p2,
const long *n,
314 char ptFlag,
int rs,
int nrs,
324 void print_visualization (
const char *filename,
int n,
int dim=0,
bool refined=
false);
327 void check_overlap (
void);
334 virtual int give_nLC (
void)
const {
if (matrix->
nRS==0)
_errorr(
"Number of load cases have not been set");
return matrix->
nRS; }
344 Mesh* give_new_mesh(
void);
354 Problem* read_inclusions_plus_initialize_and_print (
const char *inclusion_file,
const char *equiv_file,
DiffTypes dt);
374 void set_approximation(
int val);
376 void set_problem_size(
double a1,
double a2,
double a3,
double b1,
double b2,
double b3,
double node_distance) {
377 problem_size_A[0] = a1;
378 problem_size_A[1] = a2;
379 problem_size_A[2] = a3;
380 problem_size_B[0] = b1;
381 problem_size_B[1] = b2;
382 problem_size_B[2] = b3;
383 node_dist = node_distance;
404 long give_inclusion_with_point_inside (
const double *coords,
double epsilon = 0.0)
const;
406 void give_ovlivneni (
const double *coords,
double *result);
408 void compute_fields_and_cmp_with_FEM_on_mesh (
const char *mesh_file,
const char *fem_results,
int lc,
int nlc,
PFCmode pfcMode);
410 double compute_supplement_energy (
int lc);
433 void set_number_of_inclusions (
long n);
464 void set_inclusion_all (
long id,
double x,
double y,
double e,
double n,
double a1,
double a2,
double e1)
465 { this->inclusions[id]->
set_all_2d(x, y, e, n, a1, a2, e1); }
466 void set_inclusion_all (
long id,
double x,
double y,
double z,
double e,
double n,
double a1,
double a2,
double a3,
double e1,
double e2,
double e3)
467 { this->inclusions[id]->
set_all_3d(x, y, z, e, n, a1, a2, a3, e1, e2, e3); }
470 void generate_equiv_1x2dI_2d (
double Em,
double num,
const double *rs,
double x,
double y,
double E,
double nu,
double a1,
double a2,
double ea,
DiffTypes dt);
536 bool file_type_s2e (
const char *s);
543 if (nlc < 0)
_errorr(
"small nlc");
544 else if (nlc == 0) nlc = nRS;
545 else if (nlc > nRS)
_errorr(
"big nlc");
546 if (lc < 0)
_errorr(
"small lc");
547 else if (lc+nlc > nRS)
559 void printVtkFileCompleteInclRec (
const char *rsltFileName);
562 void findAffectedInclusions (
void);
567 void updateEigenstrainsBySBalgorithm (
void);
572 void updateEigenstrainsBySBalgorithm_2D (
int strainID);
575 void updateStrainsInInclRecord (
int noUpdate);
578 long give_EshelbyPertFieldsOnePoint (
const double *coords,
double **disp,
double **strain,
double **stress,
579 int rs,
int nrs,
PFCmode pfcMode,
long reqIncl = -3)
const;
585 void give_EshelbyPertFieldsOnePoint_external (
const double *coords,
double **disp,
double **strain,
double **stress,
586 int lc,
int nlc,
PFCmode pfcMode,
long parent_incl)
const;
590 long giveActingInclusions (
long * actIncls,
const double *coords)
const;
593 double updateEpsTauInSBal(
int strainID,
double **&last_eps_tau);
MatrixRecord * give_matrix(void) const
void set_Euller_angles_deg(double x)
void set_centroids(double x, double y)
int nmeshes
Number of meshes.
classID
Type introduced to distinguish between classes.
int give_VM_TENS_RANGE(void) const
Gives range of a second order tensor in Voigt-Mandel notation.
double volumeOfIncls
Volume of all inclusions.
void set_dimension(int d)
int give_EL_POT_RANGE(void) const
Gives range of ...
int get_SBA_maxiters(void)
int give_dimension(void) const
file of various types and symbolic constant definitions
virtual int give_nLC(void) const
Give number of load cases, e.i. number of load cases, i.e. number of Remote_strain fields...
void set_all_3d(double x, double y, double z, double e, double n, double a1, double a2, double a3, double e1, double e2, double e3)
bool max_axes_diff_change
Permission to change the inclusion shape, when the maximal relative difference of two inclusion semia...
int get_SBA_reqiters(void)
void set_inclusion_semiaxesDimensions(long id, double a1, double a2, double a3=0.0)
Sets the id -th inclusion sorted semiaxes dimensions [a1,a2,a3]. The a3 dimension is ignored in the c...
void matrix_giveReducedStiffMatrix(double *m) const
void set_inclusion_shape(long id, InclusionGeometry shape)
Sets the id -th inclusion shape. Default shape is detected automaticly.
Class InclusionRecord contains and handles all inclusion data.
int give_TRNSFM_MTRX_TENS_RANGE(void) const
Gives range of ...
virtual classID give_classid() const
Returns classID - class identification.
int give_EA_RANGE(void) const
Gives vector range, same as dimension.
Class of function for Mori-Tanaka homogenization.
void set_unit_remote_strain(void)
Sets a set of unit remote strain.
int nstrain_one(void) const
int check_lc_nlc(int lc, int nlc) const
int verbose
0 - no printing, 1 - basic printing, 3 - debug printing
bool twodim
2 dimension problem; 3d is default; twodim == true - 2d, twodim == false - 3d
Homogenization ** homogs
Homogenizations.
Class mNode contains and handles all mesh node data.
void set_inclusion_E_nu(long id, double E, double nu)
Sets the id -th inclusion material properties, Young's modulus E and Poissons ratio nu...
int give_VECT_RANGE(void) const
Gives vector range, same as dimension.
matrix data structure - matrix (infinite medium) record
Class of function for homogenization of stress fields.
void set_problem_size(double a1, double a2, double a3, double b1, double b2, double b3, double node_distance)
void set_SBA_requiredNumberOfIterations(int val)
bool data_equivalent
Problem converted to equivalent one.
Inclusion * give_inclusion(long i) const
debug, for one function in tools
void set_inclusion_EulerAnglesDEG(long id, double e1, double e2=0.0, double e3=0.0)
Sets the id -th inclusion Euler angles [e1,e2,e3] given in degrees. The e2 and e3 angles are ignored ...
void set_Inclusion_shape(InclusionGeometry val)
int approximation
Approximation of epsilon tau - 0 = constant, 1 = linear, ...
int nstrain_all(void) const
virtual int give_nLC(void) const =0
Give number of load cases, e.i. number of load cases, i.e. number of Remote_strain fields...
virtual bool is_converted_to_equivalent(void) const
Give type of ...
bool min_axes_diff_change
Permission to change the inclusion shape, when the minimal relative difference of two inclusion semia...
void set_Semiaxes_dimensions(double x, double y)
virtual int give_nLC(void) const
Give number of load cases, e.i. number of load cases, i.e. number of Remote_strain fields...
void set_RemoteStrain(int id, const double *rs)
Sets the id -th remote strain, rs is row-by-row matrix of dimensions 2x2 or 3x3 for 2d or 3d problem...
int ndisplc_one(void) const
PFCmode
Algorithm type of a point fields calculation.
double min_axes_diff
The minimal relative difference of two inclusion semiaxes to guarantee numerical stability; relative ...
virtual bool is_converted_to_equivalent(void) const
Give type of ...
void set_inclusion_centroids(long id, double x, double y, double z=0.0)
Sets the id -th inclusion centroids [x,y,z]. The z coordinate is ignored in the case of 2 dimensions...
virtual classID give_classid() const =0
Returns classID - class identification.
int SBA_reqiters
Number of iterations in SBA.
The header file of usefull macros.
void set_SBA_optimized(bool val)
Set type of self-balancing algorithm.
SBAtype
Self-balance algorithm type.
bool SBA_optimized
SBA optimized (FULL/_OPTIMIZED_)
STRNotation
This enum defines a notation how to represent a symmetric second/fourth-order tensor by reducing its ...
void matrix_giveFullStiffMatrix(double *m) const
int give_ISO_C_RANGE(void) const
Gives range of ...
int intFieldsShape
Sets the internal fields shape. 0 = basic eshelby solution, 1 = polynomial - if available, 2 = constant, 3 = sum all without any recalculation.
void set_SBAM(SBAtype val)
SBAtype SBA_type
type of Self balancing algorithm (SBA)
void set_semiaxes_max_difference(double val)
Set the variable max_axes_diff.
DiffTypes give_diffType(void) const
Give type of ...
void set_inclusion_all(long id, double x, double y, double z, double e, double n, double a1, double a2, double a3, double e1, double e2, double e3)
void set_all_2d(double x, double y, double e, double n, double a1, double a2, double e1)
Single Point data structure - contribution from Single inclusion.
double give_semiaxes_min_difference(void) const
Give the variable min_axes_diff.
int give_verbose(void) const
Give verbose level.
virtual ~Problems()
Destructor.
PointPositionFlag
Internal (inside the inclusion) / external (outside the inclusion) point position flag...
void set_data_set(void)
Function switches bool flag data_set on true. That indicates start of the process of data input...
void set_matrix_E_nu(double E, double nu)
Sets problem dimension.
int give_TENS_RANGE(void) const
Gives tensor range, same as dimension^2. Theoretical range of a second order tensor.
void set_DataDimDiff(int dim, DiffTypes dt)
Function agregates set_data_set, set_dimension and set_diffType functions.
Class inclusion contains and handles all inclusion data.
Inclusion ** inclusions
inclusion records - 1d array of pointers to InclusionRecord
void check_dim(int i) const
ProblemFEM(int d, int n)
Constructor.
bool data_set
Input data given (direct input or vtk file read) - problem description.
void set_diffType(DiffTypes val)
Sets type of differentiation, analytical by default.
Class of the functions calculating the values of elliptic integrals and its derivatives.
InclusionGeometry
Inclusion shapes' type.
int is_twodim(void) const
int totalNoActingIncls
Total number of acting inclusions, e.i. sum of inclusion[i]->noActingIncls.
int give_twodim(void) const
void set_inclusion_all(long id, double x, double y, double e, double n, double a1, double a2, double e1)
Agregates ...
bool give_semiaxis_max_difference_change(void) const
Give the variable max_axes_diff_change.
virtual classID give_classid() const
Returns classID - class identification.
void set_SBA_maximumNumberOfIterations(int val)
DiffTypes diffType
the type of differentiation actually used. (just for testing purposes)
void set_Remote_strain_for_lc(int lc, const double r1[])
r1 se zadava v theoretical row notation prislusne delky, 4 nebo 9
double max_axes_diff
The maximal relative difference of two inclusion semiaxes to guarantee numerical stability; relative ...
int ndisplc_all(void) const
int SBA_maxiters
Number of iterations in SBA.
void set_Youngs_modulus(double val)
int nhomogs
Number of homogenizations.
Class of function for ... homogenization.
int give_TRNSFM_MTRX_VEC_RANGE(void) const
Gives range of ...
double give_semiaxes_max_difference(void) const
Give the variable max_axes_diff.
Class Mesh contains and handles all mesh data.
Class of function for Mori-Tanaka homogenization.
static int check_lc_nlc(int lc, int nlc, int nRS)
DEFAULT / INTERNAL FOR muMECH Theoretical notation saved in row-by-row form 2d: {t_11, t_12, t_21, t_22} 2d: {s_11, s_12, s_21, s_22} 3d: {t_11, t_12, t_13, t_21, t_22, t_23, t_31, t_32, t_33} 3d: {s_11, s_12, s_13, s_21, s_22, s_23, s_31, s_32, s_33}.
int noIncl
number of inclusions
void set_semiaxes_min_difference(double val)
Set the variable min_axes_diff.
void set_Poissons_ratio(double val)
void set_E_nu(double e, double n)
int nRS
Number of remote strains.
Problem description for FEM problem with results.
void set_intFieldsShape(int val)
void set_UnitRemoteStrains(void)
Function sets a set of unit remote strains.
Class mElement contains and handles all mesh element data.
virtual bool is_converted_to_equivalent(void) const =0
Give type of ...
MatrixRecord * matrix
matrix record
void set_numberOfRemoteStrains(int n)
Sets number of remote strains.
bool give_semiaxis_min_difference_change(void) const
Give the variable min_axes_diff_change.
virtual ~ProblemFEM()
Destructor.