Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 8cd87c72 authored by PETIT Manuel's avatar PETIT Manuel
Browse files

Merge remote-tracking branch 'origin/release/1.3.0'

parents b0ba7893 95fc7e13
No related branches found
Tags 1.3.0
No related merge requests found
Pipeline #1095834 passed with warnings
Showing with 872 additions and 216 deletions
......@@ -108,3 +108,5 @@ doc/notebook.rst
doc/README.rst
doc/tutorials.rst
*jitfailure-dolfin*/
/doc/utils/
/doc/_static/growth_scheme.png
......@@ -51,10 +51,16 @@ coverage:
- python -m pip install -e .[test]
# Test it with `pytest`:
- pytest --version
- pytest -v --cov=bvpy test/
- pytest -v --cov=bvpy test/ --cov-report=term --cov-report=xml
retry:
max: 2
when: runner_system_failure
coverage: '/TOTAL.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
paths:
- coverage.xml
when: always
expire_in: 7 days
only:
- develop
- master
......@@ -94,8 +100,8 @@ pages:
- large
image: continuumio/miniconda3
script:
# Install required 'libgl1' system dependency:
- apt-get update && apt-get install libgl1 wget -y
# Install required 'libgl1' & 'pyvista xvfb' system dependency:
- apt-get update && apt-get install libgl1 libgl1-mesa-glx xvfb wget -y
# Download and install pandoc3.1.12.3 (version must be at least (2.14.2) but less than (4.0.0)):
- wget https://github.com/jgm/pandoc/releases/download/3.1.12.3/pandoc-3.1.12.3-1-amd64.deb
- dpkg -i pandoc-3.1.12.3-1-amd64.deb
......@@ -116,13 +122,15 @@ pages:
expire_in: 1 hour
paths:
- public
exclude:
- public/*.ipynb
dependencies: []
rules:
- if: $CI_COMMIT_BRANCH =~ /^release/
when: manual
allow_failure: true
- if: '$CI_COMMIT_BRANCH == "develop"'
when: manual
when: always
allow_failure: true
- if: '$CI_COMMIT_BRANCH == "master"'
when: on_success
......
{
"_pkglts": {
"auto_install": true,
"install_front_end": "stdout",
"use_prompts": false,
"version": 13
},
"base": {
"authors": [
[
"Florian Gacon",
"florian.gacon@inria.fr"
]
],
"namespace": null,
"pkgname": "bvpy",
"url": null
},
"coverage": {},
"doc": {
"description": "A package implementing Boundary Value Problem.",
"fmt": "rst",
"keywords": []
},
"git": {},
"license": {
"name": "cecill-c",
"organization": "INRIA",
"project": "{{ base.pkgname }}",
"year": 2020
},
"pysetup": {
"intended_versions": [
"36"
]
},
"reqs": {
"require": []
},
"sphinx": {
"autodoc_dvlpt": true,
"build_dir": "build/sphinx",
"gallery": "",
"theme": "default"
},
"src": {
"namespace_method": "pkg_util"
},
"test": {
"suite_name": "pytest"
},
"version": {
"major": 1,
"minor": 0,
"post": 1
}
}
{
".coveragerc": {
"coverage": "Wdw0A46bthKCXu+bEDTYhUqOiC6oO1z6vr7BJzujMEDHrqYW6nwpebmtffbKEeQtJ+CllE6GyQ/S+E7WsGRN7g=="
},
".gitignore": {
"git": "77pwFZlnA/vkpAcyacCHkz6TTwwEUrNQspX9U4c8JSQ39A5NazBHfQFpmcWz/3L46HRH+X+RJ+4jFW9RXvs4MA=="
},
"AUTHORS.rst": {
"doc.authors": "8m7WJgCsHuCrAK8j/orSy/0v36/TEHawg8zn8Fu98kw0G5doIGOSaOLizrkp3e/TCOaxTeCqFHaFmHMByRfgFA==",
"doc.contributors": "pi2IMJvG9beHzzq+o4FlhAA4ncMolpvZrv9pDljrVTdaiwfXeiTySLkG7Rr1N57HcZAb5lJ9dRe1w5l+qOXtTg=="
},
"CONTRIBUTING.rst": {},
"HISTORY.rst": {},
"LICENSE": {
"license": "RbGRVVjgGPhWaPWhqwtq7HHev/U1DkppBYjGN39HbDZ2BDejFc2exfwAH1MiY2HHn+3TgxlvBkg/s/x9hs3aOA=="
},
"MANIFEST.in": {
"pysetup": "8DY56AGZWMjTMdLoLpVQZN3oQQOtMMHvIbv478ScAZGV//KX41S578YS9bOPTa1qN+gqb0sfemd4JL1sICcZNg=="
},
"README.rst": {
"doc": "vmiIOMqGhuXJBom/KrWFzvETfJmbSMcLkvZ6XDTcFWl7XRHJgu1tcb4eHn97TgcziEqpfD96M5qO0DV3z3S+CQ=="
},
"doc/_static/nonempty.txt": {},
"doc/conf.py": {
"sphinx": "vOZprm2+LbVvvaxRpTsFwi4tBnuzAvXkKI8ABnMUj/k6AoPuQAtUi3Ux17mTTTRTHuwewtRqXSSJNnhnxdYQOw=="
},
"doc/make.bat": {
"sphinx": "E9sFsnXAm9uPYBn7f0Qb6edct0UKizsXRIJyjZISRCjHbT2HldXK4GIj1yO69R/OVSfnmdAX5lzXQ4wONQNFgA=="
},
"requirements.txt": {
"reqs": "T02TvsmYi9qrLOKFmlKzraUSIwfedls+Z0iG0JzFrz4SlI/wb3QrTsPofbdJV2KE2GA/Q3/j5YeZaVHnC5nN6g=="
},
"requirements_minimal.txt": {
"reqs": "AWuoxM/eZa+Zy1+ouKN+Lrc/SBs640mRZm3y4E/rbAOGZuvR7CtvYjlndWAzxwLd5fQj99R6tu0YJ/9TeDcx9w=="
},
"setup.cfg": {
"sphinx": "mYLeHXWNqXwTk9eWxY4wTrltnDTrAHQvl0l+kosuIfAgrbAuhWMgySq4WR2Y855Q5HDAtGZY7Pnt+BAU6niXIg==",
"test.nose": "vmiIOMqGhuXJBom/KrWFzvETfJmbSMcLkvZ6XDTcFWl7XRHJgu1tcb4eHn97TgcziEqpfD96M5qO0DV3z3S+CQ==",
"test.pytest": "R5P5XMaQxSXsNQJ3hXYY45iLvnl8Mbec6XuIaFTum52gym+wTM2TfEbW/N2doHNaCkpdAWg07oblbYi15AwQkA==",
"wheel": "vUJZkCvbK4LQuEURneKnX/SNIwhJ9/9EaT5T6Uw1K1fauKFFiHnq1DTDES7cgBD0OANelyvwCCZO/rV4Iok+ag=="
},
"setup.py": {
"pysetup.call": "t30iIuCMd/sWxStR2XNYb8bCBgwanhKt8YYn2VKACyAqL5cKFRUWpVRIpAR+uxXUZ9PYYy2csMmECcONnRZE8w==",
"pysetup.kwds": "cAzFCKINVCtdrW5WhuidyviQrjIRX8YUv/rk3SF+rIsw8qmZw/sHOk10U61j0JP5yPh3jTQcLE3CRoC59uJl7A=="
},
"src/bvpy/__init__.py": {
"src": "L2dZgUBRC5qv3o09+1CbMcgYfQtR1ZNSvP8KlP8REQazZiAQAktALjpCC2ijdxvKPv/tN9KsZrzNW+lZMszSfg==",
"version": "skSCnavrYKIlfN9Mpi+cANbU8gXulaKdlHryvkjkoSSpsag1I66dM+6JHm1aOdmKYU0rZNNgcIamCMbIL7IeMg=="
},
"src/bvpy/version.py": {
"version": "E3gJH5NVH8Gq6eVM2EvxFIPx/zrc0i6tFJ5siPY/oRsDggNt7nC1VEgvdVHdanJqj/02tChIa/5aS/XoXbrzrg=="
},
"test/conftest.py": {
"test.pytest_addoption": "I/hswVryIEYvZRBcFqkfRBxLP6eZCwZSbQuPclkOkjHw4MApBst5h7H0ejnMMe4bmwHXMXR5DCSxOMj/FcCnjQ==",
"test.pytest_cmdline_preparse": "qRsYGtJlgHJTT0SoYwceET5XWaABpc7tJvRHZedsylkm7v0eOYtGULlPDp9HfmH/n2DY2bLzxX5S1/BRywFf/Q==",
"test.pytest_collection": "a/3h30sLUHJ7xWsOrmfCInOOVXvm660dS+RxHwcDUcae2jHqDLRGhq/v8zgC+FSzN3pXaEaJ1QBJ9MNLOUBuCA==",
"test.pytest_configure": "SjyTXdrRadJNWhVFYkAvXekjOqNtovwqKNizWD35oZ9XVmsdB/B+lQDzXNPZQ0D5flFpSEURUiGqIvifgEKZ9Q==",
"test.pytest_import": "2ox6A0szNpUYZR5cJJRSW3OwEWR558BOiUMjC/OVkTPT++CF/OCgGSELCPL+7YHWaJGQKMw2rtCXmOMeSK5ZJA=="
}
}
\ No newline at end of file
{
"base": "5.2.0",
"coverage": "5.2.0",
"doc": "5.2.0",
"git": "5.2.0",
"license": "5.2.0",
"pysetup": "5.2.0",
"reqs": "5.2.0",
"sphinx": "5.2.0",
"src": "5.2.0",
"test": "5.2.0",
"version": "5.2.0"
}
\ No newline at end of file
......@@ -6,3 +6,55 @@ creation (2020-08-26)
------------------------
* First release on PyPI.
version 1.3.0 (2025-01-11)
--------------------------
### **Bug Fixes**
- Fixed normal computation in the `boundary_normal` function for 3D cases.
---
### **New Features**
1. **API Enhancements for Hyperelastic Models**
- Introduced new classes for potential energy models:
- `NeoHookeanPotential`
- `StVenantKirchoffPotential`
- `QuadraticGreenLagrangePotential`
- Updated the API of `HyperElasticForm` to now require a potential energy as an argument. This change simplifies the implementation of new potential energy models.
2. **Morphoelastic Problem Modeling**
- Added `MorphoElasticForm` and `GBVP` classes to support modeling morphoelastic problems.
3. **Domain and Mesh Handling**
- Added `CustomDomainGmsh` class, which allows loading `.msh` files for working with complex domains.
4. **Growth Laws and Heterogeneous Growth**
- Added classes for different growth laws:
- `ConstantGrowth`
- `TimeDependentGrowth`
- `StrainDependentGrowth`
- Introduced the `HeterogeneousGrowth` class, enabling assignment of different growth laws to various subdomains.
5. **Boundary Conditions Enhancement**
- Improved boundary condition handling. Boundary conditions can now be scalar, vector, or tensor values with variables, increasing flexibility.
---
### **Documentation and Tutorials**
- Added new tutorials:
- **Visualization**: Demonstrations using `pyvista`.
- **Domain Creation**: Tutorials on working with complex domains using `gmsh`.
- **Morphoelastic Problems**: Examples of handling morphoelastic problems.
......@@ -13,10 +13,14 @@ Despite this biological motivation, the **Bvpy** library has been implemented in
.. sidebar:: **Bvpy**
:Lead Development: Florian Gacon
:Lead Development: Manuel Petit
:Coordination: Olivier Ali
:Main Contributors: Florian Gacon
:Other Contributors: Guillaume Cerutti, Adrien Heymans, Jonathan Legrand
:Active team: Inria project team `Mosaic <https://team.inria.fr/mosaic/>`_
:Institutes: `Inria <http://www.inria.fr>`_
......@@ -61,7 +65,7 @@ You will need conda in order to install ``bvpy``, you can download it `here <ht
git clone https://gitlab.inria.fr/mosaic/bvpy.git
cd bvpy
conda create -n bvpy-dev -c conda-forge "python=3.9" "fenics=2019.1.0"
conda env create --file conda/env.yaml -n bvpy-dev
conda activate bvpy-dev
python -m pip install -e .
......
......@@ -5,4 +5,5 @@ channels:
dependencies:
- python=3.9
- python-gmsh=4.11.1
- fenics=2019.1.0
\ No newline at end of file
- fenics=2019.1.0
- h5py
\ No newline at end of file
$MeshFormat
4.1 0 8
$EndMeshFormat
$Entities
4 4 1 0
1 0 0 0 0
2 1 0 0 0
3 1 1 0 0
4 0 1 0 0
1 -9.999999994736442e-08 -1e-07 -1e-07 1.0000001 1e-07 1e-07 0 2 1 -2
2 0.9999999000000001 -9.999999994736442e-08 -1e-07 1.0000001 1.0000001 1e-07 0 2 2 -3
3 -9.999999994736442e-08 0.9999999000000001 -1e-07 1.0000001 1.0000001 1e-07 0 2 3 -4
4 -1e-07 -9.999999994736442e-08 -1e-07 1e-07 1.0000001 1e-07 0 2 4 -1
1 -9.999999994736442e-08 -9.999999994736442e-08 -1e-07 1.0000001 1.0000001 1e-07 0 4 1 2 3 4
$EndEntities
$Nodes
9 143 1 143
0 1 0 1
1
0 0 0
0 2 0 1
2
1 0 0
0 3 0 1
3
1 1 0
0 4 0 1
4
0 1 0
1 1 0 9
5
6
7
8
9
10
11
12
13
0.1 0 0
0.2 0 0
0.3 0 0
0.4 0 0
0.5 0 0
0.6 0 0
0.7 0 0
0.8 0 0
0.9 0 0
1 2 0 9
14
15
16
17
18
19
20
21
22
1 0.1 0
1 0.2 0
1 0.3 0
1 0.4 0
1 0.5 0
1 0.6 0
1 0.7 0
1 0.8 0
1 0.9 0
1 3 0 9
23
24
25
26
27
28
29
30
31
0.9 1 0
0.8 1 0
0.7 1 0
0.6 1 0
0.5 1 0
0.4 1 0
0.3 1 0
0.2 1 0
0.09999999999999998 1 0
1 4 0 9
32
33
34
35
36
37
38
39
40
0 0.9 0
0 0.8 0
0 0.7 0
0 0.6 0
0 0.5 0
0 0.4 0
0 0.3 0
0 0.2 0
0 0.09999999999999998 0
2 1 0 103
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
0.5 0.5 0
0.7071428571428572 0.2928571428571428 0
0.7071428571428572 0.7071428571428572 0
0.2813605605204175 0.701969500996966 0
0.2928571428571428 0.2928571428571428 0
0.7758579074798024 0.5147174832368676 0
0.493149962973225 0.7759084652631476 0
0.506850037026775 0.2240915347368524 0
0.2240915347368524 0.493149962973225 0
0.8294973544973545 0.1705026455026455 0
0.8294973544973545 0.8294973544973545 0
0.1705026455026455 0.1705026455026454 0
0.1705026455026454 0.8294973544973545 0
0.3592898873606312 0.1511339309159103 0
0.6407947253692821 0.1518248097738525 0
0.8488660690840897 0.6407101126393689 0
0.3607435781083035 0.8484499785903453 0
0.1511339309159103 0.6407101126393688 0
0.1518248097738525 0.359205274630718 0
0.8488660690840897 0.3592898873606312 0
0.6407101126393688 0.8488660690840897 0
0.6401567944250871 0.4330139372822299 0
0.5669860627177701 0.6401567944250871 0
0.3598432055749129 0.5669860627177701 0
0.4330139372822299 0.3598432055749129 0
0.6733856581720996 0.5770645560214576 0
0.4489409534615607 0.6663521796462133 0
0.333826635273307 0.4413012504750118 0
0.5586987495249882 0.333826635273307 0
0.5335396291359238 0.109843205574913 0
0.109843205574913 0.4664603708640763 0
0.4664603708640763 0.890156794425087 0
0.890156794425087 0.5335396291359238 0
0.7403047640904488 0.09944092595747056 0
0.9023348642131718 0.2609263968561355 0
0.9006094296444203 0.7402985969818545 0
0.7390736031438645 0.9023348642131718 0
0.09939057035557974 0.7402985969818544 0
0.09944092595747056 0.2596952359095513 0
0.2609263968561355 0.09766513578682823 0
0.2610747326467143 0.9022924059995243 0
0.745282971718187 0.3958793750760887 0
0.6041206249239113 0.745282971718187 0
0.3958793750760887 0.2547170282818129 0
0.2547170282818129 0.6041206249239113 0
0.384704891613151 0.7505210099667106 0
0.615295108386849 0.2494789900332894 0
0.2494789900332894 0.384704891613151 0
0.5978296212305664 0.5245716233160158 0
0.9059804230793693 0.09401957692063068 0
0.09401957692063068 0.9059804230793693 0
0.09688906079890419 0.09688906079890419 0
0.9031109392010959 0.9031109392010959 0
0.4299212442790752 0.08324867532408453 0
0.9167513246759155 0.4299212442790752 0
0.08324867532408453 0.5700787557209248 0
0.5700787557209248 0.9167513246759155 0
0.2003834335631949 0.7370236452034065 0
0.7953061572217176 0.725001607673958 0
0.7223833510181306 0.2060517816310846 0
0.2060517816310846 0.2776166489818695 0
0.2722061756621068 0.8012652966219919 0
0.8012652966219918 0.2722061756621067 0
0.7277938243378933 0.8012652966219918 0
0.2722061756621067 0.1987347033780082 0
0.7523637681935527 0.6266755117910972 0
0.542335390056664 0.421352693305455 0
0.4501658790294238 0.5758506912721821 0
0.4239643555425228 0.4574794944307918 0
0.3575006807940414 0.6519524273377049 0
0.6921239612473346 0.4945204197407769 0
0.6424993192059586 0.3480475726622952 0
0.3480475726622952 0.3575006807940414 0
0.3500275056991684 0.06640954840536456 0
0.9335904515946354 0.3500275056991684 0
0.07222178826124714 0.3570721762808691 0
0.6429278237191309 0.07222178826124714 0
0.3576557363238189 0.9281798358029913 0
0.06675463531911485 0.6502174930684296 0
0.9279264586307194 0.6429096677514294 0
0.6499724943008316 0.9335904515946354 0
0.07997140572242911 0.8201017201097869 0
0.8238071187089842 0.92184034909451 0
0.1761928812910159 0.07815965090548999 0
0.9200285942775709 0.1798982798902132 0
0.9200285942775709 0.8201017201097869 0
0.1798982798902131 0.9200285942775709 0
0.8201017201097869 0.07997140572242911 0
0.07997140572242911 0.1798982798902131 0
0.519231323232856 0.7031172999754856 0
0.4736105247275205 0.2931196009667213 0
0.6516259541526819 0.6560383883487352 0
0.2931196009667213 0.5263894752724796 0
0.1646068749667147 0.5549039654243012 0
0.5549039654243012 0.8353931250332853 0
0.4450960345756987 0.1646068749667147 0
0.8313685985821415 0.4403319049504258 0
0.1828291668772978 0.4276562509996817 0
0.4279309480492506 0.8172199024734518 0
0.5723437490003183 0.1828291668772978 0
0.8176142401408163 0.5757657555868232 0
0.5224615528514942 0.5758647740932955 0
0.2194965262590453 0.6679809534620259 0
$EndNodes
$Elements
9 288 1 288
0 1 15 1
1 1
0 2 15 1
2 2
0 3 15 1
3 3
0 4 15 1
4 4
1 1 1 10
5 1 5
6 5 6
7 6 7
8 7 8
9 8 9
10 9 10
11 10 11
12 11 12
13 12 13
14 13 2
1 2 1 10
15 2 14
16 14 15
17 15 16
18 16 17
19 17 18
20 18 19
21 19 20
22 20 21
23 21 22
24 22 3
1 3 1 10
25 3 23
26 23 24
27 24 25
28 25 26
29 26 27
30 27 28
31 28 29
32 29 30
33 30 31
34 31 4
1 4 1 10
35 4 32
36 32 33
37 33 34
38 34 35
39 35 36
40 36 37
41 37 38
42 38 39
43 39 40
44 40 1
2 1 2 244
45 3 93 22
46 2 90 13
47 4 91 31
48 5 92 1
49 1 92 40
50 14 90 2
51 32 91 4
52 23 93 3
53 64 109 108
54 107 109 65
55 68 109 64
56 69 107 65
57 46 106 66
58 46 141 106
59 83 104 61
60 82 103 60
61 84 105 54
62 42 103 82
63 45 105 84
64 43 104 83
65 63 89 66
66 47 86 67
67 48 87 69
68 49 88 68
69 55 100 87
70 59 101 88
71 67 142 63
72 28 72 27
73 37 71 36
74 19 73 18
75 10 70 9
76 19 120 73
77 28 118 72
78 10 117 70
79 37 116 71
80 67 130 47
81 69 131 48
82 68 133 49
83 66 132 63
84 63 130 67
85 64 133 68
86 65 131 69
87 87 100 42
88 88 101 45
89 66 111 46
90 108 142 67
91 41 109 107
92 108 109 41
93 70 117 55
94 73 120 56
95 72 118 57
96 71 116 59
97 7 80 6
98 16 75 15
99 34 78 33
100 12 74 11
101 21 76 20
102 25 77 24
103 30 81 29
104 39 79 38
105 57 102 86
106 86 102 44
107 70 94 9
108 73 95 18
109 72 97 27
110 71 96 36
111 58 98 78
112 76 99 56
113 79 101 59
114 74 100 55
115 46 137 73
116 47 135 72
117 49 134 71
118 48 136 70
119 99 106 56
120 64 110 85
121 65 113 84
122 62 112 82
123 82 111 62
124 77 104 51
125 53 102 81
126 75 103 50
127 80 105 52
128 85 110 44
129 84 113 45
130 82 112 42
131 46 111 82
132 107 112 62
133 67 110 108
134 68 113 109
135 108 110 64
136 109 113 65
137 69 112 107
138 63 142 89
139 36 96 35
140 27 97 26
141 9 94 8
142 18 95 17
143 48 140 87
144 47 139 86
145 49 138 88
146 77 123 24
147 78 122 33
148 80 124 6
149 30 127 81
150 75 125 15
151 21 126 76
152 12 128 74
153 39 129 79
154 60 103 75
155 81 102 57
156 54 105 80
157 61 104 77
158 78 98 53
159 52 101 79
160 50 100 74
161 51 99 76
162 43 106 99
163 41 107 89
164 89 107 62
165 24 123 23
166 33 122 32
167 31 127 30
168 6 124 5
169 40 129 39
170 22 126 21
171 15 125 14
172 13 128 12
173 70 136 94
174 73 137 95
175 71 134 96
176 72 135 97
177 90 128 13
178 93 126 22
179 5 124 92
180 91 127 31
181 92 129 40
182 14 125 90
183 32 122 91
184 23 123 93
185 98 102 53
186 50 103 100
187 51 104 99
188 52 105 101
189 85 133 64
190 84 131 65
191 83 130 63
192 63 132 83
193 56 141 73
194 57 139 72
195 55 140 70
196 59 138 71
197 73 141 46
198 70 140 48
199 72 139 47
200 71 138 49
201 78 119 58
202 74 117 11
203 55 117 74
204 59 116 79
205 56 120 76
206 57 118 81
207 75 115 60
208 34 119 78
209 79 116 38
210 80 114 54
211 7 114 80
212 76 120 20
213 81 118 29
214 77 121 61
215 25 121 77
216 16 115 75
217 43 132 106
218 106 132 66
219 83 132 43
220 48 131 84
221 47 130 83
222 49 133 85
223 79 129 52
224 81 127 53
225 74 128 50
226 50 125 75
227 52 124 80
228 53 122 78
229 51 123 77
230 76 126 51
231 83 135 47
232 60 137 82
233 85 134 49
234 84 136 48
235 54 136 84
236 82 137 46
237 58 134 85
238 61 135 83
239 87 112 69
240 44 110 86
241 45 113 88
242 86 110 67
243 88 113 68
244 42 112 87
245 99 104 43
246 100 103 42
247 101 105 45
248 44 102 98
249 89 111 66
250 62 111 89
251 85 143 58
252 44 143 85
253 58 143 98
254 93 123 51
255 51 126 93
256 53 127 91
257 90 125 50
258 50 128 90
259 92 124 52
260 52 129 92
261 91 122 53
262 61 121 97
263 54 114 94
264 60 115 95
265 58 119 96
266 94 114 8
267 95 115 17
268 96 119 35
269 97 121 26
270 17 115 16
271 20 120 19
272 11 117 10
273 8 114 7
274 29 118 28
275 38 116 37
276 26 121 25
277 35 119 34
278 86 139 57
279 88 138 59
280 87 140 55
281 89 142 41
282 95 137 60
283 94 136 54
284 97 135 61
285 96 134 58
286 98 143 44
287 106 141 56
288 41 142 108
$EndElements
......@@ -5,5 +5,5 @@
float: right;
}
.wy-nav-content {
max-width: 1000px !important;
max-width: 1200px !important;
}
......@@ -15,43 +15,65 @@
# serve to show the default.
import os
import re
import sys
import shutil
sys.path.insert(0, os.path.abspath('.')) # add doc/ to the path
from utils.convert_notebook import modify_notebook_for_sphinx
def setup(app):
app.add_css_file('css/custom.css')
# -------------------- Import Readme --------------------
# -------------------- Copy images --------------------
source_dir = '../tutorials/images'
target_dir = './_static'
os.system('cp ../README.rst .')
print('import file: README.rst')
os.makedirs(target_dir, exist_ok=True)
for filename in os.listdir(source_dir):
if filename.endswith('.png'):
source_file = os.path.join(source_dir, filename)
target_file = os.path.join(target_dir, filename)
# Remove the target file if it exists
if os.path.exists(target_file):
os.remove(target_file)
# Copy the source file to the target location
shutil.copyfile(source_file, target_file)
print(f'Copied {source_file} to {target_file}')
# -------------------- Import Notebooks --------------------
for file in os.listdir('.'):
if '.ipynb' in file:
os.remove(file)
if file == 'tutorials.rst':
os.remove(file)
notebooks = os.listdir('../tutorials')
to_import = ['bvpy_tutorial_domain.ipynb',
'bvpy_tutorial_1_hello_world.ipynb',
to_import = ['bvpy_tutorial_1_hello_world.ipynb',
'bvpy_tutorial_2_domains.ipynb',
'bvpy_tutorial_3_vforms.ipynb',
'bvpy_tutorial_4_bnd_cond.ipynb',
'bvpy_tutorial_5_reaction_diffusion.ipynb',
'bvpy_tutorial_6_linear_elasticity.ipynb',
'bvpy_tutorial_7_hyper_elasticity.ipynb']
for i in notebooks:
if '.' != i[0] and i in to_import:
print('import file: '+i)
os.system('cp ../tutorials/'+i+' '+i)
with open("tutorials.rst","w+") as f:
'bvpy_tutorial_7_hyper_elasticity.ipynb',
'bvpy_tutorial_8_pyvista.ipynb',
'bvpy_tutorial_9_gmsh.ipynb',
'bvpy_tutorial_10_morphoelasticity.ipynb']
# - Copy & update notebook if needed (pyvista is used ?)
for file in notebooks:
if file in to_import:
print(f'Importing file: {file}')
shutil.copy(f'../tutorials/{file}', file)
modify_notebook_for_sphinx(file, inplace=True, dynamic_plot=False) # dynamic_plot should be set to True when
# vtk.js have been updated
with open("tutorials.rst", "w+") as f:
f.write(".. _tutorials:\n\n")
f.write("Tutorials\n")
f.write("*********\n\n")
......@@ -100,17 +122,19 @@ extensions = [
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'nbsphinx',
'recommonmark'
'recommonmark',
'pyvista.ext.plot_directive',
'pyvista.ext.viewer_directive',
'sphinx_design'
]
# Enable plotly figure in the docs
# Enable plotly figures and add custom CSS for hiding cells with `remove_cell` tags
nbsphinx_prolog = r"""
.. raw:: html
<script src='http://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js'></script>
<script>require=requirejs;</script>
"""
nbsphinx_timeout = -1
......@@ -118,11 +142,11 @@ nbsphinx_timeout = -1
# but still useful
# based on the fact that the extension is installed on the system
try:
import matplotlib.sphinxext.plot_directive
extensions.append('matplotlib.sphinxext.plot_directive')
except ImportError:
pass
#try:
# import matplotlib.sphinxext.plot_directive
# extensions.append('matplotlib.sphinxext.plot_directive')
#except ImportError:
# pass
......@@ -158,9 +182,9 @@ copyright = u"2020, bvpy"
#
# The short X.Y version.
version = "1.0.1"
version = "1.3.0"
# The full version, including alpha/beta/rc tags.
release = "1.0.1"
release = "1.3.0"
# The language for content autogenerated by Sphinx. Refer to documentation
......@@ -290,14 +314,10 @@ htmlhelp_basename = "bvpydoc"
# -- Options for LaTeX output ------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
# 'preamble': '',
'preamble': r'''
\usepackage{amsmath} % For math expressions
\usepackage{amssymb} % For symbols like \nabla
''',
}
# Grouping the document tree into LaTeX files. List of tuples
......@@ -370,7 +390,6 @@ texinfo_documents = [
# If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False
# use apidoc to generate developer doc
try:
from sphinx.ext.apidoc import main
......
.. image:: https://gitlab.inria.fr/mosaic/bvpy/badges/develop/coverage.svg
:target: https://gitlab.inria.fr/mosaic/bvpy
:target: https://gitlab.inria.fr/mosaic/bvpy/-/commits/develop
.. image:: https://gitlab.inria.fr/mosaic/bvpy/badges/master/pipeline.svg
:target: https://gitlab.inria.fr/mosaic/bvpy/pipelines
.. image:: https://anaconda.org/mosaic/bvpy/badges/platforms.svg
:target: https://anaconda.org/conda-forge/bvpy
:target: https://anaconda.org/MOSAIC/bvpy
.. image:: https://img.shields.io/conda/vn/conda-forge/bvpy.svg
:target: https://anaconda.org/conda-forge/bvpy
.. image:: https://anaconda.org/mosaic/bvpy/badges/version.svg
:target: https://anaconda.org/MOSAIC/bvpy/files
.. image:: https://anaconda.org/mosaic/bvpy/badges/license.svg
:target: https://www.gnu.org/licenses/lgpl-3.0.txts
.. image:: https://img.shields.io/badge/license-LGPL3-black
:target: https://www.gnu.org/licenses/lgpl-3.0.html
.. image:: https://anaconda.org/conda-forge/bvpy/badges/latest_release_date.svg
:target: https://anaconda.org/conda-forge/bvpy
.. image:: https://anaconda.org/mosaic/bvpy/badges/latest_release_date.svg
:target: https://anaconda.org/MOSAIC/bvpy
.. image:: https://anaconda.org/conda-forge/bvpy/badges/downloads.svg
:target: https://anaconda.org/conda-forge/bvpy
.. image:: https://anaconda.org/mosaic/bvpy/badges/downloads.svg
:target: https://anaconda.org/MOSAIC/bvpy
.. toctree::
:caption: Table of contents
......@@ -31,4 +31,4 @@
Sources <_dvlpt/modules>
.. include:: README.rst
.. include:: ../README.rst
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
\ No newline at end of file
import nbformat
import re
def modify_notebook_for_sphinx(input_path, output_path=None, inplace=True, dynamic_plot=False):
""" Change the backend if pyvista is imported and update image paths.
TODO: follow issues to know when a full dynamic plot with `html` can be done
https://github.com/pyvista/pyvista/issues/6250 --> add_text (title)
https://github.com/pyvista/pyvista/issues/5389 --> labelled scalar bar
Parameters
----------
input_path : str
input path of the notebook
output_path : str, optional
output path of the notebook, by default None
inplace : bool, optional
update the notebook inplace, by default True
dynamic_plot : bool, optional
make the pyvista plot dynamic or static, by default False.
"""
# Load the notebook
with open(input_path) as f:
nb = nbformat.read(f, as_version=4)
# List to store modified cells
new_cells = []
# Should be set to `html` as soon as vtk.js supports text & categorical labelling
if dynamic_plot:
pyvista_flag = 'html'
else:
pyvista_flag = 'static'
for cell in nb.cells:
# For markdown cells, update image references
if cell.cell_type == "markdown":
cell.source = re.sub(
r'(<img\s+src=")images/([^"]+)(".*?>)',
r'\1_static/\2\3',
cell.source
)
# Append the original cell
new_cells.append(cell)
# Check if the cell is a code cell and contains 'import pyvista as pv'
if cell.cell_type == "code":
if 'import pyvista as pv' in cell.source:
# Create a new cell with PyVista backend configuration
new_cell = nbformat.v4.new_code_cell(
source=(
"# ---- for online doc only ---- #\n"
f"pv.set_jupyter_backend('{pyvista_flag}')\n"
"pv.start_xvfb()\n"
"import time\n"
"time.sleep(3) # Give time to xvfb to start \n"
"# ---- end of online doc only ---- #"
)
)
# Add metadata to hide the new cell in Sphinx-generated documentation
new_cell.metadata["nbsphinx"] = "hidden"
new_cells.append(new_cell)
# Update notebook cells with modified cells
nb.cells = new_cells
# Save the modified notebook
if inplace or (output_path is None):
output_path = input_path
with open(output_path, 'w') as f:
nbformat.write(nb, f)
\ No newline at end of file
[project]
name = "bvpy"
version = "1.1.0"
version = "1.3.0"
description = "A package implementing Boundary Value Problem."
authors = [
{name="Florian Gacon", email="florian.gacon@inria.fr"},
......@@ -12,14 +12,14 @@ maintainers= [
readme = "README.rst"
requires-python = ">=3.9, <4"
dependencies = [
"numpy<2",
"numpy<1.25",
"meshio",
"importlib_metadata",
"plotly",
"pyvista[all]",
"typing_extensions",
"h5py",
"nbformat>=4.2.0",
"scipy"
]
license = {file = "LICENSE"}
......@@ -38,7 +38,19 @@ doc = [
"notebook",
"chardet",
"recommonmark",
]
"pandoc",
"pydata-sphinx-theme",
"pypandoc",
"pytest-sphinx",
"sphinx-autobuild",
"sphinx-copybutton",
"sphinx-design",
"sphinx-gallery",
"sphinx-toolbox",
"sphinxcontrib-asciinema",
"sphinxcontrib-websupport",
"typed-ast"
] # to visualize pyvista from notebooks
test = [
"pytest",
"pytest-cov",
......
......@@ -198,7 +198,7 @@ class Boundary(object):
"""
if meshfunc is not None:
self._domain.mark(meshfunc, valueTrue)
self._domain.mark(meshfunc, valueTrue) # this mark the subdomain meshfunc using the condition
else:
meshfunc = fe.MeshFunction(type, mesh, dim_topology)
meshfunc.set_all(valueFalse)
......
......@@ -23,16 +23,10 @@ import fenics as fe
from bvpy import logger
import numpy as np
from sympy import Symbol
from sympy.parsing.sympy_parser import parse_expr
from .boundary import Boundary
from bvpy.domains.geometry import boundary_normal
_XYZ = {'x': Symbol('x[0]'),
'y': Symbol('x[1]'),
'z': Symbol('x[2]')}
from bvpy.utils.pre_processing import create_expression, _stringify_expression_from_string
class ConstantDirichlet(object):
"""Defines a constant Dirichlet condition on a domain.
......@@ -121,10 +115,21 @@ class ConstantDirichlet(object):
class VariableDirichlet(object):
"""Defines a variable Dirichlet condition on a domain.
The `val` argument allows to pass a string expression that can be :
val = "sin(x) + cos(y)" # scalar
val = "(x, y * pow(x,2))" # vector
Tensor expressions of rank 2 (matrices) may also be created:
val = "((exp(x), sin(y)),
(sin(x), tan(y))"
See <cmath> for the available functions. https://cplusplus.com/reference/cmath/
"""
def __init__(self, val, boundary="all",
method='topological', subspace=None, degree=None):
method='topological', subspace=None, degree=None, **kwargs):
"""Generator of the VariableDirichlet class.
Parameters
......@@ -161,6 +166,7 @@ class VariableDirichlet(object):
self._method = method
self._subspace = subspace
self._degree = degree
self._extra_kwargs = kwargs
def apply(self, functionSpace):
"""Applies the specified condition on the actual function space.
......@@ -177,12 +183,13 @@ class VariableDirichlet(object):
The boundary condition in a fenics-readable format.
"""
parse = parse_expr(self._val, local_dict=_XYZ, evaluate=False)
# Pre-format the input value (if vector or tensor)
val = _stringify_expression_from_string(self._val)
if self._degree is None:
expr = fe.Expression(str(parse),
element=functionSpace.ufl_element())
expr = create_expression(val, functionspace=functionSpace, **self._extra_kwargs)
else:
expr = fe.Expression(str(parse), degree=self._degree)
expr = create_expression(val, degree=self._degree, **self._extra_kwargs)
if self._subspace is None:
dir = fe.DirichletBC(functionSpace, expr,
......
......@@ -318,26 +318,18 @@ class BVP(object):
Parameters
----------
bnd_cond : :class:`ConstantDirichlet<femtk.boundary_conditions.
dirichlet.ConstantDirichlet>`,
:class:`VariableDirichlet<femtk.boundary_conditions.
dirichlet.VariableDirichlet>`
Class representing a boundary condition
method : str
Optional (default is 'topological'). Method to apply Dirichlet
condition.
subspace : int or None
Optional (default is None). Index of the subspace
to constrain for Dirichlet.
degree : int or None
Optional (default is None). Determines the degree for
:class:`VariableDirichlet<femtk.boundary_conditions.
dirichlet.VariableDirichlet>`
bnd_cond : :class:`ConstantDirichlet <femtk.boundary_conditions.dirichlet.ConstantDirichlet>`, :class:`VariableDirichlet <femtk.boundary_conditions.dirichlet.VariableDirichlet>`
Class representing a boundary condition.
method : str, optional
Method to apply Dirichlet condition (default is 'topological').
subspace : int or None, optional
Index of the subspace to constrain for Dirichlet (default is None).
degree : int or None, optional
Determines the degree for :class:`VariableDirichlet <femtk.boundary_conditions.dirichlet.VariableDirichlet>` (default is None).
Returns
-------
None
"""
if not isinstance(bnd_cond, (list, tuple)):
bnd_cond = [bnd_cond]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment