Skip to content

Commit ec4b295

Browse files
authored
Merge branch 'master' into AnsysTutorial
2 parents fad7633 + 2edf6c7 commit ec4b295

294 files changed

Lines changed: 6404 additions & 147688 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
steps:
3838
- uses: actions/checkout@v6
3939

40-
- uses: prefix-dev/setup-pixi@v0.9.3
40+
- uses: prefix-dev/setup-pixi@v0.9.6
4141
with:
4242
cache: true
4343
cache-write: ${{ contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && github.ref_name == 'master' }}
@@ -54,7 +54,7 @@ jobs:
5454
with:
5555
ref: ${{ needs.find-tag.outputs.latest-tag }}
5656

57-
- uses: prefix-dev/setup-pixi@v0.9.3
57+
- uses: prefix-dev/setup-pixi@v0.9.6
5858
with:
5959
cache: true
6060
cache-write: ${{ contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && github.ref_name == 'master' }}
@@ -96,7 +96,7 @@ jobs:
9696
echo #include "%GITHUB_WORKSPACE%/ammr/libdef.any" > libdef.any
9797
echo #include "%GITHUB_WORKSPACE%/ammr4/libdef.any" > libdef-ammr4.any
9898
99-
- uses: prefix-dev/setup-pixi@v0.9.3
99+
- uses: prefix-dev/setup-pixi@v0.9.6
100100
with:
101101
cache: true
102102
cache-write: ${{ contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && github.ref_name == 'master' }}
@@ -125,15 +125,15 @@ jobs:
125125
with:
126126
fetch-depth: 0
127127

128-
- uses: prefix-dev/setup-pixi@v0.9.3
128+
- uses: prefix-dev/setup-pixi@v0.9.6
129129
with:
130130
cache: true
131131
cache-write: ${{ contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && github.ref_name == 'master' }}
132132

133133
- name: Build Documentation
134134
run: pixi run sphinx-build -M html . _build -W --keep-going -a -t draft
135135

136-
- uses: actions/upload-artifact@v6
136+
- uses: actions/upload-artifact@v7
137137
with:
138138
name: beta-version
139139
path: _build/html
@@ -150,7 +150,7 @@ jobs:
150150
ref: ${{ needs.find-tag.outputs.latest-tag }}
151151
fetch-depth: 0
152152

153-
- uses: prefix-dev/setup-pixi@v0.9.3
153+
- uses: prefix-dev/setup-pixi@v0.9.6
154154
with:
155155
cache: true
156156
cache-write: ${{ contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && github.ref_name == 'master' }}
@@ -159,7 +159,7 @@ jobs:
159159
run: pixi run sphinx-build -M html . _build -W --keep-going -a
160160

161161

162-
- uses: actions/upload-artifact@v6
162+
- uses: actions/upload-artifact@v7
163163
with:
164164
name: tagged-version
165165
path: _build/html
@@ -168,15 +168,15 @@ jobs:
168168
needs: [build-latest, build-tagged, test-latest]
169169
runs-on: ubuntu-latest
170170
steps:
171-
- uses: actions/download-artifact@v7
171+
- uses: actions/download-artifact@v8
172172
with:
173173
name: tagged-version
174174
path: public
175-
- uses: actions/download-artifact@v7
175+
- uses: actions/download-artifact@v8
176176
with:
177177
name: beta-version
178178
path: public/beta
179-
- uses: actions/upload-pages-artifact@v4
179+
- uses: actions/upload-pages-artifact@v5
180180
with:
181181
path: public
182182

@@ -198,6 +198,6 @@ jobs:
198198
steps:
199199
- name: Deploy to GitHub Pages
200200
id: deployment
201-
uses: actions/deploy-pages@v4
201+
uses: actions/deploy-pages@v5
202202

203203

78.8 KB
Loading

A_Getting_started/intro.md

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,58 @@
66
:::{note} The AnyBody software comes with an inbuilt model repository - The
77
AnyBody Managed Model Repository (AMMR). This tutorial starts with unpacking a
88
local version of the AMMR. You can skip to {doc}`lesson 1 <lesson1>` if you have
9-
already done this.
9+
already done this.
1010
:::
1111

1212
## Goals for this tutorial
1313

1414
This tutorial takes a top-down approach and aims to accomplish the following:
1515

1616
1. Create a new standing model using the Human Standing template model
17-
2. Learn how to load & change the posture of the human model, and use
17+
2. Learn how to load & change the posture of the human model, and use
1818
the model view window
1919
3. Run an inverse dynamics analysis and review the results
2020

21-
This tutorial relies heavily on using the AnyBody Managed Model Repository (AMMR).
21+
This tutorial relies heavily on using the AnyBody Managed Model Repository (AMMR).
2222
Follow the steps below to unpack a local version of the AMMR.
2323

24-
## Setup the AMMR
24+
(SettingUpAMMR)=
2525

26-
Before you continue, you must unpack the entire repository and save it on your
27-
hard disk. To get a copy of the AMMR, press the Demo tab in the AnyBody
28-
assistant dialog box.
26+
## Setting Up the AMMR
2927

