Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
## Setup steps

Install [Docker for Ubuntu](https://docs.docker.com/engine/install/ubuntu). The installation instructions were tested on the following OS/Docker version combination:
- Docker 23.0.03, Ubuntu 22.04.2 LTS

Prepare a directory to download and build Docker image.
```
cd ~
mkdir openmagnetics
cd openmagnetics
sudo wget https://raw.githubusercontent.com/OpenMagnetics/.github/main/Dockerfile
```

## Build steps

1. Build Docker image:
Build Docker image

```
cd ~/openmagnetics
docker build -t openmagnetics .
```

2. Enter built Docker image:
Run built the OpenMagnetics docker image form command line

```
docker run -it openmagnetics bash
```

3. Run tests:
To confirm proper installation and project compilation run the tests in each project. Each test should run without error.

```
/home/openmagnetics/OpenMagnetics/MAS
./MAS_tests
/home/openmagnetics/OpenMagnetics/MKF
./MKF_tests
/home/openmagnetics/OpenMagnetics/MVB
python3 tests/test_builder.py
/home/openmagnetics/OpenMagnetics/MAS/build/./MAS_tests
/home/openmagnetics/OpenMagnetics/MKF/build/./MKF_tests
python3 /home/openmagnetics/OpenMagnetics/MVB/tests/test_builder.py
```
44 changes: 22 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
# Using the Ubuntu image (our OS)
FROM ubuntu:latest
# Update package manager (apt-get)
# and install (with the yes flag `-y`)
# Python and Pip
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC

RUN apt-get update && apt-get install -y gnupg2 ca-certificates wget software-properties-common curl
# Make sure apt can see everything, then install the PPA tool
RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common ca-certificates gnupg2 curl wget \
&& rm -rf /var/lib/apt/lists/*

RUN apt-get install -y \
python3.11 \
python3-pip \
git \
cmake \
ninja-build
# Dev/build deps (separate layer keeps cache saner)
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 python3-pip python3-dev \
git cmake ninja-build build-essential pkg-config \
libboost-all-dev libeigen3-dev \
libjpeg-dev libtiff5-dev libpng-dev \
libfftw3-dev libopenblas-dev liblapack-dev \
&& rm -rf /var/lib/apt/lists/*

# FreeCAD (daily) PPA — only valid on Ubuntu
RUN add-apt-repository -y ppa:freecad-maintainers/freecad-daily \
&& apt-get update \
&& apt-get install -y --no-install-recommends freecad-daily \
&& rm -rf /var/lib/apt/lists/*

# ...rest of your Dockerfile (clone/build MAS & MKF, pip install, etc.)

RUN mkdir /root/.ssh

Expand All @@ -32,7 +42,6 @@ RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
RUN apt install -y gcc-11 g++-11
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 10
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 10
RUN apt-get install -y libboost-all-dev libeigen3-dev

RUN mkdir -p /home/openmagnetics
WORKDIR /home/openmagnetics
Expand All @@ -50,15 +59,6 @@ WORKDIR /home/openmagnetics/OpenMagnetics/MAS/build
RUN cmake .. -G "Ninja"
RUN cmake --build .

WORKDIR /home/openmagnetics/OpenMagnetics/MKF
RUN mkdir build && cd build
WORKDIR /home/openmagnetics/OpenMagnetics/MKF/build
RUN cmake .. -G "Ninja"
RUN python3 -m pip install -e ../ -vvv
RUN cmake --build .

RUN add-apt-repository ppa:freecad-maintainers/freecad-daily
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y -qq freecad-daily

WORKDIR /home/openmagnetics/OpenMagnetics/MVB
RUN python3 -m pip install -r requirements.txt
93 changes: 93 additions & 0 deletions profile/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,94 @@
Open Magnetics is a an open-source platform for collecting and sharing knowledge about Magnetic Components

```mermaid
classDiagram
MKF <|-- PyMKF
MKF <|-- WebLibMKF
MKF <|-- MKFNet
MAS <|-- MKF


namespace ModulesAndLanguages {
class MKF{
C++
simulate()
design()
findInCatalog()
}
class PyMKF{
Python
loadCatalog()
}
class WebLibMKF{
Javascript
loadCatalog()
}
class MKFNet{
CSharp
loadCatalog()
}
class MAS{
JsonSchema
loadCoreMaterials()
loadCoreShapes()
}
}

style MKF fill:orange,stroke:black,color:black
style PyMKF fill:green,stroke:black,color:black
style WebLibMKF fill:cyan,stroke:black,color:black
style MKFNet fill:pink,stroke:black,color:black
style MAS fill:olive,stroke:black,color:black


```

```mermaid
classDiagram
namespace OpenMagnetics {
class WebFrontend {
Vue3.js + WASM + WebLibMKF
}

class WebBackend {
Python + FastAPI + PyMKF
Plot()
}

class MAS {
JSON + MAS
}
}
class Ansyas {
Python + PyMKF
}
class Ansys
class Trafolo
class LtSpice
class Ngspice
class Simba
class NL5
class PSIM
class PSPICE

WebFrontend <--> WebBackend
WebFrontend --> MAS
MAS --> Trafolo
MAS --> Ansyas
Ansyas --> Ansys
WebFrontend --> LtSpice
WebFrontend --> Ngspice
WebFrontend --> Simba
WebFrontend --> NL5
WebFrontend --> PSIM
WebFrontend --> PSPICE

style MKF fill:orange,stroke:black,color:black

style PyMKF fill:green,stroke:black,color:black
style WebBackend fill:green,stroke:black,color:black
style Ansyas fill:green,stroke:black,color:black
style WebFrontend fill:cyan,stroke:black,color:black
style WebLibMKF fill:cyan,stroke:black,color:black
style MAS fill:olive,stroke:black,color:black
```