Skip to content

Commit

Permalink
Merge pull request #147 from mesnardo/bugfix-probe
Browse files Browse the repository at this point in the history
Bugfix (ProbeVolume): Output IS (with natural ordering) to re-arrange sub-data (post-processing)
  • Loading branch information
mesnardo authored Feb 8, 2020
2 parents 6ab5dec + cb3a15c commit 97bc592
Show file tree
Hide file tree
Showing 6 changed files with 166 additions and 53 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

---

## 0.5.1

---

### Added

### Changed

### Fixed

* `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.

### Removed

---

## 0.5.0

---
Expand Down
20 changes: 10 additions & 10 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for PetIBM 0.5.
# Generated by GNU Autoconf 2.69 for PetIBM 0.5.1.
#
# Report bugs to <mesnardo@gwu.edu, pychuang@gwu.edu>.
#
Expand Down Expand Up @@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='PetIBM'
PACKAGE_TARNAME='petibm'
PACKAGE_VERSION='0.5'
PACKAGE_STRING='PetIBM 0.5'
PACKAGE_VERSION='0.5.1'
PACKAGE_STRING='PetIBM 0.5.1'
PACKAGE_BUGREPORT='mesnardo@gwu.edu, pychuang@gwu.edu'
PACKAGE_URL=''

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

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

Expand Down Expand Up @@ -1447,7 +1447,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of PetIBM 0.5:";;
short | recursive ) echo "Configuration of PetIBM 0.5.1:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1589,7 +1589,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
PetIBM configure 0.5
PetIBM configure 0.5.1
generated by GNU Autoconf 2.69

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

It was created by PetIBM $as_me 0.5, which was
It was created by PetIBM $as_me 0.5.1, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ $0 $@
Expand Down Expand Up @@ -3262,7 +3262,7 @@ fi

# Define the identity of the package.
PACKAGE='petibm'
VERSION='0.5'
VERSION='0.5.1'


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

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

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# set-up
AC_PREREQ([2.69])
AC_INIT([PetIBM], [0.5], [mesnardo@gwu.edu, pychuang@gwu.edu])
AC_INIT([PetIBM], [0.5.1], [mesnardo@gwu.edu, pychuang@gwu.edu])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign subdir-objects])
Expand Down
2 changes: 1 addition & 1 deletion doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = PetIBM
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 0.5
PROJECT_NUMBER = 0.5.1

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
48 changes: 38 additions & 10 deletions include/petibm/probes.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,11 @@ class ProbeVolume : public ProbeBase
/** \brief Limits of the volume. */
type::RealVec2D box;

/** \brief Index set for the grid points to monitor. */
IS is;
/** \brief Index set for the grid points to monitor (PETSc ordering). */
IS isPetsc;

/** \brief Index set for the grid points to monitor (Natural ordering). */
IS isNatural;

/** \brief Sub-vector of the region to monitor. */
Vec dvec;
Expand Down Expand Up @@ -182,8 +185,8 @@ class ProbeVolume : public ProbeBase
* \param box [in] Box area to monitor
* \return PetscErrorCode
*/
PetscErrorCode getSubMeshInfo(const type::Mesh &mesh,
const type::RealVec2D &box);
PetscErrorCode getInfo(const type::Mesh &mesh,
const type::RealVec2D &box);

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

/** \brief Write the sub mesh grid points into a file.
*
* Supported formats are HDF5 and ASCII.
*
* \param filePath [in] Path of the file to write in
* \return PetscErrorCode
*/
PetscErrorCode writeSubMesh(const std::string &filePath);
PetscErrorCode writeGrid(const std::string &filePath);

/** \brief Write the sub mesh into an ASCII file.
*
* \param filePath [in] Path of the file to write in
* \return PetscErrorCode
*/
PetscErrorCode writeSubMeshASCII(const std::string &filePath);
PetscErrorCode writeGrid_ASCII(const std::string &filePath);

/** \brief Write the sub mesh into a HDF5 file.
*
* \param filePath [in] Path of the file to write in
* \return PetscErrorCode
*/
PetscErrorCode writeSubMeshHDF5(const std::string &filePath);
PetscErrorCode writeGrid_HDF5(const std::string &filePath);

/** \brief Write index set (natural ordering) into a file.
*
* Supported formats are HDF5 and ASCII.
*
* \param filePath [in] Path of the file to write in
* \return PetscErrorCode
*/
PetscErrorCode writeIS(const std::string &filePath);

/** \brief Write index set (natural ordering) into a HDF5 file.
*
* \param filePath [in] Path of the file to write in
* \return PetscErrorCode
*/
PetscErrorCode writeIS_HDF5(const std::string &filePath);

/** \brief Write index set (natural ordering) into a HDF5 file.
*
* \param filePath [in] Path of the file to write in
* \return PetscErrorCode
*/
PetscErrorCode writeIS_ASCII(const std::string &filePath);

/** \copydoc ProbeBase::monitorVec() */
PetscErrorCode monitorVec(const DM &da,
Expand All @@ -242,15 +270,15 @@ class ProbeVolume : public ProbeBase
* \param t [in] Time
* \return PetscErrorCode
*/
PetscErrorCode writeVecASCII(const Vec &vec, const PetscReal &t);
PetscErrorCode writeVec_ASCII(const Vec &vec, const PetscReal &t);

/** \brief Output a PETSc Vec object to a HDF5 file.
*
* \param vec [in] PETSc Vec object to output
* \param t [in] Time
* \return PetscErrorCode
*/
PetscErrorCode writeVecHDF5(const Vec &vec, const PetscReal &t);
PetscErrorCode writeVec_HDF5(const Vec &vec, const PetscReal &t);

}; // ProbeVolume

Expand Down
Loading

0 comments on commit 97bc592

Please sign in to comment.