AnyMechStudy problem

I am trying to extract data about the muscle forces acting on the tibia using my own C3D file. I am able to optimize the model and successfully run the InverseDynamicStudy. However, the mechanical study is not running properly, because whenever I try to output the data using AnyMechOutputFileForceExport, the files reads:

"AnyMechOutputFileForceExport does only export data associated with AnyMechStudy. No data was outputted in this case.

This file was either written before a mechnical study has been active during an operation. The output file will contain data from the latest active mechanical study."

I’ve been trying to figure this out but can not on my own. This is my main code:

Main = {

#include “Model/ModelSetup.any”
#include “Model/Environment.any”
#include “Input/TrialSpecificData.any”

AnyFolder Studies ={
#if MotionAndParameterOptimizationModel
#include “Model/Kinematics.any”
#endif

#if InverseDynamicModel
  #include "Model/InverseDynamics.any"       
#endif 

AnyMechStudy MechAnalysis = 
{
  tStart = Main.ModelSetup.tStart+2*Kinematics.ApproxVelAccPerturb; 
  tEnd = Main.ModelSetup.tEnd-2*Kinematics.ApproxVelAccPerturb;
  nStep = Main.TrialSpecificData.nStep;
  Gravity = Main.TrialSpecificData.Gravity;      
};
    
AnyMechOutputFileForceExport ForceOutput = 
{
  FileName = "Output/ForceShank.txt";
  AllSegmentsInStudyOnOff = Off;
  AnySeg &Shank = Main.Studies.HumanModel.BodyModel.Left.Leg.Seg.Shank;
};

};
};

What am I missing here? I used the MyMocapModel example as the base for my code.

Hi Andrew,

Put the output section into the inverse dynamics study:

InverseDynamicsStudy = {
AnyMechOutputFileForceExport ForceOutput = 
{
FileName = "Output/ForceShank.txt";
AllSegmentsInStudyOnOff = Off;
AnySeg &Shank = Main.Studies.HumanModel.BodyModel.Left.Leg.Seg.Sha nk;
};
};

All output definitions require to be in the right study in order to work.

You will not need the AnyMechStudy block, so you can remove it.

Regards,
Pavel

Thank you. I changed the code and ran it but received this error:

ERROR(OBJ.FILE1) : C:/U…s/A…w/D…s/A…y/A…0/AMMR/A…n/E…s/T…2/M…l/InverseDynamics.any(49) : ForceOutput.FileName : Problem with file : C:\Users\Andrew\Documents\AnyBody Technology\AnyBody.6.0\AMMR\Application\Examples\TIBIA2\Model\Output\ForceShank.txt : The output data file does not exist and cannot be created.

Not sure what this means. Do I need to create a text file before running the test?

Most likely it needs the “Output” folder. It should be able to write a file.

Regards,
Pavel

Yes, it works. The output folder had to be in the models folder rather than the main folder.

Now I am trying to convert that file into an abaqus file (to eventually perform a FEA in FEBio). I downloaded the AnyFE2Abq software and placed it in the model/output folder (the main folder has the main script, and the Input, Output, and Model folders, and the model folder also has an output folder). However, if I try to run it from the command prompt (or run the .exe file) I receive a message that says “No valid license has been found.” I tried running it via code by writing the following into the InverseDynamics.any script (which is in the models folder), in the study, beneath the AnyMechOutputFileForceExport command:

AnyOperationShellExec ConvertToAbq =
{
Show=On;
FileName = “Output\AnyFE2Abq\AnyFE2Abq.exe”;
Arguments = “-i .\Output\ForceShank.xml -o .\Output\ForceShank.inp -m .\Output\Shank.inp”;
WorkDir=".\ ";
};

I could not find anything on this in your tutorials as to why this isn’t working. Do I need a special license for the conversion softwares?

Hi Andrew,

No, you don’t need a special license. You just need to copy the AMS license into the folder containing the AnyFE2Abq.exe. You may also need to rename it to license.lic.

Kind regards,
Pavel

Where’s the license file? I can’t find any file that looks like it would be it; what’s the name of the file?

Help->Registration->View license status will give an overview of all your licenses and their locations.

Regards,
Pavel

I found it, but am still confused as to actually run the program. The code doesn’t output anything. When I try to run it from the command window, it asks for a path to the input file, the output location, and then the mesh file path. What’s the mesh file if I use the MyMocap model, and then try to input a custom geometry? Is the code I pasted earlier incorrect in any way (wrote it after your tutorials)?

Hi Andrew,

I just noticed a small error:
seems that i have copied a wrong example that would generate a text file, not an XML as needed. Please correct like this:

      AnyMechOutputFileForceExport ForceOutput = 
      {
        FileName = "Output/ForceShank.xml";
        AllSegmentsInStudyOnOff = Off;
        AnySeg &Shank = Main.Studies.HumanModel.BodyModel.Left.Leg.Seg.Shank;
        XMLformatOnOff = On;
      };      

Secondly, could you try to run from the Output folder the following command:

AnyFE2Abq\AnyFE2Abq.exe -i ForceShank.xml -o ForceShank.inp -m Shank.inp

Please note that the Output folder should contain a folder, called AnyFE2Abq, which, in turn, contains the executable and license.lic next to it. As well as that you need to copy Shank.inp file, that contains the mesh and material properties, into the Output folder.

Kind regards,
Pavel

After the proper information is inputted, the command screen says 'failed to parse “” ’

Not sure why it is saying this, as the XML file is the one the program outputted.

Most likely it failed to parse the mesh file, not the loads.
The converter expects a simplified mesh format (such format is commonly produced by most of the FE preprocessing software and mesh generation software):
*NODE
1, 0.00, 0.00, 0.00

*ELEMENT
1, 1, 2 ,3

etc.
But it might be that you are using a mesh file generated by Abaqus CAE, which contains parts, complex nested structures and so on.

The one I was testing it on was the tibia built into the MyMocapModel example. I do have meshlab - is there a format/method you recommend to convert the .stl into a usable mesh?

It says ‘fail to parse ForceShank.xml’ I used the geometry built into your examples. What format should the mesh file be in?

Hi Andrew,

It should be an Abaqus input deck, containing the mesh, as i described before (unfortunately saving from AbaqusCAE will result in a complex format that needs to be simplified). The STL itself cannot be used here as a mesh file and this is what gives you this error message. We will take into consideration an option that may work with the STL for future development.

Regards,
Pavel