Skip to content

Commit

Permalink
Restructure repository and use travis for releases (#1)
Browse files Browse the repository at this point in the history
* Add .clang-format

* Restructured the repository
- more common folder structure
- less effort compiling the tools by using SUBDIRS in qmake

* Added .travis.yml

* Update README.md

* Fix  bug in argument -t

* Fix typo in readFile

* Added CHANGELOG
  • Loading branch information
cmeessen authored Jun 16, 2020
1 parent 09365bf commit 3c6d1fc
Show file tree
Hide file tree
Showing 38 changed files with 819 additions and 642 deletions.
108 changes: 108 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
...

23 changes: 10 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
bin/*
V2RhoT/*.o
V2RhoT/Makefile
V2RhoT/V2RhoT
V2RhoT/test.out
V2RhoT/Makefile
V2T/*.o
V2T/Makefile
V2T/V2T
V2T/docs/*synctex.gz
V2T/docs/*.log
V2T/docs/*.aux
V2T/docs/*.pdf
V2T/Makefile
/V2T
/V2RhoT
*.a
*.o
Makefile
src/*/Makefile
docs/*synctex.gz
docs/*.log
docs/*.aux
docs/*.pdf
.DS_Store
.qmake.stash
*.app
Expand Down
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
language: cpp
env:
- QT_BASE=4
- QT_BASE=5
install:
- sudo apt-get update -qq
- sudo apt-get install -qq qt${QT_BASE}-default qt${QT_BASE}-qmake
script:
- qmake
- make
after_success:
- tar -zcvf bin/bin-VeloDT-prerelease-ubuntu-qt${QT_BASE}-x86_64.tar.gz bin/V2RhoT
bin/V2T
deploy:
provider: releases
api_key:
secure: ORqoxcPCHo19J3npN9/lFvwYMOuz7qifGg8G75OKIj3p3LlFdidmAHvWD1hd0Q3+zPXzNxG/CiAuwALjWFQdLIcB0vsKeeOlUII8/eGhDkaPjyW/VOdQT5XxqSevvtRdTIqJO2WAxO80TdZ6YZoz7Q9lkxSnGkpBH569pIIC2OkgcC62HGXT3jGlJ8I82fVl32uKTh2954kRRT5eXv24rYuGhp+jarc5n2io02HLOHLdz0qg3OcemFYJfbGJ7uPjQUh3lFJd6VfLX1cdkRYBFedsWST3y7i2+SnVUpIY+mr/bEGgf2xrE8OLXw4ABA8PhFloqkiHiOrkZ6Xc4Az+cmhZjOLAT04yL1HBpXrpUb8bpJVIfH5eda8ORwey/RST8JF/eqFM7pu+AXJpG9Fs6lEm/GczuTxMOcF3cTyxM3/Q96VZq3ZEVe8REuLqqyyy5J7IMifWZPH3hkWHjTYM2NsWroG45duFW+w3ts9QrLPOOwoXYgPMQ9CJJoo5lOrlfM4rOBujbXk+tn6QoyRFhne2mxIrHE4pcyfIwDz5bsi7ZxpfFa7sWaAro/DY+OGCuneNI1DtFJHGG0QzoCNVZXBTUUgeqQQf3Sp3XOF/O++yJ804+QS+fIMaAGB/fAo6l4d13zCpWqqQBjf3a5CcBve0aovSQHntid7xfW5tBNs=
file: bin/bin-VeloDT-prerelease-ubuntu-qt${QT_BASE}-x86_64.tar.gz
on:
tags: true
repo: cmeessen/VeloDT
skip_cleanup: 'true'
22 changes: 22 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [1.1.0] - 2020-06-16

### Added

- CHANGELOG
- Build binaries for Ubuntu using QT4 and QT5 and release them when a tag is
added

### Changed

- Repository structure changed, using include and src folders

### Fixed

- Fixed an bug when using argument `-t`
- Fixed an typo in `readFile()` that made it impossible to use topography or
crustal thickness maps
6 changes: 3 additions & 3 deletions Example/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
V2RhoT = ../V2RhoT/V2RhoT
V2T = ../V2T/V2T
V2RhoT = ../bin/V2RhoT
V2T = ../bin/V2T
# Plot properties
FIGURE = results.ps
ROI_T = 450/1450/-200/-50
Expand All @@ -9,7 +9,7 @@ MAPWIDTH = 6

# Targets

clean: plot
clean:
rm Vs.dat Vp.dat V2RhoT_Vs.dat V2RhoT_Vp.dat V2T_Vs.dat gmt.*

plot: convert
Expand Down
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# VeloDT
[![DOI](https://zenodo.org/badge/121383426.svg)](https://zenodo.org/badge/latestdoi/121383426)

[![DOI](https://zenodo.org/badge/121383426.svg)](https://zenodo.org/badge/latestdoi/121383426)
[![Build Status](https://travis-ci.org/cmeessen/VeloDT.svg?branch=restructure-repo)](https://travis-ci.org/cmeessen/VeloDT)

*VeloDT* contains two C++ implementations of *Vp*- and/or *Vs*-conversions to temperature and/or density valid in the upper mantle.

Expand All @@ -13,14 +14,17 @@ different approaches.
## Getting started

Either clone the github repository with
```

```bash
git clone https://github.com/cmeessen/VeloDT.git
```
or download the [latest release](https://github.com/cmeessen/VeloDT/releases/latest) as source code or binary and extract it somewhere. If you downloaded the source code, you will have to compile the code. Therefore, navigate into the folders `V2RhoT` or `V2T` which both contain a README.md with instructions on compilation and usage

- [**V2RhoT**](./V2RhoT/) closely follows [Goes et al. (2000)](https://doi.org/10.1029/1999JB900300) to convert vp or
or download the [latest release](https://github.com/cmeessen/VeloDT/releases/latest) as source code or binary and extract it somewhere. If you downloaded the source code, you will have to compile the code (see below).

- [**V2RhoT**](./V2RhoT.md) closely follows [Goes et al. (2000)](https://doi.org/10.1029/1999JB900300) to convert vp or
vs to temperature and density assuming a mineral assemblage
- [**V2T**](./V2T/) implements the method by [Priestley and McKenzie

- [**V2T**](./V2T.md) implements the method by [Priestley and McKenzie
(2006)](https://doi.org/10.1016/j.epsl.2006.01.008) and converts *Vs* to temperature

Please refer to the original publications for validity and pitfalls of the methods.
Expand All @@ -41,13 +45,15 @@ Requirements for plotting the example:

### Compiling

Both tools are compiled in the same manner. Open the directory `V2RhoT` or `V2T` in a terminal and execute in the following order
Navigate to the base folder `./VeloDT` and execute

```
```bash
qmake
make
```

This will build the `V2RhoT` and `V2T` executables and put them in the `./VeloDT` folder.

## License

VeloDT is published under the terms of [**GNU General Public License v3.0**](./LICENSE).
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions VeloDT.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
TEMPLATE = subdirs
CONFIG -= app_bundle
CONFIG += ordered
SUBDIRS += src/common src/V2RhoT src/V2T
V2RhoT.depends = common
V2T.depends = common
104 changes: 0 additions & 104 deletions common/PointClasses.h

This file was deleted.

File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
5 changes: 2 additions & 3 deletions V2RhoT/MineraldRhodT.h → include/V2RhoT/MineraldRhodT.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ This class hosts the mineral property dRho/dT
It must be calculated numerically to avoid errors far away from the reference
temperature. The values will be stored in arrays.
**/
private:
// Variables
double Tmin, Tmax;
QList <QList <double> > vals;
Expand All @@ -43,10 +42,10 @@ temperature. The values will be stored in arrays.
double Gnt);
void fill(); // Calculate dRho/dT tables

public:
public:
MineraldRhodT();
bool set_AlphaMode(int mode);
double dRhodT(double T, int mineral); // Returns dRhodT at T
double dRhodT(double T, int mineral); // Returns dRhodT at T
void exportTable();
};

Expand Down
Loading

0 comments on commit 3c6d1fc

Please sign in to comment.