Skip to content
Merged
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
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

SunCAE is a web-based front end and a cloud-based back end to perform finite-element calculations directly on the browser.

* The front end is an HTML client with plain vanilla javascript code (i.e. no Angular, no React, not even jQuery) that provide interactivity by sending JSON-based AJAX request to the server backe end.
* The back end is written in PHP and responds to the client requests by creating the input files, executing the appropriate binaries and returning back 3D data to the client.
* The front end is an HTML client with plain vanilla javascript code (i.e. no Angular, no React, not even jQuery) that provide interactivity by sending JSON-based AJAX request to the server back end.
* The back end is written in PHP and responds to the client requests by creating the input files, executing the appropriate binaries and returning back 3D data to the client (browser).

Both front end and back ends are free software, released under the terms of the [AGPLv3](https://www.gnu.org/licenses/agpl-3.0.en.html). See the [licenses table](LICENSES.md) and [licensing details](#licensing) below for more information.

Expand Down Expand Up @@ -66,6 +66,9 @@ You can use SunCAE either by...

For more detailed instructions including setting up production web servers and using virtualization tools (e.g. docker and/or virtual machines) read the [installation guide](doc/INSTALL.md).

> [!TIP]
> If you have trouble getting SunCAE up and running in your server, please state your situation in the [community](https://github.com/seamplex/suncae/discussions).


### Configuration

Expand Down
11 changes: 8 additions & 3 deletions deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,18 @@ for i in wget tar unzip python3; do
fi
done

# create gitignored directories
mkdir -p deps bin

# this one needs to be either world writable or owned by the user running the web server
# we start with 0777 but a sane admin would change it back to 0744 (or less)
if [ ! -d data ]; then
mkdir -p data
chmod 0777 data
fi

# mark that deps.sh has been run (not that it succeeded yet)
touch data/deps-run

# create gitignored directories
mkdir -p deps bin


# Function to compare versions
Expand All @@ -44,3 +46,6 @@ version_ge() {
. meshers/gmsh/deps.sh
. solvers/feenox/deps.sh
. solvers/ccx/deps.sh

# mark that deps.sh has been succeeded
touch data/deps-ok
44 changes: 42 additions & 2 deletions html/check.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
<?php

function check_error($level = 255) {
?>

<p>
There is something off with your setup.
Please post these results
</p>

<?php
exit($level);
}

// --- data dir ----------------------------------
$data_dir = __DIR__ . "/../data";
echo "[info] data_dir is {$data_dir}<br>\n";
Expand Down Expand Up @@ -195,6 +207,34 @@
}

// TODO: check python and binary versions match


}


// feenox
if (file_exists("{$bin_dir}/feenox")) {
echo "[good] feenox binary exists<br>\n";
echo "[info] " . shell_exec("ls -la {$bin_dir}/feenox") . "<br>\n";
} else {
echo "[error] feenox binary does not exist<br>\n";
exit(19);
}
$exec_output = [];
exec("{$bin_dir}/feenox --version 2>&1", $exec_output, $err);
// TODO: check version is good enough
if ($err == 0) {
echo "[good] feenox version is {$exec_output[0]}<br>\n";
} else {
echo "[error] feenox binary does not work<br>\n";
for ($i = 0; $i < count($exec_output); $i++) {
echo "[info] {$exec_output[$i]}<br>\n";
}
exit(20);
}

// great!
touch("{$data_dir}/check-ok");
?>

<p>
[good] all set! <a href="<?=$_SERVER['HTTP_REFERER']?>">Proceed to SunCAE</a>
</p>
16 changes: 16 additions & 0 deletions html/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,21 @@
include("../conf.php");
include("../auths/{$auth}/auth.php");
include("common.php");

if (file_exists("{$data_dir}/deps-run") == false) {
echo "run ./deps.sh first, see installation instructions";
exit();
}

if (file_exists("{$data_dir}/deps-run") == false) {
echo "./deps.sh did not succeed, ask for help";
exit();
}

if (file_exists("{$data_dir}/check-ok") == false) {
header("Location: check.php");
exit();
}

include("case.php");
include("../uxs/{$ux}/index.php");
17 changes: 17 additions & 0 deletions html/new/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,21 @@
include("../../conf.php");
include("../../auths/{$auth}/auth.php");
include("../common.php");

if (file_exists("{$data_dir}/deps-run") == false) {
echo "run ./deps.sh first, see installation instructions";
exit();
}

if (file_exists("{$data_dir}/deps-run") == false) {
echo "./deps.sh did not succeed, ask for help";
exit();
}

if (file_exists("{$data_dir}/check-ok") == false) {
header("Location: ../check.php");
exit();
}


include("../../uxs/{$ux}/new.php");
2 changes: 1 addition & 1 deletion solvers/feenox/deps.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/false

feenox_version=1.2.1
feenox_version_min=1.72
feenox_version_min=1.72 # minimum version that supports MESH in PROBLEM

# feenox
# Function to extract version from binary
Expand Down