Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Micropp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ggiuntol
Micropp
Commits
03e8e188
Commit
03e8e188
authored
Aug 13, 2019
by
Guido Giuntoli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding a new micro-type
parent
ce7b70a3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
2 deletions
+24
-2
include/micro.hpp
include/micro.hpp
+4
-0
include/util.hpp
include/util.hpp
+1
-1
src/micro_common.cpp
src/micro_common.cpp
+18
-0
test/benchmark-mic-4.cpp
test/benchmark-mic-4.cpp
+1
-1
No files found.
include/micro.hpp
View file @
03e8e188
...
...
@@ -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.
*
*/
...
...
include/util.hpp
View file @
03e8e188
...
...
@@ -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
]);
...
...
src/micro_common.cpp
View file @
03e8e188
...
...
@@ -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
)
{
...
...
test/benchmark-mic-4.cpp
View file @
03e8e188
...
...
@@ -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
=
MIC
3D_FIBS_20_ORDER
;
mic_params
.
geo_params
[
0
]
=
0.1
;
mic_params
.
geo_params
[
1
]
=
0.02
;
mic_params
.
geo_params
[
2
]
=
0.01
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment