Skip to content
Snippets Groups Projects
Commit 87e416b6 authored by Boman Romain's avatar Boman Romain
Browse files

add sigvm extractor to cxxfem models

parent 81d9551b
No related branches found
No related tags found
1 merge request!2Extractors
Pipeline #44178 passed
This commit is part of merge request !2. Comments created here will be created in the context of that merge request.
......@@ -399,6 +399,21 @@ Post::probe(std::string const &name, std::string const &grpname)
// std::cout << "\tgot from gmsh: " << values << '\n';
// std::cout << "\tdistance = " << distance << std::endl;
if(values.size() == 9) // tensor -> compute j2
{
// xx, xy, xz, yx, yy, yz, zx, zy, zz
// 0, 1, 2, 3, 4, 5, 6, 7, 8
double xx = values[0];
double yy = values[4];
double zz = values[8];
double xy = values[1];
double zx = values[6];
double yz = values[5];
double j2 = sqrt( ((xx-yy)*(xx-yy) + (yy-zz)*(yy-zz) + (zz-xx)*(zz-xx) )/2 + 3*(xy*xy+yz*yz+zx*zx) );
values.clear();
values.push_back(j2);
}
all_values.insert(all_values.end(), values.begin(), values.end());
}
......
......@@ -7,7 +7,7 @@ def parms(d={}):
p = {}
import os
path = os.path.join(os.path.dirname(__file__),'50k')
p['bone'] = f'{path}\Clidastes_50k.ply'
p['bone'] = f'{path}/Clidastes_50k.ply'
p['fixations'] = [
{
'name': 'contact_pts',
......
......@@ -318,6 +318,8 @@ def getMetafor(p={}):
valuesmanager.add(idx, IFNodalValueExtractor(target, field), fname)
else:
raise Exception(f'Unknown variable: {var}')
# if the target is a single node, display the extractor [TSC-EXT]
# otherwise, the user should read the ascii file in the workspace.
if target.getNumberOfMeshPoints() == 1:
metafor.getTestSuiteChecker().checkExtractor(idx)
idx+=1
......
......@@ -230,7 +230,8 @@ def solve(p={}):
'epszz': ('smooth_strain_zz', ''),
'epsxy': ('smooth_strain_xy', ''),
'epsxz': ('smooth_strain_xz', ''),
'epsyz': ('smooth_strain_yz', '')
'epsyz': ('smooth_strain_yz', ''),
'sigvm': ('smooth_stress_tensor', 'MPa') # post.probe computes sigvm
}
for extr in p['extractors']:
......
......@@ -42,6 +42,18 @@ def parms(d={}):
'direction': ['x', 'z']
}
]
p['extractors'] = [
{
'name': 'tooth1',
'nodes': [-10.20362, -17.46838, -229.9061],
'variables': [ 'sigvm' ]
},
{
'name': 'tooth2',
'nodes': [-11.92466, 26.3042, -229.5354],
'variables': [ 'sigxx', 'sigyy', 'sigzz', 'sigvm' ]
}
]
# material properties
p['density'] = 1.850e-9 # [T/mm³]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment