Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fossils
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Boman Romain
fossils
Commits
b79f9e2c
Commit
b79f9e2c
authored
7 months ago
by
Boman Romain
Browse files
Options
Downloads
Patches
Plain Diff
add x0,y0,z0 & fx,fy,fz as extractors
parent
870bcb5a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2
Extractors
Pipeline
#44181
passed
7 months ago
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cxxfem/src/femPost.cpp
+13
-8
13 additions, 8 deletions
cxxfem/src/femPost.cpp
models/bonemodel2.py
+23
-5
23 additions, 5 deletions
models/bonemodel2.py
models/dolicorhynchops/dolicorhynchops_10k.py
+5
-0
5 additions, 0 deletions
models/dolicorhynchops/dolicorhynchops_10k.py
with
41 additions
and
13 deletions
cxxfem/src/femPost.cpp
+
13
−
8
View file @
b79f9e2c
...
...
@@ -364,6 +364,19 @@ Post::probe(std::string const &name, std::string const &grpname)
// get physical group from grpname
Group
*
grp
=
solver
.
pbl
.
groups_by_name
.
at
(
grpname
);
// TODO: better handling of errors
std
::
vector
<
std
::
size_t
>
nodeTags
;
std
::
vector
<
double
>
coord
;
gmsh
::
model
::
mesh
::
getNodesForPhysicalGroup
(
grp
->
dim
,
grp
->
tag
,
nodeTags
,
coord
);
// j'ai essayé de boucler sur les entités du groupe et faire un getNode de l'entité
// mais ça ne me retourne rien (?)
// std::cout << "nodeTags.size()=" << nodeTags.size() << '\n';
// retourne les coordonnées des noeuds du groupe si demandé
if
(
name
==
"coords"
)
{
return
coord
;
}
// get the view
auto
it
=
views
.
find
(
name
);
if
(
it
==
views
.
end
())
...
...
@@ -373,14 +386,6 @@ Post::probe(std::string const &name, std::string const &grpname)
// probe values
std
::
vector
<
double
>
all_values
;
std
::
vector
<
std
::
size_t
>
nodeTags
;
std
::
vector
<
double
>
coord
;
gmsh
::
model
::
mesh
::
getNodesForPhysicalGroup
(
grp
->
dim
,
grp
->
tag
,
nodeTags
,
coord
);
// j'ai essayé de boucler sur les entités du groupe et faire un getNode de l'entité
// mais ça ne me retourne rien (?)
// std::cout << "nodeTags.size()=" << nodeTags.size() << '\n';
for
(
size_t
i
=
0
;
i
<
nodeTags
.
size
();
++
i
)
{
std
::
vector
<
double
>
values
;
...
...
This diff is collapsed.
Click to expand it.
models/bonemodel2.py
+
23
−
5
View file @
b79f9e2c
...
...
@@ -242,17 +242,35 @@ def solve(p={}):
for
var
in
extr
[
'
variables
'
]:
fname
=
f
'
{
extr
[
"
name
"
]
}
_
{
var
}
.tsv
'
grpname
=
extr
[
'
name
'
]
v
=
[]
units
=
""
if
var
.
lower
()
in
var2field
:
# extract values from gmsh views
field
=
var2field
[
var
.
lower
()][
0
]
units
=
var2field
[
var
.
lower
()][
1
]
v
=
np
.
array
(
post
.
probe
(
field
,
grpname
))
np
.
savetxt
(
fname
,
v
,
delimiter
=
'
\t
'
,
header
=
'
value
'
)
v
=
np
.
array
(
post
.
probe
(
field
,
grpname
))
elif
var
.
lower
()
in
[
'
x0
'
,
'
y0
'
,
'
z0
'
]:
# extract coordinates of the nodes
units
=
'
mm
'
v
=
np
.
array
(
post
.
probe
(
'
coords
'
,
grpname
))
v
=
np
.
reshape
(
v
,
(
v
.
size
//
3
,
3
))
v
=
v
[:,
[
'
x0
'
,
'
y0
'
,
'
z0
'
].
index
(
var
.
lower
())]
elif
var
.
lower
()
in
[
'
fx
'
,
'
fy
'
,
'
fz
'
]:
# extract forces
units
=
'
N
'
v
=
np
.
array
(
post
.
probe
(
'
force_vector
'
,
grpname
))
v
=
np
.
reshape
(
v
,
(
v
.
size
//
3
,
3
))
v
=
v
[:,
[
'
fx
'
,
'
fy
'
,
'
fz
'
].
index
(
var
.
lower
())]
else
:
print
(
f
'
unknown variable:
"
{
var
}
"'
)
if
len
(
v
)
>
0
:
np
.
savetxt
(
fname
,
v
,
delimiter
=
'
\t
'
,
header
=
var
.
lower
())
if
len
(
v
)
==
1
:
print
(
f
'
\t
{
grpname
}
_
{
var
}
=
{
v
[
0
]
:
.
3
f
}
{
units
}
'
)
else
:
print
(
f
'
\t
{
grpname
}
_
{
var
}
= (
{
len
(
v
)
}
values in
"
{
fname
}
"
)
'
)
else
:
print
(
f
'
unknown variable:
"
{
var
}
"'
)
print
(
f
'
\t
{
grpname
}
_
{
var
}
= (
{
len
(
v
)
}
values in
"
{
fname
}
"
)
'
)
end_time
=
time
.
perf_counter
()
elapsed_time
=
end_time
-
start_time
...
...
This diff is collapsed.
Click to expand it.
models/dolicorhynchops/dolicorhynchops_10k.py
+
5
−
0
View file @
b79f9e2c
...
...
@@ -52,6 +52,11 @@ def parms(d={}):
'
name
'
:
'
tooth2
'
,
'
nodes
'
:
[
-
11.92466
,
26.3042
,
-
229.5354
],
'
variables
'
:
[
'
sigxx
'
,
'
sigyy
'
,
'
sigzz
'
,
'
sigvm
'
]
},
{
'
name
'
:
'
Lmuscle
'
,
'
nodes
'
:
f
'
{
path
}
/Lmuscle.stl
'
,
'
variables
'
:
[
'
x0
'
,
'
y0
'
,
'
z0
'
,
'
sigvm
'
]
}
]
...
...
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