Skip to content
Snippets Groups Projects
Commit 13964135 authored by Lambert Theisen's avatar Lambert Theisen
Browse files

Merge branch 'develop' into 'master'

Update to version 1.1

See merge request !5
parents f8714e44 a351b322
Branches
Tags
1 merge request!5Update to version 1.1
Pipeline #219163 failed
Showing
with 392 additions and 201 deletions
......@@ -48,14 +48,12 @@ stabilization:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen number
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: r13
use_coeffs: True
kn: 1.0
xi_tilde: 1.0
heat_source: 0
......
#!/bin/bash
python3 ../../src/geoToH5.py knudsen_pump.geo knudsen_pump4.h5 "-setnumber p 4"
\ No newline at end of file
geoToH5 knudsen_pump.geo knudsen_pump4.h5 "-setnumber p 4"
\ No newline at end of file
......@@ -49,14 +49,12 @@ stabilization:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen number
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: r13
use_coeffs: True
kn: 0.1
xi_tilde: 1.0
heat_source: 0
......
#!/bin/bash
python3 ../../src/geoToH5.py lid.geo lid5.h5 "-setnumber p 5"
\ No newline at end of file
geoToH5 lid.geo lid5.h5 "-setnumber p 5"
\ No newline at end of file
......@@ -48,14 +48,12 @@ stabilization:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen number
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: r13
use_coeffs: True
kn: 0.08
xi_tilde: 1.0
heat_source: 0
......
......@@ -14,7 +14,7 @@ class TestExamples(object):
All tests are compared against reference errors.
"""
solver_path = "../../src/fenicsR13.py"
solver_path = "fenicsR13"
def run_solver(self, inputfile, working_dir_):
"""
......@@ -23,7 +23,7 @@ class TestExamples(object):
Test fails if subprocess return Exception or error.
"""
subprocess.check_call([
"python3", self.solver_path, inputfile
self.solver_path, inputfile
], cwd=working_dir_)
# @pytest.fixture(scope="module", autouse=True)
......
# pylint: disable=invalid-name,missing-module-docstring
from .fenicsR13 import *
from .geoToH5 import *
from .input import *
from .meshes import *
from .postprocessor import *
from .solver import *
from .tensoroperations import *
......@@ -15,10 +15,10 @@ import sys
import gc
import dolfin as df
import meshes
from input import Input
from solver import Solver
from postprocessor import Postprocessor
from fenicsR13.meshes import H5Mesh
from fenicsR13.input import Input
from fenicsR13.solver import Solver
from fenicsR13.postprocessor import Postprocessor
def print_information():
r"""
......@@ -28,7 +28,7 @@ def print_information():
.. code-block:: text
-> Version: v1.0
-> Version: v1.1
-> Contact: Lambert Theisen <lambert.theisen@rwth-aachen.de>
-> Contact: Manuel Torrilhon <mt@mathcces.rwth-aachen.de>
-> Repository: <https://git.rwth-aachen.de/lamBOO/fenicsR13>
......@@ -40,7 +40,7 @@ def print_information():
|_| \___|_| |_|_|\___|___/_| \_\_|____/
"""
print(r"""-> Version: v1.0
print(r"""-> Version: v1.1
-> Contact: Lambert Theisen <lambert.theisen@rwth-aachen.de>
-> Contact: Manuel Torrilhon <mt@mathcces.rwth-aachen.de>
-> Repository: <https://git.rwth-aachen.de/lamBOO/fenicsR13>
......@@ -63,10 +63,13 @@ def main():
.. code-block:: bash
# Install fenicsR13
pip install .
# Usage: <path_to_program> <input_file>
# Goto case folder:
cd tests/r13
python3 ../../src/fenicsR13.py inputs/ \
fenicsR13 inputs/ \
r13_1_coeffs_nosources_norot_inflow_p1p1p1p1p1_stab.yml
"""
......@@ -108,7 +111,7 @@ def main():
mesh_name = mesh_names[p]
current_mesh = meshes.H5Mesh(mesh_name)
current_mesh = H5Mesh(mesh_name)
solver = Solver(params, current_mesh, p)
solver.assemble()
......
......@@ -5,13 +5,19 @@
"""
Converter from geo-format to a mesh in h5-format.
Installation:
.. code-block:: bash
pip install .
Usage:
.. code-block:: bash
Usage: python3 <path_to_geoToH5.py> <geo_file> <h5_file> \
[<gmsh cli arguments>]
E.g.: python3 ../../src/geoToH5.py lid.geo lid5.h5 "-setnumber p 5"
E.g.: geoToH5 lid.geo lid5.h5 "-setnumber p 5"
"""
import os
......@@ -29,7 +35,7 @@ def geo_to_h5():
if not 3 <= len(sys.argv) <= 4:
print("""
Usage: python3 <path_to_geoToH5.py> <geo_file> <h5_file> [<gmsh cli arguments>]
E.g.: python3 ../../src/geoToH5.py lid.geo lid5.h5 "-setnumber p 5"
E.g.: geoToH5 lid.geo lid5.h5 "-setnumber p 5"
""")
return
......@@ -68,10 +74,3 @@ E.g.: python3 ../../src/geoToH5.py lid.geo lid5.h5 "-setnumber p 5"
file.write(mesh, "/mesh")
file.write(subdomains, "/subdomains")
file.write(boundaries, "/boundaries")
def main():
"Execute the converter."
geo_to_h5()
if __name__ == '__main__':
main()
......@@ -78,14 +78,12 @@ class Input:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in heat
# - kn: Knudsen numberkn
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: r13
use_coeffs: True
kn: 1.0
xi_tilde: 1.0
heat_source: 0
......@@ -166,8 +164,12 @@ class Input:
def __init__(self, yaml_file):
"""Construct the Input class."""
with open(yaml_file, "r") as stream:
self.dict = yaml.safe_load(stream)
try:
with open(yaml_file, "r") as stream:
self.dict = yaml.safe_load(stream)
except FileNotFoundError:
print(f"[Error] The input file {yaml_file} is not found.\n")
raise
val = Validator()
input_schema = {
......@@ -186,10 +188,6 @@ class Input:
"required": True,
"allowed": ["heat", "stress", "r13"]
},
"use_coeffs": {
"type": "boolean",
"required": True,
},
"kn": {
"type": "float",
"required": True,
......
File moved
File moved
This diff is collapsed.
......@@ -80,7 +80,7 @@ def stf3d3(rank3_3d):
.. math::
A_{\langle i j k\rangle}=A_{(i j k)}-\frac{1}{5}\left[A_{(i l)}
A_{\langle i j k\rangle}=A_{(i j k)}-\frac{1}{5}\left[A_{(i l l)}
\delta_{j k}+A_{(l j l)} \delta_{i k}+A_{(l l k)} \delta_{i j}\right]
A gradient :math:`\frac{\partial S_{\langle i j}}{\partial x_{k \rangle}}`
......
{
"schemaVersion": 1,
"label": "tag",
"message": "v0.3",
"color": "orange"
}
[pytest]
testpaths = src examples/test_examples.py tests
testpaths = fenicsR13 tests examples/test_examples.py
addopts = --doctest-modules --cov --cov-report=term --cov-report=html
setup.py 0 → 100644
"Setup file"
from setuptools import setup
def readme(): # pylint: disable=missing-function-docstring
with open('README.rst') as file:
return file.read()
setup(
name="fenicsR13",
version="1.1",
description="FEniCS (FEM) Solver for Non.-Eq.-Gases Based on R13 Equations",
long_description=readme(),
url="https://git.rwth-aachen.de/lamBOO/fenicsR13",
author="Lambert Theisen, Manuel Torrilhon",
author_email="lambert.theisen@rwth-aachen.de, mt@mathcces.rwth-aachen.de",
license="None",
packages=["fenicsR13"],
zip_safe=False,
entry_points={
"console_scripts": [
"fenicsR13=fenicsR13.fenicsR13:main",
"geoToH5=fenicsR13.geoToH5:geo_to_h5"
],
}
)
......@@ -55,14 +55,12 @@ stabilization:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen numberkn
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: heat
use_coeffs: True
kn: 0.1
xi_tilde: 1.0
heat_source: 2.0 - 1.0 * pow(sqrt(pow(x[0],2)+pow(x[1],2)),2)
......
......@@ -55,14 +55,12 @@ stabilization:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen numberkn
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: heat
use_coeffs: True
kn: 0.1
xi_tilde: 1.0
heat_source: 2.0 - 1.0 * pow(sqrt(pow(x[0],2)+pow(x[1],2)),2)
......
......@@ -55,14 +55,12 @@ stabilization:
# ======================
# - nsd: Number of spatial dimensions == 2
# - mode: Formulation mode, one of heat, stress, r13
# - use_coeffs: Use real R13 coefficients, False only valid in mode==heat
# - kn: Knudsen numberkn
# - xi_tilde: Refaction coefficient in Maxwell accomodation model
# - heat_source: Heat source function for mode==heat||r13
# - mass_source: Mass source function for mode==stress||r13
nsd: 2
mode: heat
use_coeffs: True
kn: 0.1
xi_tilde: 1.0
heat_source: 2.0 - 1.0 * pow(sqrt(pow(x[0],2)+pow(x[1],2)),2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment