Skip to content

Commit

Permalink
Merge pull request #4 from CEED/fms-v0.2-dev
Browse files Browse the repository at this point in the history
Final changes for FMS v0.2
  • Loading branch information
v-dobrev committed Sep 10, 2021
2 parents 6b2cb5c + 52a1000 commit a66cb96
Show file tree
Hide file tree
Showing 29 changed files with 1,478 additions and 1,194 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at
# the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
# reserved. See files LICENSE and NOTICE for details.
#
# This file is part of CEED, a collection of benchmarks, miniapps, software
# libraries and APIs for efficient high-order finite element and spectral
# element discretizations for exascale applications. For more information and
# source code availability see http://github.com/ceed.
#
# The CEED research is supported by the Exascale Computing Project (17-SC-20-SC)
# a collaborative effort of two U.S. Department of Energy organizations (Office
# of Science and the National Nuclear Security Administration) responsible for
# the planning and preparation of a capable exascale ecosystem, including
# software, applications, hardware, advanced system engineering and early
# testbed platforms, in support of the nation's exascale computing imperative.

name: Build and test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

env:
BUILD_C_FLAGS: -Wall -Wextra -pedantic -Werror
BUILD_CXX_FLAGS: -Wall -Wextra -pedantic -Werror

jobs:
build-and-test:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
build-type: [Debug, Release]
name: ${{matrix.os}}-${{matrix.build-type}}

steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- name: Configure
run: |
cmake \
-B ${{github.workspace}}/build \
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
-DFMS_ENABLE_TESTS=ON \
-DCMAKE_C_FLAGS="$BUILD_C_FLAGS" \
-DCMAKE_CXX_FLAGS="$BUILD_CXX_FLAGS" \
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install \
-DCMAKE_VERBOSE_MAKEFILE=ON
- name: Build
run: |
cmake \
--build ${{github.workspace}}/build \
--config ${{matrix.build-type}}
- name: Install
run: |
cmake \
--build ${{github.workspace}}/build \
--config ${{matrix.build-type}} \
--target install
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build-type}} --output-on-failure
37 changes: 37 additions & 0 deletions .github/workflows/check-style.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at
# the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
# reserved. See files LICENSE and NOTICE for details.
#
# This file is part of CEED, a collection of benchmarks, miniapps, software
# libraries and APIs for efficient high-order finite element and spectral
# element discretizations for exascale applications. For more information and
# source code availability see http://github.com/ceed.
#
# The CEED research is supported by the Exascale Computing Project (17-SC-20-SC)
# a collaborative effort of two U.S. Department of Energy organizations (Office
# of Science and the National Nuclear Security Administration) responsible for
# the planning and preparation of a capable exascale ecosystem, including
# software, applications, hardware, advanced system engineering and early
# testbed platforms, in support of the nation's exascale computing imperative.

name: Check style

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
check-style:
runs-on: ubuntu-20.04

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Get astyle
run: sudo apt-get install astyle

- name: Check style
run: ./apply-style.sh
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ data/
*.out

# IDE directories
.vscode/
.vscode/
24 changes: 24 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
███████ ███ ███ ███████
██ ████ ████ ██
█████ ██ ████ ██ ███████
██ ██ ██ ██ ██
██ ██ ██ ███████

CEED's high-order Field and Mesh Specification


Version 0.2, released on Sep 10, 2021
=====================================

- Added support for writing and reading FmsDataCollections both in ASCII and
binary format via Conduit.

- Visualization for FMS files is available in VisIt v3.2, visit.llnl.gov.

- Added regression and code styling.


Version 0.1, released on Jul 8, 2018
====================================

- Initial release.
16 changes: 9 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
# Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at
# the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
# reserved. See files LICENSE and NOTICE for details.
#
Expand All @@ -17,8 +17,9 @@
# We use the C_STANDARD target property introduced in CMake 3.1
cmake_minimum_required (VERSION 3.1)

# Project name
project(FMS VERSION 0.1 LANGUAGES C)
# Project name and version.
# The version is also defined in the files: fms.h and Doxyfile.
project(FMS VERSION 0.2 LANGUAGES C)

