Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DAMASK3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Brian Christopher Wasels
DAMASK3
Commits
01d35511
Commit
01d35511
authored
3 years ago
by
Brian Christopher Wasels
Browse files
Options
Downloads
Patches
Plain Diff
jetzt aber wirklich
parent
f52852c7
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
UNet/grain_ numbers.ipynb
+12
-5
12 additions, 5 deletions
UNet/grain_ numbers.ipynb
UNet/visualize_vtk.ipynb
+1
-1
1 addition, 1 deletion
UNet/visualize_vtk.ipynb
with
13 additions
and
6 deletions
UNet/grain_ numbers.ipynb
+
12
−
5
View file @
01d35511
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
" input,_ = data[index]\n",
" input,_ = data[index]\n",
" input = copy.copy(input)\n",
" input = copy.copy(input)\n",
" input = input.detach().numpy()\n",
" input = input.detach().numpy()\n",
" p_mart[index]= np.sum(input[4,:,:,:])/input.size\n",
" p_mart[index]= np.sum(input[4,:,:,:])/
(
input.size
/6)
\n",
"\n",
"\n",
" \n",
" \n",
"\n"
"\n"
...
@@ -35,16 +35,23 @@
...
@@ -35,16 +35,23 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
{
{
"name": "stdout",
"name": "stdout",
"output_type": "stream",
"output_type": "stream",
"text": [
"text": [
"Minimum Mart percentage is:0.
024887084960937
5\n",
"Minimum Mart percentage is:0.
14932250976562
5\n",
"Maximum Mart percentage is:0.
0
60
08911132812
5\n",
"Maximum Mart percentage is:0.
3
60
5346679687
5\n",
"Mean Mart percentage is:0.
0
40
08708634526112
\n"
"Mean Mart percentage is:0.
2
40
52251807156674
\n"
]
]
}
}
],
],
...
...
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
import
pyvista
as
pv
import
pyvista
as
pv
import
numpy
as
np
import
numpy
as
np
import
os
import
os
import
numpy
as
np
import
numpy
as
np
import
pyvista
as
pv
import
pyvista
as
pv
import
torch
import
torch
import
copy
import
copy
```
```
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
data
=
torch
.
load
(
'
E:/Data/damask3/UNet/Input/TD_norm_32_angles.pt
'
)
data
=
torch
.
load
(
'
E:/Data/damask3/UNet/Input/TD_norm_32_angles.pt
'
)
p_mart
=
np
.
empty
(
len
(
data
))
p_mart
=
np
.
empty
(
len
(
data
))
for
index
in
range
(
len
(
data
)):
for
index
in
range
(
len
(
data
)):
input
,
_
=
data
[
index
]
input
,
_
=
data
[
index
]
input
=
copy
.
copy
(
input
)
input
=
copy
.
copy
(
input
)
input
=
input
.
detach
().
numpy
()
input
=
input
.
detach
().
numpy
()
p_mart
[
index
]
=
np
.
sum
(
input
[
4
,:,:,:])
/
input
.
size
p_mart
[
index
]
=
np
.
sum
(
input
[
4
,:,:,:])
/
(
input
.
size
/
6
)
```
```
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
``
`
%%
Cell
type
:
code
id
:
tags
:
```
python
print(f'Minimum Mart percentage is:{p_mart.min()}')
print(f'Minimum Mart percentage is:{p_mart.min()}')
print(f'Maximum Mart percentage is:{p_mart.max()}')
print(f'Maximum Mart percentage is:{p_mart.max()}')
print(f'Mean Mart percentage is:{p_mart.mean()}')
print(f'Mean Mart percentage is:{p_mart.mean()}')
```
```
%% Output
%% Output
Minimum Mart percentage is:0.
024887084960937
5
Minimum Mart percentage is:0.
14932250976562
5
Maximum Mart percentage is:0.
0
60
08911132812
5
Maximum Mart percentage is:0.
3
60
5346679687
5
Mean Mart percentage is:0.
0
40
08708634526112
Mean Mart percentage is:0.
2
40
52251807156674
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
np.save('E:/Data/damask3/UNet/percentage_mart',p_mart)
np.save('E:/Data/damask3/UNet/percentage_mart',p_mart)
```
```
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
path_to_folder ='E:/Data/Simulation_Output/OutputData_64'
path_to_folder ='E:/Data/Simulation_Output/OutputData_64'
number_grains=np.empty(len(os.listdir(path_to_folder)))
number_grains=np.empty(len(os.listdir(path_to_folder)))
for folder_id, folder in enumerate(os.listdir(path_to_folder)):
for folder_id, folder in enumerate(os.listdir(path_to_folder)):
grid = pv.read(f'{path_to_folder}/{folder}/grid.vti')
grid = pv.read(f'{path_to_folder}/{folder}/grid.vti')
number_grains[folder_id] = grid['material'].max() +1
number_grains[folder_id] = grid['material'].max() +1
```
```
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
np.save('E:/Data/damask3/UNet/Input/grain_numbers_64.npy',number_grains)
np.save('E:/Data/damask3/UNet/Input/grain_numbers_64.npy',number_grains)
```
```
...
...
This diff is collapsed.
Click to expand it.
UNet/visualize_vtk.ipynb
+
1
−
1
View file @
01d35511
...
@@ -412,7 +412,7 @@
...
@@ -412,7 +412,7 @@
"name": "python",
"name": "python",
"nbconvert_exporter": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"pygments_lexer": "ipython3",
"version": "3.9.
10
"
"version": "3.9.
5
"
},
},
"orig_nbformat": 4
"orig_nbformat": 4
},
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment