Message Boards Message Boards

0
|
1560 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

How can I obtain support files required to run a built-in tutorial?

I have installed Mathematica+Documentation (v13.2) on a MacBook Pro in order to explore what appear to be excellent example tutorials on acoustics. In particular, I wanted to experiment with the following built-in example:

PDEModels/tutorial/Acoustics/ModelCollection/RoomEigenfrequencies

I am able to load the notebook, and am able to evaluate some of the initial cells. When I evaluate the first cell, I get the following message:

Do you want to automatically evaluate all the initialization cells in the notebook "RoomEigenfrequencies.nb"?

I click Yes, but encounter an issue when I reach the following cell/code:

furnitureBmesh = Import[FileNameJoin[{
ParentDirectory[
NotebookDirectory[], 6], "SupportFiles", "furniture.stl"}], 
   "ElementMesh"];
furnitureMesh = ToElementMesh[furnitureBmesh];
RegionPlot3D[furnitureMesh, Sequence[
 PlotTheme -> "Detailed", PlotLegends -> None, 
  AxesLabel -> {"x", "y", "z"}, PlotStyle -> Directive[LightGray], 
  Mesh -> None, ImageSize -> Medium]]

Evaluating this cell results in the following error message:

Import::nffil: File /Library/Wolfram/Documentation/13.2/en-us/Documentation/SupportFiles/furniture.stl not found during Import.

The code above references contents of a directory "SupportFiles" which is specified as a relative path with respect to the tutorial notebook. Checking on my hard drive, the directory "SupportFiles" does not seem to exist (either at the specified relative path or anywhere else in Mathematica-related directories).

I do not know if this is an idiosyncrasy related to this specific tutorial file (which might contain stale references), or if I am missing the directory "SupportFiles" that should have been created when I installed Mathematica.

Any guidance on this question will be appreciated!

Rick

POSTED BY: Richard Hoge

I found the cause of my problem:

On MacOS, the "Support Files" referenced in some of the acoustics examples are installed inside of Mathematica's "application bundle":

/Applications/Mathematica.app/Contents/SystemFiles/Components/PDEModels/SupportFiles

The code in the "Eigenfrequencies of a Room" example looks for SupportFiles under

/Library/Wolfram/Documentation/13.2/en-us/Documentation/

a directory which exists, but is not the location for SupportFiles on a MacOS installation. Editing the code to point to the correct path fixes the problem. Annoyingly, when built-in examples are loaded in Mathematica, the "Save As..." option seems to be disabled (I can understand "Save" being disabled so you don't overwrite internal documentation, which should be read-only). I just made a copy of the notebook under my user directory and it works great after fixing the path.

Another notebook in the "Acoustic Models" series (for an automotive muffler) contains the correct path.

Hopefully this workaround will be helpful if anyone tries experimenting with this on a Mac. Files inside the application bundle do not show up in a normal system search on MacOS, so are harder to find. I have no idea if the paths resolve correctly on Windows or Linux versions of Mathematica.

POSTED BY: Richard Hoge
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract