Skip to content

Commit

Permalink
Merge pull request #233 from Morpho-lang/dev
Browse files Browse the repository at this point in the history
Merge 0.5.7 into main
  • Loading branch information
softmattertheory authored Jun 20, 2023
2 parents cdc5131 + 0aea13e commit 60f7537
Show file tree
Hide file tree
Showing 75 changed files with 1,737 additions and 216 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,23 +114,25 @@ morpho5

Note that the build script places morpho5 and morphoview in the `/usr/local` file structure; this can easily be changed if a different location is preferred. See the manual for details.

### Windows via Windows Subsystem for Linux (WSL)
### Windows via Windows Subsystem for Linux (WSL2)

#### Install WSL
#### Install WSL2

The instructions to install the Ubuntu App are [here](https://ubuntu.com/tutorials/ubuntu-on-windows#1-overview).
If you don't have WSL2 installed on your Windows computer, follow the instructions to install the Ubuntu App [here](https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-11-with-gui-support#1-overview). Follow all the steps in this link to ensure that graphics are working.

Once the Ubuntu terminal is working in Windows, you can install Morpho through it in almost the same way as a Linux system, with the addition of an X windows manager to handle visualizations.
#### Install Morpho

Unless mentioned otherwise, all the commands below are run in the Ubuntu terminal.
Once the Ubuntu terminal is working in Windows, you can install Morpho the same way as in Linux by running the commands in the [instructions](#unix-and-linux) in the Ubuntu terminal.

#### Install Morpho
If you are using WSL2, then the installation is complete.

Follow the instructions for the linux install above.
#### Graphics On WSL1

#### Get visualization working in WSL
If you instead are working on WSL1, then you need to follow these instructions to get graphics running.

Unless mentioned otherwise, all the commands below are run in the Ubuntu terminal.

Now a window manager must be installed so that the WSL can create windows.
A window manager must be installed so that the WSL1 can create windows.

1\. On Windows, install [VcXsrv](https://sourceforge.net/projects/vcxsrv/).

Expand Down
2 changes: 1 addition & 1 deletion devguide/devguide.lyx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Developer Guide
\begin_inset Newline newline
\end_inset

Version 0.5.6
Version 0.5.7
\end_layout

\begin_layout Standard
Expand Down
Binary file modified devguide/devguide.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions examples/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def run(file,testLog,CI):

if (iserror(line)):
if not CI:
print(stylize("Failed",colored.fg("red")))
print("Failed") #stylize("Failed",colored.fg("red"))) // Temporarily disable this 6/19/23 due to colored module API change
else:
print("::error file = {",file,"}::{",file," Failed}")

Expand All @@ -101,7 +101,7 @@ def run(file,testLog,CI):
if (ret ==1):
if not CI:
print(file+":", end=" ")
print(stylize("Passed",colored.fg("green")))
print("Passed") #stylize("Passed",colored.fg("green")))
# Delete the temporary file
os.system('rm ' + tmp)
return ret
Expand Down
Binary file modified manual/manual.pdf
Binary file not shown.
11 changes: 8 additions & 3 deletions manual/src/Reference/functionals.tex
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,16 @@ \subsection{ScalarPotential}\label{scalarpotential}}
The \texttt{ScalarPotential} functional is applied to point elements.

\begin{lstlisting}
var ls = ScalarPotential(potential, gradient)
var ls = ScalarPotential(potential)
\end{lstlisting}

You must supply two functions (which may be anonymous) that return the
potential and gradient respectively.
You must supply a function (which may be anonymous) that returns the
potential. You may optionally provide a function that returns the
gradient as well at initialization:

\begin{lstlisting}
var ls = ScalarPotential(potential, gradient)
\end{lstlisting}

This functional is often used to constrain the mesh to the level set of
a function. For example, to confine a set of points to a sphere:
Expand Down
32 changes: 32 additions & 0 deletions manual/src/Reference/matrix.tex
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,17 @@ \subsection{Inner}\label{inner}}
var prod = A.inner(B)
\end{lstlisting}

\hypertarget{outer}{%
\subsection{Outer}\label{outer}}

Computes the outer produce between two vectors:

\begin{lstlisting}
var prod = A.outer(B)
\end{lstlisting}

Note that \texttt{outer} always treats both vectors as column vectors.

\hypertarget{inverse}{%
\subsection{Inverse}\label{inverse}}

Expand Down Expand Up @@ -190,3 +201,24 @@ \subsection{Trace}\label{trace}}
\begin{lstlisting}
var tr = A.trace()
\end{lstlisting}

