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
Admin message
Pour rappel, le service sera inaccessible ce lundi 05/05/25 midi pour raison de mise à jour.
Show more breadcrumbs
Boman Romain
fossils
Commits
f5c00b32
Commit
f5c00b32
authored
4 years ago
by
Boman Romain
Browse files
Options
Downloads
Patches
Plain Diff
add more comments
parent
e13e7082
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nastran/Boneload_version_6_w_4_methods_ZJT.m
+43
-29
43 additions, 29 deletions
nastran/Boneload_version_6_w_4_methods_ZJT.m
with
43 additions
and
29 deletions
nastran/Boneload_version_6_w_4_methods_ZJT.m
+
43
−
29
View file @
f5c00b32
...
...
@@ -29,8 +29,8 @@
%
Focal
_
nodes
:
focal
point
coordinates
%
for
each
group
size
=
(
nbgroups
,
3
)
%
%
MG
_
{
i
}
_
Focal
_
Point
:
shortcut
to
'
Focal
_
nodes
'
for
group
i
%
MG
_
{
i
}
_
Muscle
_
Force
:
shortcut
to
'
Force
'
for
group
i
%
MG
_
{
i
}
_
Focal
_
Point
:
shortcut
to
'
Focal
_
nodes
'
for
group
i
size
=
(
3
)
%
MG
_
{
i
}
_
Muscle
_
Force
:
shortcut
to
'
Force
s
'
for
group
i
size
=
(
1
)
%
%
method
:
loading
method
%
'
uniform
_
traction
':
"ad hoc uniform traction model"
...
...
@@ -50,8 +50,8 @@
%
%
MG
_
{
i
}
_
Element
_
Area
size
=
(
nbelem
_
i
)
%
MG
_
{
i
}
_
Elem
_
Centroid
size
=
(
nbelem
_
i
,
3
)
%
MG
_
{
i
}
_
Traction
size
=
(
nbelem
_
i
,
3
)
?
%
MG
_
{
i
}
_
Normal
size
=
(
nbelem
_
i
,
3
)
%
MG
_
{
i
}
_
Traction
:
tangential
comp
of
the
force
size
=
(
nbelem
_
i
,
3
)
%
MG
_
{
i
}
_
Normal
:
normal
comp
of
the
force
size
=
(
nbelem
_
i
,
3
)
%
MG
_
{
i
}
_
free
_
elem
_
edges
%
MG
_
{
i
}
_
outter
_
edge
%
MG
_
{
i
}
_
Outter
_
Edge
_
Nodes
:
list
of
boundardy
edges
size
=
(
nbonod
)
...
...
@@ -62,7 +62,11 @@
%
Rem
_
Neg
_
Mom
:
flags
(
0
or
1
)
used
for
removing
negative
moments
%
size
=
(
nbgroups
)
%
%
%
the
script
also
copies
the
date
in
a
structure
while
computing
the
forces
%
Muscle
_
Info
.
Muscle
_
attachment
_
X
%
Muscle
_
Info
.
Muscle
_
Traction
%
Muscle
_
Info
.
Muscle
_
Elem
_
Centroid
%
...
%
%
%
...
...
@@ -182,6 +186,7 @@ end
for jj = 1:1:max_number_of_muscle_groups
eval(sprintf('[MG_%d_Element_Area, MG_%d_Elem_Centroid, MG_%d_Traction, MG_%d_Normal] = Element_info(MG_%d_Muscle_attachment_X,MG_%d_Muscle_attachment_Y,MG_%d_Muscle_attachment_Z,MG_%d_Muscle_Force,MG_%d_Focal_Point);',jj,jj,jj,jj,jj,jj,jj,jj,jj))
% [RB] ! MG_%d_Traction => "traction" = tangential component of the force!!
clf
figure(21)
set(gcf,'Position',[500 500 500 100]);
...
...
@@ -343,6 +348,9 @@ for jj = 1:1:max_number_of_muscle_groups
MG_Elem_Normal = Muscle_Info.Muscle_Normal(elem_num,:);
% THIS CHANGES THE PRESSURE MAGNITUDE AND DIRECTION
%
% this is the "mean pressure" - same for all elements
% <----------------------------------------------------------->
Pressure_load(elem_num,:) = (Muscle_Info.Muscle_Force./sum(Muscle_Info.Muscle_Elem_Area))*MG_Elem_CENT_to_FP_unit;
%%% Remove Negative Moments
...
...
@@ -352,13 +360,24 @@ for jj = 1:1:max_number_of_muscle_groups
if dot(Moment_check, [L_TMJ - R_TMJ]./norm([L_TMJ - R_TMJ]))<0
Pressure_load(elem_num,:) = 0*(MG_Elem_CENT_to_FP_unit);
end
end
end
end
% [RB]
% The method consists in computing a (scalar) pressure_mean = F_prescribed/total_Area
% Then the "pressure_load" (3 comp vector with unit=pressure) equal
% pressure_load = pressure_mean*(unit vector from centroid to focal point)
% [RB]: no "normalize_to_input_force" here!
%% Gradient Traction (Pressure) Method
elseif strcmp(method,'gradient_traction') ==1
MG_Elem_CENT_to_FP_dist = zeros(Muscle_Info.num_of_plates,1);
% [RB] same as above except that the force amplitude is scaled by a factor
% that depends on the distance of the facet to the focal point.
% (1 for the farthest, less for nearer elements)
MG_Elem_CENT_to_FP_dist = zeros(Muscle_Info.num_of_plates,1);
for elem_num = 1:1:Muscle_Info.num_of_plates
MG_Elem_CENT_to_FP_dist(elem_num) = norm(Muscle_Info.Focal_Point - Muscle_Info.Muscle_Elem_Centroid (elem_num,:));
...
...
@@ -373,30 +392,21 @@ for jj = 1:1:max_number_of_muscle_groups
MG_Elem_Normal = Muscle_Info.Muscle_Normal(elem_num,:);
% THIS CHANGES THE PRESSURE MAGNITUDE AND DIRECTION
Pressure_load(elem_num,:) = gradient_scale(elem_num).*(Muscle_Info.Muscle_Force./sum(Muscle_Info.Muscle_Elem_Area))*MG_Elem_CENT_to_FP_unit;
% %% PROGRESS BAR
% if mod(elem_num,100)==0
% elem_num
% % computation here %
% waitbar(elem_num/Muscle_Info.num_of_plates,h_bar)
% end
Pressure_load(elem_num,:) = gradient_scale(elem_num).*(Muscle_Info.Muscle_Force./sum(Muscle_Info.Muscle_Elem_Area))*MG_Elem_CENT_to_FP_unit;
end
normalize_to_input_force = Muscle_Info.Muscle_Force./sum(sqrt(Pressure_load(:,1).^2+Pressure_load(:,2).^2+Pressure_load(:,3).^2).*(Muscle_Info.Muscle_Elem_Area(:)));
normalize_to_input_force = Muscle_Info.Muscle_Force./sum(sqrt(Pressure_load(:,1).^2+Pressure_load(:,2).^2+Pressure_load(:,3).^2).*(Muscle_Info.Muscle_Elem_Area(:)));
for elem_num = 1:1:Muscle_Info.num_of_plates
%%% Remove Negative Moments
% REMOVE THE PRESSURE THAT CAUSES A NEGATIVE MOMENT ABOUT THE TMJ
if Rem_Neg_Mom(jj) ==1
Moment_check = cross(Muscle_Info.Muscle_Elem_Centroid (elem_num,:) - L_TMJ,Pressure_load(elem_num,:));
if dot(Moment_check, [L_TMJ - R_TMJ]./norm([L_TMJ - R_TMJ]))<0
Pressure_load(elem_num,:) = 0*(MG_Elem_CENT_to_FP_unit);
end
for elem_num = 1:1:Muscle_Info.num_of_plates
%%% Remove Negative Moments
% REMOVE THE PRESSURE THAT CAUSES A NEGATIVE MOMENT ABOUT THE TMJ
if Rem_Neg_Mom(jj) ==1
Moment_check = cross(Muscle_Info.Muscle_Elem_Centroid (elem_num,:) - L_TMJ,Pressure_load(elem_num,:));
if dot(Moment_check, [L_TMJ - R_TMJ]./norm([L_TMJ - R_TMJ]))<0
Pressure_load(elem_num,:) = 0*(MG_Elem_CENT_to_FP_unit);
end
end
end
%% TANGENTIAL ONLY
...
...
@@ -411,6 +421,7 @@ for jj = 1:1:max_number_of_muscle_groups
if dot(MG_Elem_CENT_to_FP_unit,MG_Elem_Normal) > 0
Pressure_load(elem_num,:) = (Muscle_Info.Muscle_Force./sum(Muscle_Info.Muscle_Elem_Area))*MG_Elem_CENT_to_FP_unit;
else
% tv = "tangent vector"
tv = Muscle_Info.Muscle_Traction(elem_num,:)./(norm(Muscle_Info.Muscle_Traction(elem_num,:)));
Pressure_load(elem_num,:) = (Muscle_Info.Muscle_Force./sum(Muscle_Info.Muscle_Elem_Area))*(tv);
end
...
...
@@ -423,8 +434,9 @@ for jj = 1:1:max_number_of_muscle_groups
Pressure_load(elem_num,:) = 0*(MG_Elem_CENT_to_FP_unit);
end
end
end
% [RB]: no "normalize_to_input_force" here!
elseif strcmp(method,'tangential_plus_normal_traction') ==1
...
...
@@ -458,7 +470,7 @@ for jj = 1:1:max_number_of_muscle_groups
% We use this formula:
% Tt (tv1 i + tv2 j + tv3 k) + Tn(nv1 i + nv2 j + nv3 k);
% where:
% t1,t2,t3 indicate the direction of the inplane tration vector
% t1,t2,t3 indicate the direction of the inplane tra
c
tion vector
([RB]: "traction" means "tangent" here)
% n1,n2,n3 indicate the direction of the outward normal vector
% Tt = The Tangential Traction (F/A)
% Tn = Tt*(s(r)/R(r))
...
...
@@ -468,7 +480,9 @@ for jj = 1:1:max_number_of_muscle_groups
% 1069-1088
% FORCE VECTOR DIRECTIONS
% tangent vector
tv = Muscle_Info.Muscle_Traction(elem_num,:)./(norm(Muscle_Info.Muscle_Traction(elem_num,:)));
% normal vector
nv = - Muscle_Info.Muscle_Normal(elem_num,:);
% THIS CHANGES THE PRESSURE MAGNITUDE AND DIRECTION
...
...
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