Commit 03e8e188 authored by Guido Giuntoli's avatar Guido Giuntoli

Adding a new micro-type

parent ce7b70a3
......@@ -142,6 +142,7 @@ enum {
MIC_QUAD_FIB_XZ_BROKEN_X,
MIC3D_SPHERES,
MIC3D_8,
MIC3D_FIBS_20_ORDER,
MIC3D_FIBS_20_DISORDER
};
......@@ -157,6 +158,7 @@ static map<int, std::string> micro_names = {
{MIC_QUAD_FIB_XZ_BROKEN_X, "MIC_QUAD_FIB_XZ_BROKEN_X"},
{MIC3D_SPHERES, "MIC3D_SPHERES"},
{MIC3D_8, "MIC3D_8"},
{MIC3D_FIBS_20_ORDER, "MIC3D_FIBS_20_ORDER"},
{MIC3D_FIBS_20_DISORDER, "MIC3D_FIBS_20_DISORDER"}
};
......@@ -170,6 +172,8 @@ static map<int, std::string> micro_names = {
* MIC3D_8 : (3 materiales) 2 cilinders at 90 deg with a layer around the
* perimeter and a flat layer between the fibers.
*
* MIC3D_FIBS_20_ORDER: (2 materiales) 20 fibers in oriented in X direction.
*
* MIC3D_FIBS_20_DISORDER: (2 materiales) 20 fibers in random directions.
*
*/
......
......@@ -153,7 +153,7 @@ inline bool point_inside_cilinder_inf(const double dir[3], const double center[3
inline double invert_3x3(const double mat[3][3], double mat_inv[3][3])
{
double det =
const double det =
mat[0][0] * (mat[1][1] * mat[2][2] - mat[2][1] * mat[1][2]) -
mat[0][1] * (mat[1][0] * mat[2][2] - mat[2][0] * mat[1][2]) +
mat[0][2] * (mat[1][0] * mat[2][1] - mat[2][0] * mat[1][1]);
......
......@@ -691,6 +691,24 @@ int micropp<tdim>::get_elem_type(int ex, int ey, int ez) const
return 0;
} else if (micro_type == MIC3D_FIBS_20_ORDER) {
const double radius = 0.05;
const double dir[3] = { 1, 0, 0 };
const int fibs_z = 5;
const int fibs_y = 4;
const double dz = 1.0 / (fibs_z + 1);
const double dy = 1.0 / (fibs_y + 1);
for (int i = 0; i < fibs_z; ++i) {
for (int j = 0; j < fibs_y; ++j) {
const double center[3] = { 0.0, (j + 1) * dy, (i + 1) * dz };
if(point_inside_cilinder_inf(dir, center, radius, coor)) {
return 1;
}
}
}
return 0;
} else if (micro_type == MIC3D_FIBS_20_DISORDER) {
......
......@@ -75,7 +75,7 @@ int main(int argc, char **argv)
mic_params.size[0] = n;
mic_params.size[1] = n;
mic_params.size[2] = n;
mic_params.type = MIC_CILI_FIB_X;
mic_params.type = MIC3D_FIBS_20_ORDER;
mic_params.geo_params[0] = 0.1;
mic_params.geo_params[1] = 0.02;
mic_params.geo_params[2] = 0.01;
......
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