Skip to content

Commit

Permalink
Merge pull request #126 from feelpp/125-fix-rename-script
Browse files Browse the repository at this point in the history
resolves 125: fix rename script
  • Loading branch information
prudhomm committed Nov 6, 2023
2 parents 5d95a25 + c6e37f1 commit 49de0a1
Show file tree
Hide file tree
Showing 22 changed files with 44 additions and 679 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ cmake_minimum_required(VERSION 3.21.0)

project(
feelpp-project
VERSION 3.0.0 )
VERSION 3.0.1 )

set(EXTRA_VERSION "")
set(PROJECT_SHORTNAME "fp")
Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
:cpp: C++
:project: feelpp-project

= {feelpp} Project Template
= {feelpp} Template Project
Christophe Prud'homme <https://github.com/prudhomm[@prudhomm]>
v2:

Expand Down
47 changes: 20 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,31 @@
:feelpp: Feel++
:cpp: C++
:project: feelpp-project
# Feel++ Template Project
Author: Christophe Prud'homme ![GitHub](https://github.com/prudhomm)
Version: v2

= {feelpp} Project Template
Christophe Prud'homme <https://github.com/prudhomm[@prudhomm]>
v2:
![CI](https://github.com/feelpp/feelpp-project/workflows/CI/badge.svg)

image:https://github.com/feelpp/feelpp-project/workflows/CI/badge.svg[CI]
This repository provides a basic starting point for a Feel++ application including:

This repository provides a basic starting point for a {feelpp} application including:
- [x] Feel++ applications in C++ to use Feel++ and Feel++ toolboxes in `src`
- [x] Documentation using asciidoc and antora
- [x] Python Feel++ notebooks that can be downloaded from the documentation
- [x] Continuous integration including tests for the C++ applications
- [x] Docker image generation for the project

- [x] {feelpp} applications in {cpp} to use {feelpp} and {feelpp} toolboxes in `src`
- [x] documentation using asciidoc and antora
- [x] python {feelpp} notebooks that can be downloaded from the documentation
- [x] continuous integration including tests for the {cpp} applications
- [x] docker image generation for the project
The documentation for feelpp-project is available [here](https://feelpp.github.io/feelpp-project), and you can build on it for your project by enabling the [github pages](https://docs.github.com/en/pages) for your repository.

The documentation for feelpp-project is available at link:https://feelpp.github.io/feelpp-project[here] and you can build on it for your project by enabling the link:https://docs.github.com/en/pages[github pages] for your repository.
## Renaming the project

== Renaming the project
By default, the project is named `feelpp-project` if you cloned the repository `feelpp/feelpp-project`. However, if you used the previous repository as a template, then the project is renamed using the name of the repository using the script `rename.sh` at the initialization of the repository. If the name does not suit you, you can change it again using the script `rename.sh` and providing the new name as an argument.

By default the project is named `feelpp-project` if you cloned the repository `feelpp/feelpp-project`.
However if you used the previous repository as a template, then the project is renamed using the name of the repository using the script `rename.sh` at the initialization of the repository.
If the name does not suit you, you can change it again using the script `rename.sh` and providing the new name as argument.
> **Warning**: The script `rename.sh` will rename the project. However, some URLs might not be set properly if you rename the project yourself. You need to check the following files: `docs/site.yml` and `docs/package.json` and fix the URLs after the rename process is done.
WARNING: the script `rename.sh` will rename the project however some url might be set properly if you rename the project yourself. You need to check the following files: `docs/site.yml` and `docs/package.json` and fix the urls after the rename process is done.
## Updating the project version

== Updating the {project} version
The version of the project is defined in the files `CMakeLists.txt`, `docs/antora.yml`, and `docs/package.json`. You need to update with the same version in all files.

The version of the project is defined in the files `CMakeLists.txt`, `docs/antora.yml` and `docs/package.json`.
You need to update with the same version in all files.
## Release process

== Release process

- [x] update the version in CMakeLists.txt
- [x] update the version in docs/antora.yml
- [x] commit the changes with the message "Release vx.y.z". At this point the CI will generate the docker image and push it to docker hub
- [x] Update the version in `CMakeLists.txt`
- [x] Update the version in `docs/antora.yml`
- [x] Commit the changes with the message "Release vx.y.z". At this point, the CI will generate the docker image and push it to Docker Hub.
9 changes: 7 additions & 2 deletions docs/modules/ROOT/pages/examples/fin.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Christophe Prud'homme
:page-illustration: fin2d-4.png
:description: We simulate the heat transfer in a thermal fin

== Problem statement

We consider the problem of designing a thermal fin to effectively remove heat from a surface. The two-dimensional fin, shown in Figure below, consists of a vertical central post and four horizontal subfins; the fin conducts heat from a prescribed uniform flux source at the root, stem:[\Gamma_{\text {root }}], through the large-surface-area subfins to surrounding flowing air. The fin is characterized by a five-component parameter vector, or input, stem:[\mu_{=}\left(\mu_1, \mu_2, \ldots, \mu_5\right)], where stem:[\mu_i=k^i, i=1, \ldots, 4], and stem:[\mu_5=\mathrm{Bi} ; \mu] may take on any value in a specified design set stem:[D \subset \mathbb{R}^5].

.Geometry of 2D thermal fin
Expand All @@ -16,9 +18,12 @@ Here stem:[k^i] is the thermal conductivity of the ith subfin (normalized relati
We are interested in the design of this thermal fin, and we thus need to look at certain outputs or cost-functionals of the temperature as a function of stem:[\mu]. We choose for our output stem:[T_{\text {root }}], the average steady-state temperature of the fin root normalized by the prescribed heat flux into the fin root. The particular output chosen relates directly to the cooling efficiency of the fin lower values of stem:[T_{\text {root }}] imply better thermal performance. The steadystate temperature distribution within the fin, stem:[u(\mu)], is governed by the elliptic partial differential equation
[stem]
++++
-k^i \Delta u^i=0 \text { in } \Omega^i, i=0, \ldots, 4,
\rho_i C_i \frac{\partial u^i}{\partial t} -k^i \Delta u^i=0 \text { in } \Omega^i, i=0, \ldots, 4,
++++
where stem:[\Delta] is the Laplacian operator, and stem:[u_i] refers to the restriction of stem:[u] to stem:[\Omega^i] . Here stem:[\Omega^i] is the region of the fin with conductivity stem:[k^i, i=0, \ldots, 4: \Omega^0] is thus the central post, and stem:[\Omega^i, i=1, \ldots, 4], corresponds to the four subfins. The entire fin domain is denoted stem:[\Omega\left(\bar{\Omega}=\cup_{i=0}^4 \bar{\Omega}^i\right)]; the boundary stem:[\Omega] is denoted stem:[\Gamma]. We must also ensure continuity of temperature and heat flux at the conductivity discontinuity interfaces stem:[\Gamma_{\text {int }}^i \equiv \partial \Omega^0 \cap \partial \Omega^i, i=1, \ldots, 4], where stem:[\partial \Omega^i] denotes the boundary of stem:[\Omega^i], we have on stem:[\Gamma_{\text {int }}^i i=1, \ldots, 4] :
where stem:[\Delta] is the Laplacian operator, and stem:[u_i] refers to the restriction of stem:[u] to stem:[\Omega^i].
Here stem:[\Omega^i] is the region of the fin with conductivity stem:[k^i, i=0, \ldots, 4] and volumetric heat capacity stem:[(\rho C)_i, i=0, \cdots, 4]: stem:[\Omega^0] is thus the central post, and stem:[\Omega^i, i=1, \ldots, 4], corresponds to the four subfins.

The entire fin domain is denoted stem:[\Omega\left(\bar{\Omega}=\cup_{i=0}^4 \bar{\Omega}^i\right)]; the boundary stem:[\Omega] is denoted stem:[\Gamma]. We must also ensure continuity of temperature and heat flux at the conductivity discontinuity interfaces stem:[\Gamma_{\text {int }}^i \equiv \partial \Omega^0 \cap \partial \Omega^i, i=1, \ldots, 4], where stem:[\partial \Omega^i] denotes the boundary of stem:[\Omega^i], we have on stem:[\Gamma_{\text {int }}^i i=1, \ldots, 4] :
[stem]
++++
\begin{aligned}
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"dependencies": {
"@antora/cli": "^3.1",
"@antora/collector-extension": "^1.0.0-alpha.3",
"@antora/site-generator": "^3.1",
"@antora/site-generator-default": "^3.1",
"@asciidoctor/core": "^2.2.6",
"asciidoctor": "^2.2.6",
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ build-backend = "scikit_build_core.build"

[project]
name = "feelpp-project"
version = "3.0.0"
description="Feelpp Template Project"
version = "3.0.1"
description="Feel++ Template Project"
readme = "README.md"
authors = [
{ name = "Christophe Prud'homme", email = "christophe.prudhomme@cemosis.fr" },
Expand Down
8 changes: 7 additions & 1 deletion rename.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ else
projecttitle=$(create_title ${projectname})
shortprojectname=$( create_short_name $projectname )
appname="app"
projectname_="${projectname//-/_}"

fi

echo " project name: $projectname"
Expand All @@ -89,27 +91,31 @@ if [ "$1" == "-r" ]; then
fi

export projectname
export projectname_
export projecttitle
export shortprojectname
export appname

files=( "README.adoc" "CMakeLists.txt" "src/CMakeLists.txt"
files=( "README.adoc" "README.md" "CMakeLists.txt" "src/CMakeLists.txt"
"src/.tests.laplacian"
"src/.tests.toolbox"
"site.yml"
"docs/antora.yml"
"package.json"
"package-lock.json"
"pyproject.toml"
"docs/modules/ROOT/pages/index.adoc"
".github/workflows/ci.yml" )
for i in "${files[@]}"
do
echo "processing renaming in $i ...."
perl -077pi.bak -e 's/feelpp-project/$ENV{'projectname'}/sg' $i
perl -077pi.bak -e 's/feelpp_project/$ENV{'projectname_'}/sg' $i
perl -077pi.bak -e 's/Feel\+\+ Template Project/$ENV{'projecttitle'}/sg' $i
perl -077pi.bak -e 's/\"fp\"/"$ENV{'shortprojectname'}"/sg' $i
perl -077pi.bak -e 's/myapp/$ENV{'appname'}/sg' $i
done
git mv src/feelpp_project src/$projectname_



Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ build
scikit-build >= 0.8.1
scikit_build_core
pyproject-metadata
ipykernel
numpy
scipy
pandas
Expand Down
2 changes: 1 addition & 1 deletion src/_laplacian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ PYBIND11_MODULE(_laplacian, m )
if (import_mpi4py()<0) return ;
m.doc() = fmt::format("Python bindings for Laplacian class" ); // Optional module docstring
laplacian_inst<2,1>(m);
// laplacian_inst<2,2>(m);
laplacian_inst<2,2>(m);
// laplacian_inst<2,3>(m);
// laplacian_inst<3,1>(m);
// laplacian_inst<3,2>(m);
Expand Down
2 changes: 1 addition & 1 deletion src/feelpp_project/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
print(f"Welcome in feelpp_project!")




Expand Down
1 change: 1 addition & 0 deletions src/feelpp_project/laplacian.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

_laps = {
'laplacian(2,1)': Laplacian2DP1,
'laplacian(2,2)': Laplacian2DP2,
}


Expand Down
1 change: 0 additions & 1 deletion src/src/.tests.laplacian

This file was deleted.

1 change: 0 additions & 1 deletion src/src/.tests.toolbox

This file was deleted.

15 changes: 0 additions & 15 deletions src/src/cases/electric/2d.cfg

This file was deleted.

17 changes: 0 additions & 17 deletions src/src/cases/electric/2d.geo

This file was deleted.

52 changes: 0 additions & 52 deletions src/src/cases/electric/2d.json

This file was deleted.

105 changes: 0 additions & 105 deletions src/src/cases/laplacian/fin/fin.geo

This file was deleted.

Loading

0 comments on commit 49de0a1

Please sign in to comment.