├── .dockerignore
├── .gitignore
├── COPYING
├── Dockerfile
├── LICENSES.md
├── README.md
├── TODO.md
├── auths
├── htpasswd
│ ├── .htaccess
│ ├── .htpasswd
│ ├── README.md
│ └── auth.php
└── single-user
│ └── auth.php
├── bin
└── .gitignore
├── cadimporters
└── upload
│ ├── gmshcheck.py
│ └── import_cad.php
├── cadprocessors
└── gmsh
│ ├── cad2stl.py
│ ├── cadcheck.py
│ ├── cadimport.py
│ ├── initial_mesh.sh
│ └── process.php
├── conf.php
├── data
└── .gitignore
├── deps.sh
├── doc
├── FAQs.md
├── INSTALL.md
├── README.md
├── design.md
├── logo.svg
├── tutorials.md
├── virtual.md
└── workflow.md
├── html
├── .htaccess
├── ajax2mesh.php
├── ajax2problem.php
├── ajax2yaml.php
├── assets
│ └── named_cube.x3d
├── cad.php
├── case.php
├── change_step.php
├── common.php
├── css
│ └── faster-than-quick
├── expert.php
├── img
│ └── logo.svg
├── index.php
├── js
│ ├── faster-than-quick
│ └── index.html
├── mesh.php
├── mesh_data.php
├── mesh_graph.php
├── mesh_inp_save.php
├── mesh_inp_show.php
├── mesh_log.php
├── mesh_msh.php
├── meshing.php
├── meshing_cancel.php
├── meshing_relaunch.php
├── meshing_status.php
├── new
│ ├── create.php
│ ├── img
│ │ └── logo.svg
│ ├── import_cad.php
│ ├── index.php
│ ├── preview.php
│ ├── problems.php
│ ├── process.php
│ └── sample.step
├── problem.php
├── problem_fee.php
├── problem_fee_save.php
├── properties.php
├── results.php
├── results_data.php
├── results_vtk.php
├── solving.php
├── solving_cancel.php
├── solving_relaunch.php
└── solving_status.php
├── meshers
├── README.md
└── gmsh
│ ├── .gitignore
│ ├── LICENSE
│ ├── ajax2mesh.php
│ ├── cadmesh.py
│ ├── default0.geo
│ ├── default1.geo
│ ├── default2.geo
│ ├── default3.geo
│ ├── default4.geo
│ ├── default5.geo
│ ├── deps.sh
│ ├── mesh.sh
│ ├── mesh_data.cpp
│ ├── mesh_data.php
│ ├── mesh_data.py
│ ├── mesh_graph.php
│ ├── mesh_inp_save.php
│ ├── mesh_inp_show.php
│ ├── mesh_log.php
│ ├── mesh_meta.py
│ ├── mesh_status.sh
│ ├── meshing_relaunch.php
│ ├── meshing_status.php
│ ├── process_step.php
│ ├── quality.gp
│ ├── quality.py
│ └── trymesh.py
├── renderers
└── x3dom
│ ├── .gitignore
│ ├── LICENSE
│ └── deps.sh
├── solvers
├── README.md
├── ccx
│ ├── LICENSE
│ ├── ajax2problem.php
│ ├── change_step_solve.php
│ ├── common.php
│ ├── deps.sh
│ ├── frd2vtk.fee
│ ├── input_initial_mechanical.php
│ ├── problem_fee.php
│ ├── problem_fee_save.php
│ ├── problems.php
│ ├── results_data.php
│ ├── solve.sh
│ ├── solve_status.sh
│ └── solving_status.php
├── common.php
├── feenox
│ ├── LICENSE
│ ├── ajax2problem.php
│ ├── change_step_solve.php
│ ├── common.php
│ ├── deps.sh
│ ├── displacements.fee
│ ├── feenox.xml
│ ├── field.fee
│ ├── field1.fee
│ ├── input_initial_heat_conduction.php
│ ├── input_initial_mechanical.php
│ ├── problem_fee.php
│ ├── problem_fee_save.php
│ ├── problems.php
│ ├── results_data.php
│ ├── results_data
│ │ ├── heat_conduction.php
│ │ └── mechanical.php
│ ├── second2first.fee
│ ├── solve.sh
│ ├── solve_status.sh
│ ├── solving_relaunch.php
│ └── solving_status.php
├── problems.php
└── sparselizard
│ ├── LICENSE
│ └── problems.php
└── uxs
├── .gitignore
└── faster-than-quick
├── about.php
├── bootswatch
├── .gitignore
├── _bootswatch.scss
├── _variables.scss
└── make.sh
├── cad.php
├── change_step.php
├── css
├── .gitignore
├── bootstrap.min.css
├── ftq.css
├── highlight.css
└── index.html
├── deps.sh
├── expert.php
├── importers
└── upload.php
├── index.php
├── js
├── .gitignore
├── async.js
├── ftq.js
├── heat_conduction.js
├── index.html
└── mechanical.js
├── labels.php
├── labels
├── .gitignore
├── README.md
├── labels.awk
├── labels.sh
└── labels.txt
├── mesh.php
├── mesh
└── gmsh.php
├── meshing.php
├── named_cube.x3d
├── new.php
├── preview.php
├── problem.php
├── problem
├── heat_conduction.php
└── mechanical.php
├── properties.php
├── results.php
├── results
├── heat_conduction.php
└── mechanical.php
├── share.php
├── small_axes.html
├── solving.php
└── ux.php
/.dockerignore:
--------------------------------------------------------------------------------
1 | __pycache__
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | deps
2 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM php:8.2.20-apache AS final
2 | RUN apt-get update && apt-get install -y \
3 | python3 \
4 | && rm -rf /var/lib/apt/lists/* \
5 | RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
6 | COPY . /var/www
7 | RUN mkdir -p /var/www/data && chown www-data:www-data /var/www
8 | USER www-data
9 |
10 | # docker build -t suncae:2024-9-14 .
11 | # docker run -p 9000:80 suncae:2024-9-14
12 | # docker ps
13 | # docker exec -it bash
14 |
--------------------------------------------------------------------------------
/LICENSES.md:
--------------------------------------------------------------------------------
1 | The SunCAE code itself is released under the terms of the [GNU Affero General Public License version 3](https://www.gnu.org/licenses/agpl-3.0.en.html), or at your option, any later version (AGPLv3+).
2 | See the [licensing details](../README.md#licensing) for more information.
3 |
4 | Here are the repositories and licenses of SunCAE third-party dependencies as shipped by the official distribution at
5 |
6 | | Type | Name | Repository | License |
7 | |:----------------|:--------------|:-------------------------------------------|:-------------:|
8 | | Renderer | X3DOM | | MIT/GPLv3+ |
9 | | UX | Bootstrap | | MIT |
10 | | CAD importer | OpenCASCADE | | LGPL-2.1 |
11 | | Mesher | Gmsh | | GPLv2+ |
12 | | Solver | FeenoX | | GPLv3+ |
13 | | Solver | CalculiX | N/A | GPLv2+ |
14 |
15 | Other dependencies (i.e. new solvers, new meshers) can be added as long as their respective licenses are respected.
16 |
17 |
--------------------------------------------------------------------------------
/TODO.md:
--------------------------------------------------------------------------------
1 |
2 | # Roadmap
3 |
4 | * more problems (non-linear mechanics, transient thermal, modal, cfd, etc.)
5 | * more meshers (netgen? tetgen? salome?)
6 | * more solvers (sparselizard? fenics?)
7 | * more runners (ssh, aws, kubernetes, etc.)
8 | * more documentation
9 |
10 | # TODOs
11 |
12 | ## General
13 |
14 | * replace python with c++ to "process" msh and make it smarter
15 | * unit tests
16 | * choose units (SI, etc.)
17 | * choose points for BCs (and eventually refinements)
18 | * name in the BC should reflect the content
19 | * dashboard with case list
20 | * real-time collaboration
21 | * detect changes in CAD
22 | * git history in the UX
23 | * show face id when hovering
24 | * screenshots
25 | * once a minute refresh the axes, faces, edges, etc. (take a snapshot?)
26 | * investigate defeature operation in OCC through Gmsh (would we need a separate UX?)
27 | * re-implement how to show SunCAE version in about (when running `deps.sh`)
28 | * check that everything is fine when running `deps.sh`:
29 | - that executables work
30 | - that permissions are fine
31 | - create a `txt` with versions with `git log -1` + `git status --porcelain`
32 | * ability to take notes in markdown
33 | * help ballons, markdown + pandoc
34 | * limit DOFs: in conf? somewhere in auth? like `limits.php`?
35 | * remove visibility, everything is public
36 |
37 |
38 | ## Gmsh
39 |
40 | * STL input
41 | * combos for algorithms
42 | * checkboxes for bool
43 | * local refinements
44 | * understand failures -> train AI to come up with a proper `.geo`
45 | * other meshers! (tetget? netgen?)
46 | * multi-solid: bonded, glued, contact
47 | * curved tetrahedra
48 | * hexahedra
49 |
50 | ## Problem
51 |
52 | * choose faces with ranges e.g 1-74
53 | * other problems: modal
54 | * other solvers: ccx, sparselizard
55 | * orthotropic elasticity
56 | * thermal expansion (isotropic and orthotropic)
57 | * modal feenox
58 | * mechanical sparselizard
59 | * transient/quasistatic (a slider for time?)
60 |
61 | ## Results
62 |
63 | * fields (the list of available fields should be read from the outpt vtk/msh)
64 | - heat flux? (more general, vector fields?)
65 | * the server should tell the client
66 | - which field it is returning (so the client can choose the pallete)
67 | - if it has a warped field or not
68 | * the range scale has to be below the warp slider
69 | * nan color (yellow)
70 | * compute the .dat in the PHP, not in Bash
71 | * probes: user picks location, server returns all field
72 | * reactions: choose which BCs to compute reaction at in the problem step with a checkboxes
73 | * warning for large deformations/stresses
74 |
75 | ## Outer loops
76 |
77 | * parametric
78 | * optimization
79 |
80 | ## Dashboard
81 |
82 | * list of cases
83 |
84 | ## Backlog
85 |
86 | * zoom over mouse
87 | * disable BCs (comment them out)
88 |
--------------------------------------------------------------------------------
/auths/htpasswd/.htaccess:
--------------------------------------------------------------------------------
1 | AuthType Basic
2 | AuthName "Restricted Content"
3 | AuthUserFile .htpasswd
4 | Require valid-user
5 |
--------------------------------------------------------------------------------
/auths/htpasswd/.htpasswd:
--------------------------------------------------------------------------------
1 | pepe:$apr1$vATa7bcq$EBEVaET9ke0EWE6zs4P4Q1
2 |
--------------------------------------------------------------------------------
/auths/htpasswd/README.md:
--------------------------------------------------------------------------------
1 | Explain how to setup httpasswd.
2 |
--------------------------------------------------------------------------------
/auths/htpasswd/auth.php:
--------------------------------------------------------------------------------
1 | &1", __DIR__), $output, $error_level);
22 |
23 | // TODO: keep output
24 | if ($error_level != 0) {
25 | $response["status"] = "error";
26 | $response["error"] = "Error {$error_level} when importing CAD: ";
27 | for ($i = 0; $i < count($output); $i++) {
28 | $response["error"] .= $output[$i];
29 | }
30 | suncae_log("CAD {$cad_hash} process {$response["status"]} {$response["error"]}");
31 | return_back_json($response);
32 | }
33 | }
34 |
35 | // ------------------------------------------------------------
36 | if (file_exists("cad.json")) {
37 | $cad = json_decode(file_get_contents("cad.json"), true);
38 | $response["position"] = $cad["position"];
39 | $response["orientation"] = $cad["orientation"];
40 | $response["centerOfRotation"] = $cad["centerOfRotation"];
41 | $response["fieldOfView"] = $cad["fieldOfView"];
42 |
43 | } else {
44 | $response["status"] = "error";
45 | $response["error"] = "Cannot create CAD json.";
46 | suncae_log("CAd {$cad_hash} process {$response["status"]} {$response["error"]}");
47 | return_back_json($response);
48 | }
49 |
50 |
51 | // ------------------------------------------------------------
52 | // leave running the mesher in the background
53 | exec("../../../../cadprocessors/gmsh/initial_mesh.sh > cadmesh.log 2>&1 &");
54 |
55 | suncae_log("CAD {$cad_hash} process {$response["status"]} {$response["error"]}");
56 |
57 |
58 | return_back_json($response);
59 |
60 |
--------------------------------------------------------------------------------
/conf.php:
--------------------------------------------------------------------------------
1 | [!TIP]
4 | > If your question is not listed here, do not hesitate [contacting us](https://www.seamplex.com/suncae/#contact).
5 |
6 | ### What is the difference between SunCAE, FeenoX, Seamplex and CAEplex?
7 |
8 | * [SunCAE](https://www.seamplex.com/suncae) is an open-source web-based interface for performing CAE in the cloud.
9 | * [FeenoX](https://www.seamplex.com/feenox) is an open-source finite-element solver which used in SunCAE by default.
10 | * [Seamplex](https://www.seamplex.com) is the company that developed both SunCAE and FeenoX
11 | * [CAEplex](https://www.caeplex.com) is the first web-based interface developed by Seamplex. It is [100% integrated into Onshape](https://www.youtube.com/watch?v=ylXAUAsfb5E).
12 |
13 |
14 | ### Can I try SunCAE without having to install it?
15 |
16 | Yes, check out our [live demo](https://www.caeplex.com/suncae).
17 | Note that
18 |
19 | * There is no need to register, but your IP might get logged.
20 | * The data (including CAD files) might (or not) get lost. Do not put sensitive stuff in the demo.
21 |
22 | ### Which language is SunCAE written in?
23 |
24 | The front end is HTML with plain vanilla Javascript. This means no Angular, no React, no NodeJS, nothing. Not even JQuery. Plain vanilla Javascript (plus the Javascript libraries needed for 3D rendering).
25 |
26 | The back end is written in PHP. Again, plain PHP with at most `php-yaml` to read and write YAML files.
27 | The front end would make asynchronous AJAX calls to the back end, which would run PHP file and respond with a JSON content and so the front end can update the DOM.
28 |
29 | ### What are the licensing terms?
30 |
31 | TL;DR: if you use a modified version of SunCAE in your server, you have to provide a link to the modified sources.
32 |
33 | The content of this SunCAE repository is licensed under the terms of the [GNU Affero General Public License version 3](https://www.gnu.org/licenses/agpl-3.0.en.html), or at your option, any later version (AGPLv3+).
34 |
35 | See the [licenses table](../LICENSES.md) and [licensing details](../README.,d#licensing) for more information.
36 |
37 |
38 | ### How does SunCAE import the CAD geometry?
39 |
40 | So far, only using [OpenCASCADE](https://dev.opencascade.org) through the [Gmsh API](https://gitlab.onelab.info/gmsh/gmsh/-/tree/master/api).
41 |
42 | > [!NOTE]
43 | > If you want other CAD imported to be supported, say so in the [forum](https://github.com/seamplex/suncae/discussions).
44 |
45 | ### What are the supported meshers?
46 |
47 | So far, only [Gmsh](http://gmsh.info/) is supported.
48 |
49 | See the directory [`meshers`](https://github.com/seamplex/suncae/tree/main/meshers) for the current list.
50 |
51 | > [!NOTE]
52 | > If you want other meshers to be supported, say so in the [forum](https://github.com/seamplex/suncae/discussions).
53 |
54 |
55 | ### What are the supported solvers?
56 |
57 | * [FeenoX](http://www.seamplex.com/feenox)
58 | * [CalculiX](https://www.dhondt.de/)
59 |
60 | The "single source of truth" is still the FeenoX input file.
61 | CalculiX is supportted through the [`fee2ccx` converter](https://github.com/seamplex/feenox/tree/main/utils/fee2ccx) from `.fee` to `.inp`.
62 |
63 | See the directory [`solvers`](https://github.com/seamplex/suncae/tree/main/solvers) for the current list.
64 |
65 | > [!NOTE]
66 | > If you want other solvers to be supported, say so in the [forum](https://github.com/seamplex/suncae/discussions).
67 |
68 |
--------------------------------------------------------------------------------
/doc/INSTALL.md:
--------------------------------------------------------------------------------
1 | # Installing and setting up SunCAE
2 |
3 | > [!TIP]
4 | > If you just want to use SunCAE without installing it, you can do so with the [live demo](https://www.caeplex.com/suncae).
5 |
6 | > [!NOTE]
7 | > Mind the license of SunCAE itself and the license of all the related packages that SunCAE uses to make sure you are not infringing any license.
8 |
9 | This document explains how to set up [SunCAE](https://www.seamplex.com/suncae) so as to serve one or more clients.
10 | A basic installation can be done relatively simple, even without understanding the meaning of the commands.
11 | Keep in mind that a full-fledged installation being able to serve different users might need deep understanding of networking administration and operating systems details.
12 |
13 | ## Architectures
14 |
15 | The code is aimed at being run on Unix systems. Specifically, Debian GNU/Linux.
16 | There might be ways of making SunCAE run on other architectures.
17 | If you happen to know how, please help us by explaining how.
18 |
19 | ## Cloning the repository
20 |
21 | The first step would be to clone the SunCAE repository:
22 |
23 | ```
24 | git clone https://github.com/seamplex/suncae
25 | cd suncae
26 | ```
27 |
28 |
29 | ## Dependencies
30 |
31 | The repository only hosts particular code and files which are not already available somewhere else.
32 | The latter include
33 |
34 | * meshers and solvers executables (e.g. `gmsh`, `feenox`, `ccx`, etc.)
35 | * Javascript libraries (e.g. `x3dom.js`)
36 | * CSS and fonts (e.g. `bootstrap.css`)
37 |
38 |
39 | ### Common
40 |
41 | SunCAE needs some functionality which is provided by packages which are commonly available in the most common GNU/Linux distribution repositories. Ranging from the web server itself, script interpreters (e.g. PHP and Bash) and other standard Unix utilities, this line (or a similar one for a non-Debian distribution) should be enough:
42 |
43 | ```
44 | sudo apt-get install git unzip patchelf wget php-cli php-yaml gnuplot
45 | ```
46 |
47 | ### Particular
48 |
49 | The (free and open source) meshers, solvers and required libraries and fonts can be downloaded by executing the `deps.sh` script in SunCAE's root directory:
50 |
51 | ```
52 | ./deps.sh
53 | ```
54 |
55 | > [!IMPORTANT]
56 | > Run the script from SunCAE's root directory, i.e.
57 | >
58 | > ```
59 | > ./deps.sh
60 | > ```
61 | >
62 | > and **not** from the parent (or any other directory) like
63 | >
64 | > ```
65 | > suncae/dep.sh
66 | > ```
67 |
68 | > [!TIP]
69 | > The script will try to download and copy the dependencies inside SunCAE's directories (ignored by Git) only if they are not already copied. To force the download and copy (say if the version changed), you can either delete the dependencies or pass `--force` to `deps.sh`
70 | >
71 | > ```
72 | > ./deps.sh --force
73 | > ```
74 |
75 |
76 | ## The web server
77 |
78 | SunCAE can be hosted with any web server capable of executing PHP scripts.
79 | The main entry point is under directory `html`.
80 |
81 | All the user information is stored as files under the directory `data`.
82 | That is to say, there is not **database** (either SQL or Mongo-like).
83 | Just plain (Git-tracked) files.
84 |
85 | > [!TIP]
86 | > Backups are as simple as `cp`ing (or `rsync`ing, `tar`ring, etc.) the directory `data` somewhere else.
87 |
88 |
89 |
90 | ### PHP's internal web server
91 |
92 | The `php-cli` package includes a simple web server which is enough to host SunCAE for single-user mode (and it is even handy for debugging purposes).
93 | Just run `php` with the `-S` option. Choose an available port and pass the `html` directory in the `-t` option (or go into the `html` directory and run `php -S` from there without `-t`):
94 |
95 | ```terminal
96 | php -S localhost:8000 -t html
97 | ```
98 |
99 | > [!IMPORTANT]
100 | > The first time that SunCAE needs to use the `data` directory, it will be created and owned by the user running the server, which in this case will be the user that ran `php`.
101 | > Mind ownerships and permissions if you then change from the internal web server to a professional one such as Apache.
102 |
103 | ### Apache
104 |
105 | Configure Apache to serve the `html` directory in SunCAE's repository.
106 | By default, Apache's root directory is `/var/www/html`.
107 |
108 | A quick hack is to make sure that SunCAE’s [`html`](html) directory is available to be served. For instance, in the default installation you could do
109 |
110 | ```terminal
111 | ln -s html /var/www/html/suncae
112 | ```
113 |
114 | and then SunCAE would be available at .
115 |
116 | > [!WARNING]
117 | > Mind Apache's policies about symbolic links. They are not straightforward, so symlinking SunCAE's `html` directory into Apache's `html` directory might not work out of the box.
118 |
119 |
120 | * If you do not have experience with Apache, you might want to delete the default `/var/www` tree and clone SunCAE there.
121 | * If you have experience with Apache, there is little more to add.
122 |
123 |
124 | > [!IMPORTANT]
125 | > The first time that SunCAE needs to use the `data` directory, it will be created and owned by the user running the server, which in this case by default is `www-data`.
126 | > Mind ownerships and permissions when accessing `data`.
127 |
128 | ### Other servers
129 |
130 | We do not know.
131 |
132 |
133 | ## Stack configuration
134 |
135 | The file [`conf.php`](../conf.php) in SunCAE's root directory controls the choices of the implementations of the different components for the current instance of SunCAE being served:
136 |
137 | ```php
138 | $auth = "single-user";
139 | $ux = "faster-than-quick";
140 | $cadimporter = "upload";
141 | $cadprocessor = "gmsh";
142 | $runner = "local";
143 | $max_nodes = 100e3;
144 | ```
145 |
146 | This means that
147 |
148 | 1. the same server can change the implementations by changing the content of `conf.php` dynamically
149 | 2. different servers (or the same server with different entry points) can serve different implementations by serving different `html` directories whose parent's `conf.php` is different.
150 | 3. any other combination is also possible, e.g. an interactive HTML-based panel that modifies `conf.php` on demand or that clones a new instance of SunCAE in an arbitrary location (and configures Apache to serve it).
151 |
152 | Read the [Design Manual](design.md) for details about what each of the definitions mean.
153 |
154 |
--------------------------------------------------------------------------------
/doc/README.md:
--------------------------------------------------------------------------------
1 | # SunCAE documentation
2 |
3 | * [Installation guide](INSTALL.md)
4 | * [Tutorials](tutorials.md)
5 | * [FAQs](FAQs.md)
6 | * [Explanation of the workflow](workflow.md)
7 |
--------------------------------------------------------------------------------
/doc/design.md:
--------------------------------------------------------------------------------
1 | # SunCAE design description
2 |
3 | SunCAE is split into a front end and a back end.
4 |
5 | * The front end is HTML + Javascript running on a web browser on any operating system (even mobile devices).
6 | * The back end is PHP + Bash + Python + particular binaries running on one or more Unix servers.
7 |
8 | The spirit is that the definition of the CAE problem being solved is stored in a single source of truth as a text file, hopefully the actual solver's input file. The web-based interface should allow both
9 |
10 | 1. To update the solver's input file from the status of web-based widgets (e.g. picking faces in the 3D model to hold boundary conditions, entering material properties in text boxes, choosing sdef/ldef from a combo box, etc.), and
11 | 2. To allow the user to edit the input file and then to update the status of web-based widgets from the contents of the input file.
12 |
13 | For instance, consider the following [FeenoX](https://www.seamplex.com/feenox/) input file:
14 |
15 | ```
16 | PROBLEM mechanical READ_MESH meshes/9061bd607902d31a8aac5f97a1066504-2.msh
17 |
18 | E(x,y,z) = 200e3
19 | nu = 0.3
20 |
21 | BC face1 fixed
22 | BC face3 Fx=10e3
23 | ```
24 |
25 | If the user changes the value of the Young's modulus to `210e3`, the front end issues an AJAX call and the back end updates the file.
26 | Conversely, if the user edits the input file (through a web-based editor the UX has to provide) and changes the value in the file to something else, then the back-end sends instructions to the front end to update the web-based interface.
27 | Moreover, each time the file changes (either because of the user changing a value in the interface or editing the file), a Git commit is issued. Therefore, every single change in the single source of truth is tracked (what? who? when?).
28 |
29 | # The SunCAE interface
30 |
31 | The SunCAE interface consists of four steps divided into two stages:
32 |
33 | 1. New case
34 | 1. CAD import, physics, problem, mesher and solver selection
35 | 2. Case view
36 | 1. Mesh
37 | 2. Problem
38 | 3. Results
39 |
40 | The source code of the index page at [html/index.php](../html/index.php) looks like this
41 |
42 | ```php
43 | include("../conf.php");
44 | include("../auths/{$auth}/auth.php");
45 | include("common.php");
46 | include("case.php");
47 | include("../uxs/{$ux}/index.php");
48 | ```
49 |
50 | * The [`conf.php`](../conf.php) file is included first.
51 | * The authorization scheme `$auth` defined in `conf.php` is included.
52 | This step should ask for authentication/authorization, set/read cookies, etc.
53 | PHP's [session_start()](https://www.php.net/manual/en/function.session-start.php) can be used.
54 | This file should define a non-empty global PHP string `$username`.
55 | The default [`single-user`](../auths/single-user/auth.php) auth scheme just does
56 |
57 | ```php
58 | $username = "root";
59 | ```
60 |
61 | * The file `common.php` defines common functions and methods needed by the back end.
62 | It also defines a PHP variable `$id` coming from either a `GET` or `POST` argument with name `id`:
63 |
64 | ```php
65 | $id = (isset($_POST["id"])) ? $_POST["id"] : ((isset($_GET["id"])) ? $_GET["id"] : "");
66 | ```
67 |
68 | This should be the `id` of an existing case.
69 |
70 | * The file `case.php` reads the metadata for the case `id`. But, if the variable `$id` is empty, it will re-direct the user to the ["New case"](#new-case) page at `new/`:
71 |
72 | ```php
73 | if ($id == "") {
74 | header("Location: new/");
75 | exit();
76 | }
77 | ```
78 |
79 | * If `$id` is not empty, the workflow continues to include the `$ux` scheme defined in `conf.php` which should load case `$id` and show the ["Case view"](#case-view), loading either the mesh, problem or results view depending on the state of the case.
80 |
81 |
82 | ## New case
83 |
84 | The [`html/new/index.php`](../html/new/index.php) source is
85 |
86 | ```php
87 | include("../../conf.php");
88 | include("../../auths/{$auth}/auth.php");
89 | include("../common.php");
90 | include("../../uxs/{$ux}/new.php");
91 | ```
92 |
93 | The first three lines have been already discussed.
94 | The default `$ux` is `faster-than-quick`. As its name suggest, it is a quick hack that works.
95 |
96 | To be completed.
97 |
98 | ## Case view
99 |
100 | To be completed.
101 |
--------------------------------------------------------------------------------
/doc/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
101 |
--------------------------------------------------------------------------------
/doc/virtual.md:
--------------------------------------------------------------------------------
1 | # Setting up virtual machines to host SunCAE
2 |
3 | ## Vagrant
4 |
5 | ```terminal
6 | vagrant init debian/bookworm64
7 | vagrant up
8 | vagrant ssh
9 | ```
10 |
11 | ## Docker
12 |
13 | TBD
14 |
--------------------------------------------------------------------------------
/doc/workflow.md:
--------------------------------------------------------------------------------
1 | # New case
2 |
3 | #. if someone goes to the root `index.php` (at `html/index.php`) without and `id` or directly to `new/` then the "new case" page at `new/index.php` is shown
4 | #. that one includes `uxs/$ux/new.php`
5 |
6 | ## Faster-than-quick UX
7 |
8 | #. `uxs/faster-than-quick/new.php` shows the four choices
9 |
10 | 2. Physics
11 | 3. Problem
12 | 4. Solver
13 | 5. Mesher
14 |
15 | But the first one, which is the CAD, comes from `uxs/faster-than-quick/importers/$cadimporter.php`
16 |
17 | ## Upload-importer
18 |
19 | #. `uxs/faster-than-quick/importers/upload.php` shows a file upload HTML component with an onchange call to `upload_cad_file()` that after uploading the CAD, calls `process_cad()`.
20 | #. `process_cad()` in `uxs/faster-than-quick/new.php` calls `html/new/process.php` which includes `cadprocessors/$cadprocessor/process.php`
21 |
22 | ## Gmsh-processor
23 |
24 | #. `cadprocessors/gmsh/process.php` uses `cadimport.py` to process the uploaded CAD with Gmsh (through OCC) to create a `.xao`
25 | #. It calls `initial_mesh.sh` in background to create the first mesh.
26 | #. This `initial_mesh.sh` just calls `cadmesh.py` if `default.geo` does not exit.
27 | #. `cadmesh.py` performs five attempts to create an initial mesh by calling `trymesh.py` with the number of attempt $i$ as the argument
28 | #. `trymesh.py` merges `defaulti.geo` and then tries to come up with a max $\ell_c$
29 | #.
30 |
31 |
--------------------------------------------------------------------------------
/html/.htaccess:
--------------------------------------------------------------------------------
1 | # AuthType Basic
2 | # AuthName "Restricted Content"
3 | # AuthUserFile /home/gtheler/codigos/suncae/auths/htpasswd/.htpasswd
4 | # Require valid-user
5 |
--------------------------------------------------------------------------------
/html/ajax2mesh.php:
--------------------------------------------------------------------------------
1 |
107 |
--------------------------------------------------------------------------------
/html/change_step.php:
--------------------------------------------------------------------------------
1 | SunCAE found a fatal error:";
11 | echo $error;
12 | echo "
27 |
28 | GNU Affero General Public License version 3, or at your option, any later version.
29 | You can get a copy of the source code of this web interface here.
30 |
31 |