30-
![...](_static/intro/image1.png)
28+
The *AnyBody Managed Model Repository* (AMMR) is a comprehensive open library of
29+
musculoskeletal models and examples designed to use with the AnyBody Modeling
30+
System. It allows users to configure and combine different body models, which
31+
can be easily integrated into their own simulations and analyses.
3132

32-
Following the instructions in the Demo tab will install a copy of the AMMR in
33-
your documents folder by default. It is good practice to create a second local
34-
copy of the AMMR so that you do not overwrite the original AMMR folder by
35-
accident.
33+
The AnyBody Managed Model Repository (AMMR) is included with the AnyBody
34+
Modeling System. You can navigate to the Demo tab in the AnyBody
35+
Assistant dialog box.
36+
37+
```{figure} _static/intro/image1.png
38+
:alt: AMMR setup
39+
:class: bg-primary
40+
:align: center
41+
```
42+
43+
In the Demos tab you will find a gallery of the example models included in the AMMR.
44+
Following the link will take you to the application example overview page.
45+
46+
```{figure} _static/intro/assistant_gallery.png
47+
:alt: AnyBody Assistant demo tab gallery overview
48+
:class: bg-primary
49+
:align: center
50+
```
51+
52+
From here you are can browse the description of each model and open them directly in
53+
AnyBody. The first time you open one of the models, you will be prompted to unpack the
54+
full AMMR into your computer.
3655

3756
## AMMR structure
3857

3958
Open a file manager and navigate to the directory where you unpacked the
40-
repository. You should see a folder structure that includes the following
41-
subfolders:
59+
repository (the default is your documents folder). You should see a folder structure
60+
that includes the following subfolders:
4261

4362
- **Application**: Includes demo simulations of activities such as cycling,
4463
lifting a box, or propelling a wheelchair.
@@ -59,8 +78,17 @@ A closer inspection of the Application branch reveals that it has four subfolder
5978
purposes, typically by comparison of the model predictions with experimental
6079
measurements.
6180

81+
:::{important}
82+
AnyBody Modeling System comes with a version of AMMR (not necessarily the
83+
latest) placed in the installation folder of the software. Do not directly use
84+
these files for your actual work as updates or reinstallation of AnyBody can
85+
overwrite your changes. So always **copy the files from the AMMR folder to your**
86+
**working folder** before using them.
87+
:::
88+
6289
:::{admonition} **Continue**
6390
:class: seealso
6491

6592
With that knowledge, you are all set to go, and you can proceed with
66-
{doc}`Lesson 1: Creating the standing model <lesson1>` using the template. :::
93+
{doc}`Lesson 1: Creating the standing model <lesson1>` using the template.
94+
:::

A_Getting_started/lesson1.md

Lines changed: 153 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,16 @@ location of the file is shown in the title bar:
6060
```
6161

6262
:::{warning}
63-
If you saved your model in an other location be
63+
If you saved your model in another location be
6464
sure to modify the {file}`../libdef.any` file so it points
6565
to AMMR repository you want to use.
66+
67+
The following line should always refer correctly to the libdef file
68+
regardless of where you save your model.
69+
70+
```AnyScriptDoc
71+
#include "<ANYBODY_PATH_INSTALLDIR>/AMMR/libdef.any"
72+
```
6673
:::
6774

6875
(loading-a-model)=
@@ -88,7 +95,7 @@ another file loading priority by right-clicking its tab and select “Load Model
8895
## The model view
8996

9097
When loading is completed, the Model View window opens and shows the standing
91-
model: (You can open it manually from View -> Model Views).
98+
model. You can open it manually from View -> Model Views.
9299

93100
```{image} _static/lesson1/image_5.png
94101
:alt: Model view
@@ -110,5 +117,149 @@ functions, so keyboard shortcuts have been provided:
110117
- If you have a scrolling wheel on your mouse, this will zoom the model
111118
in and out.
112119

