-
Notifications
You must be signed in to change notification settings - Fork 2
Update of Ansys tutorial #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JacobAdamsen
wants to merge
1
commit into
master
Choose a base branch
from
AnsysTutorial
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
99 changes: 99 additions & 0 deletions
99
Finite_element_analysis/Snippets/Lesson2/HumanStanding.main.any
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| // NOTE: for the operation AnyOperationShellExec to work, you must include a vlaid license file in the folder "AnyFE2APDL" | ||
|
|
||
| #include "libdef.any" | ||
|
|
||
| Main = | ||
| { | ||
| // BodyModel configuration: | ||
| // Specify which limb segments to include, the type of muscles, joints, scaling etc | ||
| #include "Model/BodyModelConfiguration.any" | ||
|
|
||
| // Include the Human model from AMMR | ||
| #include "<ANYBODY_PATH_BODY>\HumanModel.any" | ||
|
|
||
| // Define desired posture or movement of the model | ||
| #include "Model\Mannequin.any" | ||
|
|
||
| // Compose the model used by the study | ||
| AnyFolder Model = | ||
| { | ||
| // Center of Mass (COM) position in the ground YZ plane | ||
| // COM balance driver can be excluded with: | ||
| // #define EXCLUDE_COM_BALANCE_DRIVERS | ||
| AnyVector CenterOfMassXZ = {0,0}; | ||
|
|
||
| // Positioning of the right and left feet. | ||
| // Ground-foot constraints can be excluded with: | ||
| // #define EXCLUDE_FOOT_CONSTRAINTS | ||
| Environment.GlobalRef.RightFootPrint = { | ||
| AnyVec3 HeelPosition = {-0.08, 0, 0.14}; | ||
| AnyVec3 ToeDirection = {1, 0, 0.1}; | ||
| }; | ||
| Environment.GlobalRef.LeftFootPrint = { | ||
| AnyVec3 HeelPosition = {-0.08, 0, -0.14}; | ||
| AnyVec3 ToeDirection = {1, 0, -0.1}; | ||
| }; | ||
|
|
||
| // Include the body part of the Human model | ||
| AnyFolder &BodyModel = .HumanModel.BodyModel; | ||
|
|
||
| // Include the default mannequin drivers | ||
| AnyFolder &DefaultMannequinDrivers = .HumanModel.DefaultMannequinDrivers; | ||
|
|
||
| // Environment files are used to include objects surrounding human, | ||
| // e.g. global reference frame | ||
| #include "Model\Environment.any" | ||
|
|
||
| AnyFolder ModelEnvironmentConnection = | ||
| { | ||
| // This file contains all contraints to simulate the standing human | ||
| #include "Model/JointsAndDrivers.any" | ||
|
|
||
| // Ground reaction force prediction | ||
| #include "Model/GRFPrediction.any" | ||
| }; | ||
| }; | ||
| // Define Study for running kinematics and inverse dynamics simulation analyses | ||
|
|
||
| //# BEGIN SNIPPET 1 | ||
| AnyBodyStudy Study = { | ||
| // Include the Model within the Study | ||
| AnyFolder &Model = .Model; | ||
|
|
||
| Gravity={0.0, -9.81, 0.0}; | ||
| §tEnd = 10;§ | ||
| nStep = §5§; | ||
| //# END SNIPPET 1 | ||
|
|
||
| //# BEGIN SNIPPET 2 | ||
| AnyMechOutputFileForceExport §FE_out§ = { | ||
| §FileName = "files_in/clavload.xml"; | ||
| UseRefFrameOnOff = On; | ||
| RefFrame = &Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Clavicula.localrefframe; | ||
| AllSegmentsInStudyOnOff = Off; | ||
| XMLformatOnOff = On; | ||
| //AllSegmentsInStudyOnOff = Off; | ||
| Segments = {&Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Clavicula};§ | ||
| }; | ||
| //# END SNIPPET 2 | ||
|
|
||
| // Overdeterminate solver is needed while using the | ||
| // soft default mannequin drivers. | ||
| Kinematics.SolverType = KinSolOverDeterminate; | ||
| InitialConditions.SolverType = Kinematics.SolverType ; | ||
|
|
||
| //# BEGIN SNIPPET 3 | ||
| }; // End of Study folder | ||
|
|
||
| §AnyOperationShellExec ConvertToAPDL = { | ||
| Show = On; | ||
| FileName = "AnyFE2APDL.exe"; | ||
| WorkDir = "AnyFE2APDL"; | ||
| Arguments = "-i ../files_in/clavload.xml -o ../files_out -t ../examples/APDLTemplate.txt"; | ||
| };§ | ||
| //# END SNIPPET 3 | ||
|
|
||
| // This is readymade simulation package including some pre-processing steps and the InverseDynamics analysis | ||
| #include "Model\RunAppSequence.any" | ||
|
|
||
| }; //Main |
24 changes: 24 additions & 0 deletions
24
Finite_element_analysis/Snippets/Lesson2/Model/BodyModelConfiguration.any
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #path __BM_PLUGIN_FILE__ "BodyModelConfiguration.any" | ||
| #define BM_CONFIG_PLUGIN __BM_PLUGIN_FILE__ | ||
|
|
||
| // ----------------------------------------------------------------------------------- | ||
| // The BodyModel configuration can be modified using BodyModel GUI plugin | ||
| // or by manually editing this file. | ||
| // | ||
| // Please see this this file for more information on the options: | ||
| // #path HTML_DOC "<AMMR_PATH_DOC>/bm_config/index.html" | ||
| // ----------------------------------------------------------------------------------- | ||
|
|
||
| #define BM_MANNEQUIN_DRIVER_DEFAULT ON | ||
|
|
||
| // Enable the TLEM2 lower extremity model | ||
| #define BM_LEG_MODEL _LEG_MODEL_TLEM2_ | ||
|
|
||
| //# BEGIN SNIPPET 1 | ||
| // Switch off all muscles of the body model | ||
| §#define BM_LEG_MUSCLES_BOTH _MUSCLES_NONE_ | ||
| #define BM_TRUNK_MUSCLES _MUSCLES_NONE_§ | ||
|
|
||
| // Excluding the left arm segments | ||
| §#define BM_ARM_LEFT OFF§ | ||
| //# END SNIPPET 1 |
149 changes: 149 additions & 0 deletions
149
Finite_element_analysis/Snippets/Lesson2/Model/DrawSettings.any
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,149 @@ | ||
|
|
||
| DrawSettings ={ | ||
|
|
||
|
|
||
| //This is the color definitions of the nodes and segments | ||
| Colors = { | ||
| AnyBodyRed = {149/256,51/256,55/256}; //AnyBody standard red | ||
| AnyBodyGreen = {47/256,131/256,80/256}; //AnyBody standard green | ||
| AnyBodyBlue = {82/256,85/256,111/256}; //AnyBody standard blue | ||
| AnyBodyYellow= {235/256,197/256,17/256}; //AnyBody standard yellow | ||
| AnyBodyPaleYellow = {248/256,204/256,115/256}; //AnyBody standard pale yellow | ||
| AnyBodyGrey = {153/256,153/256,153/256}; //AnyBody standard grey | ||
|
|
||
| Nodes = AnyBodyPaleYellow; | ||
| Segments = AnyBodyPaleYellow; | ||
| }; | ||
|
|
||
| Muscle ={ | ||
| RGB = .Colors.AnyBodyRed; | ||
| Visible =On; | ||
| DrawScaleOnOff =Off; | ||
| Bulging =0.0; | ||
| ColorScale =1.0; | ||
| RGBColorScale = {0.957031, 0.785156, 0.785156}; | ||
| MaxStress = 2500000.000000; //N/m^2 //This number is for graphics only! | ||
| Opacity =1.0; | ||
| DrawScale = | ||
| { | ||
| EnableCreasing = Off; | ||
| CreasingAngle = 0.524; | ||
| EnableWireframe = Off; | ||
| EnableSmoothing = On; | ||
| Param = 0.0; | ||
| ParamArray = {0.0, 0.167, 0.333, 0.5, 0.667, 0.833, 1.0}; | ||
| RGBArray = {{0.0, 0.0, 0.6}, {0.0, 0.0, 1.0}, {0.0, 1.0, 1.0}, {0.0, 1.0, 0.0}, {1.0, 1.0, 0.0}, {1.0, 0.0, 0.0}, {0.6, 0.0, 0.0}}; | ||
| OpacityArray = {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}; | ||
| }; | ||
| }; | ||
|
|
||
|
|
||
| BonesOpacity ={ | ||
|
|
||
| GlobalCoef = 1; | ||
|
|
||
| Skull = 1*GlobalCoef; | ||
| Thorax = 1*GlobalCoef; | ||
| Pelvis = 1*GlobalCoef; | ||
| Sacrum = 1*GlobalCoef; | ||
| L5 = 1*GlobalCoef; | ||
| L4 = 1*GlobalCoef; | ||
| L3 = 1*GlobalCoef; | ||
| L2 = 1*GlobalCoef; | ||
| L1 = 1*GlobalCoef; | ||
|
|
||
| RightFoot = 1*GlobalCoef; | ||
| RightShank = 1*GlobalCoef; | ||
| RightThigh = 1*GlobalCoef; | ||
|
|
||
| LeftFoot = 1*GlobalCoef; | ||
| LeftShank = 1*GlobalCoef; | ||
| LeftThigh = 1*GlobalCoef; | ||
|
|
||
|
|
||
| RightClavicula = 1*GlobalCoef; | ||
| RightScapula = 1*GlobalCoef; | ||
| RightHumerus = 1*GlobalCoef; | ||
| RightUlna = 1*GlobalCoef; | ||
| RightRadius = 1*GlobalCoef; | ||
| RightHand = 1*GlobalCoef; | ||
|
|
||
| LeftClavicula = 1*GlobalCoef; | ||
| LeftScapula = 1*GlobalCoef; | ||
| LeftHumerus = 1*GlobalCoef; | ||
| LeftUlna = 1*GlobalCoef; | ||
| LeftRadius = 1*GlobalCoef; | ||
| LeftHand = 1*GlobalCoef; | ||
|
|
||
|
|
||
| // For leg TD only. | ||
| RightTalus = 1*GlobalCoef; | ||
| RightPatella = 1*GlobalCoef; | ||
|
|
||
| LeftTalus = 1*GlobalCoef; | ||
| LeftPatella = 1*GlobalCoef; | ||
|
|
||
|
|
||
| // For detailed cervical model only. | ||
| C1 = 1*GlobalCoef; | ||
| C2 = 1*GlobalCoef; | ||
| C3 = 1*GlobalCoef; | ||
| C4 = 1*GlobalCoef; | ||
| C5 = 1*GlobalCoef; | ||
| C6 = 1*GlobalCoef; | ||
| C7 = 1*GlobalCoef; | ||
| }; | ||
|
|
||
|
|
||
|
|
||
| SegmentAxes ={ | ||
| RGB ={0,0,1}; | ||
| ScaleXYZ ={0.0001,0.00001,0.00001}; | ||
| }; | ||
| BML ={ | ||
| ScaleXYZ ={0.0006,0.0006,0.0006}; | ||
| RGB = .Colors.AnyBodyBlue; | ||
| }; | ||
| JointAxesProximal = { | ||
| RGB = .Colors.AnyBodyRed; | ||
| ScaleXYZ = {0.015,0.015,0.015}; | ||
| }; | ||
| JointAxesDistal = { | ||
| RGB = .Colors.AnyBodyGreen; | ||
| ScaleXYZ = {0.01,0.01,0.01}; | ||
| }; | ||
|
|
||
|
|
||
| SegmentNodes ={ | ||
| ScaleXYZ ={0.0005,0.0005,0.0005}; | ||
| RGB = .Colors.AnyBodyRed; | ||
| }; | ||
| WrapGeometry ={ | ||
| RGB ={1,1,1}; | ||
| }; | ||
|
|
||
| DrawSettingsSupport={ | ||
| Lin={ | ||
| ScaleFactor=0.004; | ||
| RGB = {0,0,1}; | ||
| Thickness = 0.004; | ||
| HeadThickness = 2*Thickness; | ||
| HeadLength = 3*Thickness; | ||
| }; | ||
| Rot={ | ||
| ScaleFactor=0.08; | ||
| RGB = {1,0,0}; | ||
| Thickness = 0.075; | ||
| HeadThickness = 2*Thickness; | ||
| HeadLength = 5*Thickness; | ||
| }; | ||
| }; | ||
|
|
||
|
|
||
| Marker={ | ||
| Color={0,0,1}; | ||
| Radius=0.00; | ||
|
|
||
| }; | ||
|
|
||
| }; //DrawSettings |
36 changes: 36 additions & 0 deletions
36
Finite_element_analysis/Snippets/Lesson2/Model/Environment.any
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| AnyFolder Environment = { | ||
| //^ Environment files are used to include objects surrounding human, | ||
| //^ e.g. global reference frame | ||
|
|
||
| AnyFixedRefFrame GlobalRef = | ||
| { | ||
| AnyDrawRefFrame drw={ScaleXYZ=0.3*{1,1,1};}; | ||
|
|
||
| AnyRefNode RightFootPrint = { | ||
| //^ Positioning of the right foot. | ||
| //^ Ground-foot constraints can be excluded with: #define EXCLUDE_FOOT_CONSTRAINTS | ||
| sRel = HeelPosition; | ||
| ARel = RotMat({0,0,0}, ToeDirection, {0,10,0}); | ||
| AnyDrawRefFrame drw = {RGB = {0,0.7,0}; ScaleXYZ = 0.1*{1,1,1};}; | ||
| }; | ||
|
|
||
| AnyRefNode LeftFootPrint = { | ||
| //^ Positioning of the right foot. | ||
| //^ Ground-foot constraints can be excluded with: #define EXCLUDE_FOOT_CONSTRAINTS | ||
| sRel = HeelPosition; | ||
| ARel = RotMat({0,0,0}, ToeDirection, {0,10,0}); | ||
| AnyDrawRefFrame drw = {RGB = {0,0.7,0}; ScaleXYZ = 0.1*{1,1,1};}; | ||
| }; | ||
| //# BEGIN SNIPPET 1 | ||
| }; // End of GlobalRef | ||
|
|
||
| §AnySeg &RiArm = Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Clavicula; | ||
| RiArm ={ | ||
| AnyRefNode localrefframe={ | ||
| sRel = {0,0,0}; | ||
| // ARel = RotMat(0.5*pi,x); | ||
| AnyDrawRefFrame drws = {ScaleXYZ = {1,1,1}*0.3;RGB={0,0,1};}; | ||
| }; | ||
| };§ | ||
| }; | ||
| //# END SNIPPET 1 |
46 changes: 46 additions & 0 deletions
46
Finite_element_analysis/Snippets/Lesson2/Model/GRFPrediction.any
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
|
|
||
| //-------- GRFPrediction for the right leg | ||
| // See: #include "<ANYBODY_PATH_AMMR>/Tools/GRFPrediction/FootPlateConditionalContact.any" | ||
| FootPlateConditionalContact GRF_Prediction_Right( | ||
| NORMAL_DIRECTION = "Y", | ||
| NUMBER_OF_NODES = 25, | ||
| NODES_FOLDER = FootNodes, | ||
| PLATE_BASE_FRAME = Main.Model.Environment.GlobalRef, | ||
| GLOBAL_REF = Main.Model.Environment.GlobalRef, | ||
| SHOW_TRIGGER_VOLUME = ON | ||
| ) = | ||
| { | ||
| CreateFootContactNodes25 FootNodes( | ||
| foot_ref=Main.HumanModel.BodyModel.Right.Leg.Seg.Foot | ||
| ) = {}; | ||
|
|
||
| // Additional force plate settings | ||
| Settings = | ||
| { | ||
| LimitDistHigh = 0.025; // Vertical height | ||
| FrictionCoefficient = 0.8; | ||
| }; | ||
| }; | ||
|
|
||
|
|
||
| //-------- GRFPrediction for the right leg | ||
| // See: #include "<ANYBODY_PATH_AMMR>/Tools/GRFPrediction/FootPlateConditionalContact.any" | ||
| FootPlateConditionalContact GRF_Prediction_Left( | ||
| NORMAL_DIRECTION = "Y", | ||
| NUMBER_OF_NODES = 25, | ||
| NODES_FOLDER = FootNodes, | ||
| PLATE_BASE_FRAME = Main.Model.Environment.GlobalRef, | ||
| GLOBAL_REF = Main.Model.Environment.GlobalRef, | ||
| SHOW_TRIGGER_VOLUME = ON | ||
| ) = | ||
| { | ||
| CreateFootContactNodes25 FootNodes( | ||
| foot_ref=Main.HumanModel.BodyModel.Left.Leg.Seg.Foot | ||
| ) = {}; | ||
|
|
||
| Settings = | ||
| { | ||
| LimitDistHigh = 0.025; | ||
| FrictionCoefficient = 0.8; | ||
| }; | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously customers had to download this file from the Downloads on the website. But, for simplicity reasons, I like this more to be beginner-friendlier. But we need to keep an eye on updating the file or updating the tutoria