\hypertarget{roll}{%
\subsection{Roll}\label{roll}}

Rotates values in a Matrix about a given axis by a given shift:

\begin{lstlisting}
var r = A.roll(shift, axis)
\end{lstlisting}

Elements that roll beyond the last position are re-introduced at the
first.

\hypertarget{identitymatrix}{%
\subsection{IdentityMatrix}\label{identitymatrix}}

Constructs an identity matrix of a specified size:

\begin{lstlisting}
var a = IdentityMatrix(size)
\end{lstlisting}
67 changes: 65 additions & 2 deletions manual/src/Reference/system.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,84 @@ \section{System}\label{system}}
The \texttt{System} class provides information and access to some
features of the runtime environment.

\hypertarget{platform}{%
\subsection{Platform}\label{platform}}

Detect which platform morpho was compiled for:

\begin{lstlisting}
print System.platform()
\end{lstlisting}

which could return \texttt{macos}, \texttt{linux}, \texttt{unix} or
\texttt{windows}.
which returns \texttt{"macos"}, \texttt{"linux"}, \texttt{"unix"} or
\texttt{"windows"}.

\hypertarget{version}{%
\subsection{Version}\label{version}}

Find the current version of morpho:

\begin{lstlisting}
print System.version()
\end{lstlisting}

\hypertarget{clock}{%
\subsection{Clock}\label{clock}}

Returns the system time in seconds, with at least millisecond
granularity. Primarily intended for timing:

\begin{lstlisting}
var start=System.clock()
// Do something
print System.clock()-start
\end{lstlisting}

Note that \texttt{System.clock} measures the actual physical time
elapsed, not the time spent in a process.

\hypertarget{sleep}{%
\subsection{Sleep}\label{sleep}}

Pauses the program for a specified number of seconds:

\begin{lstlisting}
System.sleep(0.5) // Sleep for half a second
\end{lstlisting}

\hypertarget{readline}{%
\subsection{Readline}\label{readline}}

Reads a line of input from the console:

\begin{lstlisting}
var in = System.readline()
\end{lstlisting}

\hypertarget{arguments}{%
\subsection{Arguments}\label{arguments}}

Returns a \texttt{List} of arguments passed to the current morpho on the
command line.

\begin{lstlisting}
var args = System.arguments()
for (e in args) print e
\end{lstlisting}

Run a morpho program with arguments:

\begin{lstlisting}
morpho5 program.morpho hello world
\end{lstlisting}

Note that, in line with UNIX conventions, command line arguments before
the program file name are passed to the \texttt{morpho5} runtime; those
after are passed to the morpho program via \texttt{System.arguments}.

\hypertarget{exit}{%
\subsection{Exit}\label{exit}}

Stop execution of a program:

\begin{lstlisting}
Expand Down
Binary file modified manual/src/Tutorial/0ExampleMesh/meshgrade0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/src/Tutorial/0ExampleMesh/meshgrade1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/src/Tutorial/0ExampleMesh/meshgrade2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/src/Tutorial/1Mesh/mesh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/src/Tutorial/2Visualize/out.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/src/Tutorial/2Visualize/selection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/src/Tutorial/3Refine/out1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/src/Tutorial/3Refine/out2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/src/Tutorial/3Refine/out3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 60f7537

Please sign in to comment.