120+
## Understanding the AnyScript Model Structure
121+
122+
This Human Standing Model is a model from the AnyBody Managed Model Repository
123+
(AMMR). It uses the [Human Model](https://anyscript.org/ammr/beta/body/models.html#the-body-model)
124+
from the AMMR, which is used by most models you will encounter when using the AMMR.
125+
Regardless of complexity, all models share a common structure used to set them
126+
up.
127+
128+
The models will typically have the following overall structure (*notice*, the
129+
AnyScript below is not excatly the same as the Standing Model used in this
130+
tutorial, but contains the same overall structure):
131+
132+
```AnyScriptDoc
133+
// Include the libdef file from the AMMR
134+
#include "libdef.any"
135+
136+
Main =
137+
{
138+
// Define the BodyModel configuration
139+
#include "Model/BodyModelConfiguration.any"
140+
141+
// Include the Human model from AMMR
142+
#include "<ANYBODY_PATH_BODY>/HumanModel.any"
143+
144+
// Define desired posture or movement of the model
145+
#include "Model\Mannequin.any"
146+
147+
// Compose the model
148+
AnyFolder Model =
149+
{
150+
AnyFolder &BodyModel = .HumanModel.BodyModel;
151+
AnyFolder Drivers = {...};
152+
AnyFolder Environment = {...};
153+
};
154+
155+
// Configuring the Study
156+
AnyBodyStudy Study =
157+
{
158+
AnyFolder &Model= .Model;
159+
Gravity = {0.0, -9.81,0.0}; // Gravity Vector
160+
nStep = 10; // Number of steps
161+
tStart = 0; // Start time
162+
tEnd = 10.0; // End time
163+
};
164+
};
165+
```
166+
167+
Let us go through the different components of this structure to understand how they work.
168+
169+
### Path to AMMR:
170+
171+
:::{note}
172+
:class: margin
173+
You can open a file by double-clicking on its name in the AnyScript.
174+
:::
175+
176+
```AnyScriptDoc
177+
#include "libdef.any"
178+
```
179+
180+
This means your model will include the content of the file called `libdef.any`.
181+
This file references to another `libdef.any` file located at the top-level
182+
folder of the AMMR, which specifies the AMMR directories to use in your model.
183+
You can have multiple versions of AMMR available on your computer, and this
184+
points to the version you wish to use. This line should be at the very beginning
185+
of your `main.any` file.
186+
187+
### Configuring the Human Model:
188+
189+
```AnyScriptDoc
190+
Main =
191+
{
192+
// Define the BodyModel configuration
193+
#include "Model/BodyModelConfiguration.any"
194+
```
195+
196+
Here, the main declaration of the model, `Main = {}`, is initiated, and this file now
197+
becomes the main model file. All basic AnyScript contains a main file that
198+
defines the model’s structure, contents and the operations to be performed.
199+
200+
The file `BodyModelConfiguration.any` is included, which defines what parts of the
201+
human body model are included, through a number of switches called Body Model
202+
(BM) parameters. BM parameters are always prefixed with `BM_` inside AnyScript.
203+
The values of these parameters are defined by `#define` and `#path` statements.
204+
205+
### Including the Human Model
206+
207+
```AnyScriptDoc
208+
#include "<ANYBODY_PATH_BODY>/HumanModel.any"
209+
```
210+
211+
The AMMR contains multiple musculoskeletal models. The above line includes the
212+
Human Model from the AMMR. The file path `<ANYBODY_PATH_BODY>` is defined in
213+
`libdef.any`.
214+
215+
It is important that the above configuration statements are placed
216+
before this line.
217+
218+
### Defining the Posture and Movement
219+
220+
```AnyScriptDoc
221+
#include "Model\Mannequin.any"
222+
```
223+
224+
This includes the file `Mannequin.any` which defines the posture and movement of
225+
the human body model.
226+
227+
### Composing the Model
228+
229+
```AnyScriptDoc
230+
AnyFolder Model =
231+
{
232+
AnyFolder &BodyModel = .HumanModel.BodyModel;
233+
AnyFolder Drivers = {...};
234+
AnyFolder Environment = {...};
235+
};
236+
```
237+
238+
This is where we combine the `Body` from the Human Model with extra things like
239+
drivers, external loads, and constraints. It could also be any models of the
240+
environment which the body interacts with or many other things.
241+
242+
### The Study section
243+
244+
```AnyScriptDoc
245+
AnyBodyStudy Study =
246+
{
247+
AnyFolder &Model= .Model;
248+
Gravity = {0.0, -9.81,0.0}; // Gravity Vector
249+
nStep = 10; // Number of steps
250+
tStart = 0; // Start time
251+
tEnd = 10.0; // End time
252+
};
253+
```
254+
255+
The `AnyBodyStudy` is where you configure and define your simulation. It
256+
specifies start and end times of the simulation, and the number of steps. It also
257+
configures which solvers are used.
258+
259+
Only the model elements which are referenced to within the Study will be
260+
included in the simulation. In this case, the line `AnyFolder &Model= .Model;`
261+
references to the Model folder, meaning everything in the Model folder is part of the
262+
simulation.
263+
113264
You can now proceed to {doc}`lesson2`.
114265

A_Getting_started/lesson2.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ The script editor currently shows the main file of the model, which includes the
77
line of code `Main = {}`. Any basic AnyScript contains a main file that defines
88
the model's structure and the operations to be performed on the model.
99

10-
The `Mannequin.any` file, included in the main file, determines the posture of
11-
the Standing Model by specifying the angles at the anatomical joints.
12-
13-
Scroll down to the line that says `#include "Model\Mannequin.any"`.
10+
Scroll down to the line that says `#include "Model\Mannequin.any"`. This line
11+
means that your model will include the content of the file called
12+
`Mannequin.any` located in the Model folder, within the main file.
1413

1514
## Mannequin file structure
1615

@@ -20,8 +19,8 @@ Scroll down to the line that says `#include "Model\Mannequin.any"`.
2019
:end-before: //# END SNIPPET 1
2120
```
2221

23-
**This line means that your model will include the content of the
24-
"Mannequin.any" file located in the Model folder, within the main file.**
22+
The `Mannequin.any` file determines the posture of the Standing Model by
23+
specifying the angles at the anatomical joints.
2524

2625
Double-clicking the file name in the editor window after loading
2726
your model opens the mannequin file in a new tab. Then you see the

0 commit comments

Comments
 (0)