# Optional demo - see examples/README.md for more information
option(FMS_ENABLE_DEMO "Enable the PUMI + MFEM demo" OFF)
Expand All @@ -37,7 +38,8 @@ endif()
# Setup thirdparty dependencies
# Optional conduit implementation for IO functions
if(CONDUIT_DIR)
find_package(Conduit 0.5.1 REQUIRED
enable_language(CXX)
find_package(Conduit 0.7.1 REQUIRED
HINTS ${CONDUIT_DIR}
NO_DEFAULT_PATH)
set(FMS_HAVE_CONDUIT TRUE)
Expand Down Expand Up @@ -67,9 +69,9 @@ if(FMS_ENABLE_DEMO)
endif()

if(PUMI_DIR)
find_package(SCOREC 2.1.0 REQUIRED
CONFIG
HINTS ${PUMI_DIR}
find_package(SCOREC 2.1.0 REQUIRED
CONFIG
HINTS ${PUMI_DIR}
NO_DEFAULT_PATH)
set(FMS_HAVE_PUMI TRUE)
message(STATUS "Demo using PUMI: ${SCOREC_DIR}")
Expand Down
4 changes: 2 additions & 2 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "FMS"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = v0.1
PROJECT_NUMBER = v0.2

# 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 Expand Up @@ -2034,7 +2034,7 @@ PERLMOD_MAKEVAR_PREFIX =
# C-preprocessor directives found in the sources and include files.
# The default value is: YES.

ENABLE_PREPROCESSING = NO
ENABLE_PREPROCESSING = YES

# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
# in the source code. If set to NO, only conditional compilation will be
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 2-Clause License

Copyright (c) 2017 Lawrence Livermore National Security, LLC.
Copyright (c) 2021 Lawrence Livermore National Security, LLC.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
# FMS: CEED's high-order Field and Mesh Specification
███████ ███ ███ ███████
██ ████ ████ ██
█████ ██ ████ ██ ███████
██ ██ ██ ██ ██
██ ██ ██ ███████

CEED's high-order Field and Mesh Specification


[![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://opensource.org/licenses/BSD-2-Clause)
[![Documentation](https://codedocs.xyz/CEED/FMS.svg)](https://codedocs.xyz/CEED/FMS/)
[![Build and Test (GH Actions)](https://github.com/CEED/FMS/actions/workflows/build-and-test.yaml/badge.svg?branch=master)](https://github.com/CEED/FMS/actions?query=workflow%3Abuild-and-test)
[![Build and Test (GH Actions)](https://github.com/CEED/FMS/actions/workflows/check-style.yaml/badge.svg?branch=master)](https://github.com/CEED/FMS/actions?query=workflow%3Acheck-style)


## High-Order Data Description

Expand All @@ -16,6 +26,9 @@ solutions and meshes, as those depicted below, as well as non-standard finite
elements, such as Nedelec and Raviart-Thomas elements. See the [FMS
documentation](doc/fms.md) for more details.

Initial support for the FMS file formats is available in
[VisIt](https://visit.llnl.gov/) version 3.2.

![High-order mesh and solution](doc/triple-pt-2x2.png)

The following diagram illustrates the current and planned components of FMS.
Expand All @@ -42,7 +55,8 @@ exchange and high-order visualization and data analysis.

## Building

You can get started with the default build configuration using the command line listed below. Checkout the [build documentation](doc/build.md) for more info.
You can get started with the default build configuration using the command line
listed below. Checkout the [build documentation](doc/build.md) for more info.

```console
mkdir build
Expand All @@ -61,7 +75,7 @@ or by leaving a comment in the [issue tracker](https://github.com/CEED/FMS/issue
The following copyright applies to each file in the CEED software suite, unless
otherwise stated in the file:

> Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at the
> Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the
> Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights reserved.
See files LICENSE and NOTICE for details.
Expand Down
72 changes: 72 additions & 0 deletions apply-style.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash

# Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at
# the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
# reserved. See files LICENSE and NOTICE for details.
#
# This file is part of CEED, a collection of benchmarks, miniapps, software
# libraries and APIs for efficient high-order finite element and spectral
# element discretizations for exascale applications. For more information and
# source code availability see http://github.com/ceed.
#
# The CEED research is supported by the Exascale Computing Project (17-SC-20-SC)
# a collaborative effort of two U.S. Department of Energy organizations (Office
# of Science and the National Nuclear Security Administration) responsible for
# the planning and preparation of a capable exascale ecosystem, including
# software, applications, hardware, advanced system engineering and early
# testbed platforms, in support of the nation's exascale computing imperative.

function main()
{
cd $(dirname "$0")
fms_astyle_file="fms.astylerc"
if [[ ! -r "${fms_astyle_file}" ]]; then
echo "FMS's astyle format file not found: '${fms_astyle_file}'. Stop."
exit 21
fi

find_astyle

local old_IFS="${IFS}"
IFS=$'\n'
format_files=($(git ls-files "*.[ch]" "*.[ch]pp"))
if [[ "$?" -ne 0 ]]; then
echo "Error getting list of C/C++ source files from Git. Stop."
exit 22
fi
IFS="${old_IFS}"

if ${astyle_bin} --options="${fms_astyle_file}" "${format_files[@]}" | \
grep "Formatted"; then
printf "\nPlease make sure the changes are committed.\n\n"
return 1
else
printf "All source files are properly formatted.\n"
fi
return 0
} # end of function 'main'

function find_astyle()
{
astyle_req_version="Artistic Style Version 3.1"
astyle_bin_list=("${ASTYLE_BIN:-astyle}" astyle-3.1)
for astyle_bin in "${astyle_bin_list[@]}"; do
if ! command -v "${astyle_bin}" > /dev/null 2>&1; then
continue
fi
astyle_version="$("${astyle_bin}" --version)"
if [[ "${astyle_version}" != "${astyle_req_version}" ]]; then
continue
fi
return 0
done
echo "Required astyle version not found: '${astyle_req_version}'."
printf "Astyle commands tried:"
printf " '%s'" "${astyle_bin_list[@]}"
printf ".\n"
exit 23
} # end of function 'find_astyle'


# Invoke the 'main' function
main "$@"
2 changes: 1 addition & 1 deletion doc/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ cd build
cmake -DFMS_DIR=*fms/install/prefix* ..
make
./main
```
```
Binary file modified doc/components.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020, Lawrence Livermore National Security, LLC. Produced at
# Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at
# the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
# reserved. See files LICENSE and NOTICE for details.
#
Expand Down
2 changes: 1 addition & 1 deletion examples/demo_pumi_mfem/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020, Lawrence Livermore National Security, LLC. Produced at
# Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at
# the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
# reserved. See files LICENSE and NOTICE for details.
#
Expand Down
6 changes: 3 additions & 3 deletions examples/demo_pumi_mfem/demo_pumi_mfem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ int main(int argc, char *argv[]) {
}

// Edges
FmsInt nvtxs = 2;
const FmsInt nvtxs = 2;
FmsInt num_edges = 0;
int edge[nvtxs];
itr = pumi_mesh->begin(1);
Expand Down Expand Up @@ -157,7 +157,7 @@ int main(int argc, char *argv[]) {
pumi_mesh->end(itr);

// Define Face based on edge Id's
FmsInt nedges = 3;
const FmsInt nedges = 3;
int face[nedges];
int num_triangles = 0;
itr = pumi_mesh->begin(2);
Expand Down Expand Up @@ -191,7 +191,7 @@ int main(int argc, char *argv[]) {
pumi_mesh->end(itr);

// Define Elem based on face Id's
FmsInt nfaces = 4;
const FmsInt nfaces = 4;
FmsEntityReordering EntReord;
int tetOrd[4] = {0,1,3,2}; // PUMI order for tet element faces
EntReord[FMS_TETRAHEDRON] = &tetOrd[0];
Expand Down
2 changes: 1 addition & 1 deletion examples/include-fms/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ int main(int, char**) {
auto a = FmsMeshConstruct(&m);
printf("Hello %d\n", a);
return a;
}
}
Loading

0 comments on commit a66cb96

Please sign in to comment.