Skip to content

Commit 97bc592

Browse files
authored
Merge pull request #147 from mesnardo/bugfix-probe
Bugfix (ProbeVolume): Output IS (with natural ordering) to re-arrange sub-data (post-processing)
2 parents 6ab5dec + cb3a15c commit 97bc592

File tree

6 files changed

+166
-53
lines changed

6 files changed

+166
-53
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22

33
---
44

5+
## 0.5.1
6+
7+
---
8+
9+
### Added
10+
11+
### Changed
12+
13+
### Fixed
14+
15+
* `ProbeVolume`: write a PETSc Index Set to the output file (HDF5 or ASCII) for the volume probe. The index set contains the natural index of the points located inside the volume being monitored. During post-processing stage, the index set can be used to re-arrange field values of the sub-volume and visualize the solution. Without this index set, the PETSc vector for the sub-volume (obtained with the PETSc routine `VecGetSubVector`) did not output the values in the natural ordering of the vector. `VecGetSubVector` simply concatenates the values in the parallel ordering of the vector. This problem only affected simulations running with multiple MPI processes where the window being monitored span over multiple process domains.
16+
17+
### Removed
18+
19+
---
20+
521
## 0.5.0
622

723
---

configure

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.69 for PetIBM 0.5.
3+
# Generated by GNU Autoconf 2.69 for PetIBM 0.5.1.
44
#
55
# Report bugs to <mesnardo@gwu.edu, pychuang@gwu.edu>.
66
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
590590
# Identity of this package.
591591
PACKAGE_NAME='PetIBM'
592592
PACKAGE_TARNAME='petibm'
593-
PACKAGE_VERSION='0.5'
594-
PACKAGE_STRING='PetIBM 0.5'
593+
PACKAGE_VERSION='0.5.1'
594+
PACKAGE_STRING='PetIBM 0.5.1'
595595
PACKAGE_BUGREPORT='mesnardo@gwu.edu, pychuang@gwu.edu'
596596
PACKAGE_URL=''
597597

@@ -1376,7 +1376,7 @@ if test "$ac_init_help" = "long"; then
13761376
# Omit some internal or obsolete options to make the list less imposing.
13771377
# This message is too long to be a string in the A/UX 3.1 sh.
13781378
cat <<_ACEOF
1379-
\`configure' configures PetIBM 0.5 to adapt to many kinds of systems.
1379+
\`configure' configures PetIBM 0.5.1 to adapt to many kinds of systems.
13801380

13811381
Usage: $0 [OPTION]... [VAR=VALUE]...
13821382

@@ -1447,7 +1447,7 @@ fi
14471447

14481448
if test -n "$ac_init_help"; then
14491449
case $ac_init_help in
1450-
short | recursive ) echo "Configuration of PetIBM 0.5:";;
1450+
short | recursive ) echo "Configuration of PetIBM 0.5.1:";;
14511451
esac
14521452
cat <<\_ACEOF
14531453

@@ -1589,7 +1589,7 @@ fi
15891589
test -n "$ac_init_help" && exit $ac_status
15901590
if $ac_init_version; then
15911591
cat <<\_ACEOF
1592-
PetIBM configure 0.5
1592+
PetIBM configure 0.5.1
15931593
generated by GNU Autoconf 2.69
15941594

15951595
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2395,7 +2395,7 @@ cat >config.log <<_ACEOF
23952395
This file contains any messages produced by compilers while
23962396
running configure, to aid debugging if configure makes a mistake.
23972397

2398-
It was created by PetIBM $as_me 0.5, which was
2398+
It was created by PetIBM $as_me 0.5.1, which was
23992399
generated by GNU Autoconf 2.69. Invocation command line was
24002400

24012401
$ $0 $@
@@ -3262,7 +3262,7 @@ fi
32623262

32633263
# Define the identity of the package.
32643264
PACKAGE='petibm'
3265-
VERSION='0.5'
3265+
VERSION='0.5.1'
32663266

32673267

32683268
cat >>confdefs.h <<_ACEOF
@@ -20826,7 +20826,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
2082620826
# report actual input values of CONFIG_FILES etc. instead of their
2082720827
# values after options handling.
2082820828
ac_log="
20829-
This file was extended by PetIBM $as_me 0.5, which was
20829+
This file was extended by PetIBM $as_me 0.5.1, which was
2083020830
generated by GNU Autoconf 2.69. Invocation command line was
2083120831

2083220832
CONFIG_FILES = $CONFIG_FILES
@@ -20892,7 +20892,7 @@ _ACEOF
2089220892
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
2089320893
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
2089420894
ac_cs_version="\\
20895-
PetIBM config.status 0.5
20895+
PetIBM config.status 0.5.1
2089620896
configured by $0, generated by GNU Autoconf 2.69,
2089720897
with options \\"\$ac_cs_config\\"
2089820898

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# set-up
66
AC_PREREQ([2.69])
7-
AC_INIT([PetIBM], [0.5], [mesnardo@gwu.edu, pychuang@gwu.edu])
7+
AC_INIT([PetIBM], [0.5.1], [mesnardo@gwu.edu, pychuang@gwu.edu])
88
AC_CONFIG_AUX_DIR([config])
99
AC_CONFIG_MACRO_DIR([m4])
1010
AM_INIT_AUTOMAKE([foreign subdir-objects])

doc/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = PetIBM
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = 0.5
41+
PROJECT_NUMBER = 0.5.1
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

include/petibm/probes.h

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,11 @@ class ProbeVolume : public ProbeBase
144144
/** \brief Limits of the volume. */
145145
type::RealVec2D box;
146146

147-
/** \brief Index set for the grid points to monitor. */
148-
IS is;
147+
/** \brief Index set for the grid points to monitor (PETSc ordering). */
148+
IS isPetsc;
149+
150+
/** \brief Index set for the grid points to monitor (Natural ordering). */
151+
IS isNatural;
149152

150153
/** \brief Sub-vector of the region to monitor. */
151154
Vec dvec;
@@ -182,8 +185,8 @@ class ProbeVolume : public ProbeBase
182185
* \param box [in] Box area to monitor
183186
* \return PetscErrorCode
184187
*/
185-
PetscErrorCode getSubMeshInfo(const type::Mesh &mesh,
186-
const type::RealVec2D &box);
188+
PetscErrorCode getInfo(const type::Mesh &mesh,
189+
const type::RealVec2D &box);
187190

188191
/** \brief Create the index set for the points to monitor.
189192
*
@@ -197,28 +200,53 @@ class ProbeVolume : public ProbeBase
197200
* \param mesh [in] Cartesian mesh object
198201
* \return PetscErrorCode
199202
*/
200-
PetscErrorCode createSubMesh(const type::Mesh &mesh);
203+
PetscErrorCode createGrid(const type::Mesh &mesh);
201204

202205
/** \brief Write the sub mesh grid points into a file.
206+
*
207+
* Supported formats are HDF5 and ASCII.
203208
*
204209
* \param filePath [in] Path of the file to write in
205210
* \return PetscErrorCode
206211
*/
207-
PetscErrorCode writeSubMesh(const std::string &filePath);
212+
PetscErrorCode writeGrid(const std::string &filePath);
208213

209214
/** \brief Write the sub mesh into an ASCII file.
210215
*
211216
* \param filePath [in] Path of the file to write in
212217
* \return PetscErrorCode
213218
*/
214-
PetscErrorCode writeSubMeshASCII(const std::string &filePath);
219+
PetscErrorCode writeGrid_ASCII(const std::string &filePath);
215220

216221
/** \brief Write the sub mesh into a HDF5 file.
217222
*
218223
* \param filePath [in] Path of the file to write in
219224
* \return PetscErrorCode
220225
*/
221-
PetscErrorCode writeSubMeshHDF5(const std::string &filePath);
226+
PetscErrorCode writeGrid_HDF5(const std::string &filePath);
227+
228+
/** \brief Write index set (natural ordering) into a file.
229+
*
230+
* Supported formats are HDF5 and ASCII.
231+
*
232+
* \param filePath [in] Path of the file to write in
233+
* \return PetscErrorCode
234+
*/
235+
PetscErrorCode writeIS(const std::string &filePath);
236+
237+
/** \brief Write index set (natural ordering) into a HDF5 file.
238+
*
239+
* \param filePath [in] Path of the file to write in
240+
* \return PetscErrorCode
241+
*/
242+
PetscErrorCode writeIS_HDF5(const std::string &filePath);
243+
244+
/** \brief Write index set (natural ordering) into a HDF5 file.
245+
*
246+
* \param filePath [in] Path of the file to write in
247+
* \return PetscErrorCode
248+
*/
249+
PetscErrorCode writeIS_ASCII(const std::string &filePath);
222250

223251
/** \copydoc ProbeBase::monitorVec() */
224252
PetscErrorCode monitorVec(const DM &da,
@@ -242,15 +270,15 @@ class ProbeVolume : public ProbeBase
242270
* \param t [in] Time
243271
* \return PetscErrorCode
244272
*/
245-
PetscErrorCode writeVecASCII(const Vec &vec, const PetscReal &t);
273+
PetscErrorCode writeVec_ASCII(const Vec &vec, const PetscReal &t);
246274

247275
/** \brief Output a PETSc Vec object to a HDF5 file.
248276
*
249277
* \param vec [in] PETSc Vec object to output
250278
* \param t [in] Time
251279
* \return PetscErrorCode
252280
*/
253-
PetscErrorCode writeVecHDF5(const Vec &vec, const PetscReal &t);
281+
PetscErrorCode writeVec_HDF5(const Vec &vec, const PetscReal &t);
254282

255283
}; // ProbeVolume
256284

0 commit comments

Comments
 (0)