Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
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/),
with the addition of author(s), date of change and optionally the relevant issue.
with the addition of author(s), date of change and optionally the relevant issue.

Add new entries a the bottom of the current list in the subheading. Item format:
Add new entries a the bottom of the current list in the subheading. Item format:
- Description. [Name; date; relevant github issue tag(s) and or pull requests]

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added

- Added perlin topography models for continental and oceanic plates . \[Tilman May; 2025-03-31; [#922](https://github.com/GeodynamicWorldBuilder/WorldBuilder/pull/922)\]

### Changed

### Fixed
Expand Down Expand Up @@ -74,7 +76,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Added a `--resolution-limit` option to gwb-grid to limit the resolution specified in the .grid file. \[Menno Fraters; 2024-02-16; [#653](https://github.com/GeodynamicWorldBuilder/WorldBuilder/pull/653)\]
- Added a `random` composition in the `continental plate` feature that allows the user to specify a random compositional value to a given compositional field. \[Arushi Saxena; Menno Fraters; 2024-02-26; [#651](https://github.com/GeodynamicWorldBuilder/WorldBuilder/pull/651)\]

### Changed
### Changed
- Unified the directories `cookbooks/` and `doc/sphinx/user_manual/cookbooks`. All information about cookbooks including the documentation is now bundled in the top-level `cookbooks/` directory. \[Rene Gassmoeller; 2024-02-14; [#558](github.com/GeodynamicWorldBuilder/WorldBuilder/pull/558)\]
- Deleted the deprecated Latex manual. Use the new sphinx documentation instead, which can be build into a .pdf file as well. \[Rene Gassmoeller; 2024-02-14; [#595](https://github.com/GeodynamicWorldBuilder/WorldBuilder/pull/595)\]
- Relocated the code that is used to calculate spreading center quantities like distance from the ridge, and spreading rate. Currently the spreading rate is just a constant value, but this will be changed in a follow up pull request. \[Daniel Douglas; 2024-02-14; [#590](https://github.com/GeodynamicWorldBuilder/WorldBuilder/pull/590)\]
Expand All @@ -89,7 +91,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [0.5.0]
### Added
- The World Builder Visualizer can now compress vtu files with zlib and output in binary through the vtu11 library. ASCII output is still available. \[Menno Fraters; 2021-06-26; [#282](github.com/GeodynamicWorldBuilder/WorldBuilder/pull/282)\]
- The option to use a half space cooling model for the temperature of an oceanic plate has been added to the oceanic plate feature. \[Magali Billen; 2021-07-15; [#317](github.com/GeodynamicWorldBuilder/WorldBuilder/pull/317)\]
- The option to use a half space cooling model for the temperature of an oceanic plate has been added to the oceanic plate feature. \[Magali Billen; 2021-07-15; [#317](github.com/GeodynamicWorldBuilder/WorldBuilder/pull/317)\]
- Information about the depth of the reference surface in the PointDistanceFromCurvedPlanes structure. \[Menno Fraters; 2021-07-20; [#320](github.com/GeodynamicWorldBuilder/WorldBuilder/pull/320)\]
- The option for a smooth slab temperature structure that conserves mass with distance along the slab surface. \[Magali Billen; 2021-07-28; [#323](github.com/GeodynamicWorldBuilder/WorldBuilder/pull/323)\]
- The option for a temperature model for an oceanic plate with a constant age using the plate model. \[Haoyuan Li; 2021-10-29; [#344](https://github.com/GeodynamicWorldBuilder/WorldBuilder/pull/344)\]
Expand Down Expand Up @@ -136,7 +138,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- The interface of the properties functions of features now takes a reference to the properties vector instead of creating a copy. All internal features have been changed, but all user created features will have to be adjusted as well. \[Rene Gassmoeller; 2023-05-11; [#485](github.com/GeodynamicWorldBuilder/WorldBuilder/pull/485)\]
- The World Builder can now be easily build included in another CMake project by using ADD_SUBDIRECTORY. It now uses `PROJECT_*_DIR` instead of `CMAKE_*_DIR` and if it is build by an external project, the targets will have a `wb_` prefix. \[Menno Fraters; 2023-01-27; [#492](github.com/GeodynamicWorldBuilder/WorldBuilder/pull/492)\]

### Fixed
### Fixed
- Using slabs and faults beyond the -180 to 180 range gave issues. These are now fixed and it now works and is tested for the -380 to 380 range. \[Menno Fraters; 2021-10-22; [#338](https://github.com/GeodynamicWorldBuilder/WorldBuilder/issues/338), [#340](https://github.com/GeodynamicWorldBuilder/WorldBuilder/pull/340) and [#342](https://github.com/GeodynamicWorldBuilder/WorldBuilder/pull/342)\]
- The ridge coordinates for the mass conservative slab temperature model where not converted to radians internally. \[Menno Fraters; 2021-10-27; [#352](https://github.com/GeodynamicWorldBuilder/WorldBuilder/issues/352)\]
- Fixed the taper of temperature at the slab tip for the bottom part of the slab, and fixed issue with negative temperatures above slab when there is an existing overririding plate temperature. \[Magali Billen; 2021-11-02; [#353](https:https://github.com/GeodynamicWorldBuilder/WorldBuilder/issues/353)\]
Expand All @@ -161,15 +163,15 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- A large overhoal of the distance_point_from_curved_planes function improving the accuracy in spherical coordinates. This may slightly change the results, but it should be an improvement both in accuracy and performance. Also makes available a coordinate system independent distrance function and some fast trigonometric functions. \[Menno Fraters; 2021-06-11; [#255](github.com/GeodynamicWorldBuilder/WorldBuilder/issues/255)\]

### Fixed
- Fixed namespaces, adding `WorldBuilder::` where needed. \[Timo Heister; 2020-08-10; [#205](github.com/GeodynamicWorldBuilder/WorldBuilder/issues/205)\]
- Fixed bug in linear temperature models in several features when using a top/center temperature which computes the background (-1). \[Menno Fraters; 2021-06-22; [#273](github.com/GeodynamicWorldBuilder/WorldBuilder/pull/273)\]
- Fixed namespaces, adding `WorldBuilder::` where needed. \[Timo Heister; 2020-08-10; [#205](github.com/GeodynamicWorldBuilder/WorldBuilder/issues/205)\]
- Fixed bug in linear temperature models in several features when using a top/center temperature which computes the background (-1). \[Menno Fraters; 2021-06-22; [#273](github.com/GeodynamicWorldBuilder/WorldBuilder/pull/273)\]

## [0.3.0] - 2020-06-19
### Added
- An experimental grains interface containing grain sizes and orientations has been added. [Menno Fraters;;]
### Changed
- Fortran compiler is now optional [Menno Fraters;;]
- The world builder no longer requires or uses OpenMP. It was not used in the core library, but used to speed up the Visualization program. That uses its own threads now. [Menno Fraters;;]
- The world builder no longer requires or uses OpenMP. It was not used in the core library, but used to speed up the Visualization program. That uses its own threads now. [Menno Fraters;;]
- The usage of cmake has been moderized allowing for more flexibility [Menno Fraters;;]
### Fixed
- The code has been refactored and cleaned exstinively and new compiler warnings have been enabled and fixed. [Menno Fraters;;]
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
/*
Copyright (C) 2018-2026 by the authors of the World Builder code.

This file is part of the World Builder.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#ifndef WORLD_BUILDER_FEATURES_CONTINENTAL_PLATE_MODELS_TOPOGRAPHY_PERLIN_NOISE_H
#define WORLD_BUILDER_FEATURES_CONTINENTAL_PLATE_MODELS_TOPOGRAPHY_PERLIN_NOISE_H

#include "world_builder/features/continental_plate_models/topography/interface.h"
#include "world_builder/features/feature_utilities.h"
#include "world_builder/objects/surface.h"
#include <array>
#include <cstdint>

namespace WorldBuilder
{

namespace Features
{
using namespace FeatureUtilities;
namespace ContinentalPlateModels
{
namespace Topography
{
/**
* Perlin noise based topography model for oceanic plates.
*
* This model generates topography using layered Perlin noise (octaves).
* Parameters exposed to input files are similar to the continental
* implementation: min/max depth, min/max topography, frequency,
* octaves, persistence, lacunarity and operation.
*/
class PerlinNoise final: public Interface
{
public:
/**
* Constructor
* @param world pointer to the containing World instance
*/
PerlinNoise(WorldBuilder::World *world);
/**
* Destructor
*/
~PerlinNoise() override final;

/**
* Declare parameter entries used by this model to the Parameters system.
*/
static void declare_entries(Parameters &prm, const std::string &parent_name = "");
/**
* Parse parameter values from the Parameters instance and prepare
* any internal state (e.g. permutation table shuffling).
*/
void parse_entries(Parameters &prm, const std::vector<Point<2>> &coordinates) override final;

/**
* Compute the topography at the given position. Respects depth
* ranges and combines the generated value with the input topography
* according to `operation`.
*/
double get_topography(const Point<3> &position,
const Objects::NaturalCoordinate &position_in_natural_coordinates,
double topography) const override final;

Comment on lines +47 to +78
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing doc strings for these functions

private:
// parameters
double min_depth;
Objects::Surface min_depth_surface;
double max_depth;
Objects::Surface max_depth_surface;
double min_topography;
double max_topography;
double frequency;
unsigned int octaves;
double persistence;
double lacunarity;
Operations operation;

// Perlin noise implementation details
using state_type = std::array<std::uint8_t, 256>;
state_type p;

/**
* Smoothstep function used by Perlin interpolation.
*/
double fade(double t) const;

/**
* Linear interpolation helper.
*/
double lerp(double t, double a, double b) const;

/**
* Gradient function for Perlin noise.
*/
double grad(int hash, double x, double y, double z) const;

/**
* Base Perlin noise function returning value in [-1,1].
*/
double noise(double x, double y, double z) const;

/**
* Layered (octave) Perlin noise normalized to [-1,1].
*/
double octave_noise(double x, double y, double z, unsigned int octaves_in) const;
};
} // namespace Topography
} // namespace OceanicPlateModels
} // namespace Features
} // namespace WorldBuilder

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
/*
Copyright (C) 2018-2026 by the authors of the World Builder code.

This file is part of the World Builder.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#ifndef WORLD_BUILDER_FEATURES_OCEANIC_PLATE_MODELS_TOPOGRAPHY_PERLIN_NOISE_H
#define WORLD_BUILDER_FEATURES_OCEANIC_PLATE_MODELS_TOPOGRAPHY_PERLIN_NOISE_H

#include "world_builder/features/oceanic_plate_models/topography/interface.h"
#include "world_builder/features/feature_utilities.h"
#include "world_builder/objects/surface.h"
#include <array>
#include <cstdint>

namespace WorldBuilder
{

namespace Features
{
using namespace FeatureUtilities;
namespace OceanicPlateModels
{
namespace Topography
{
/**
* Perlin noise based topography model for oceanic plates.
*
* This model generates topography using layered Perlin noise (octaves).
* Parameters exposed to input files are similar to the continental
* implementation: min/max depth, min/max topography, frequency,
* octaves, persistence, lacunarity and operation.
*/
class PerlinNoise final: public Interface
Comment on lines +40 to +47
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doc string is much better than the one you have for the continental .h file. I would copy this one and put it there too

{
public:
/**
* Constructor
* @param world pointer to the containing World instance
*/
PerlinNoise(WorldBuilder::World *world);

/**
* Destructor
*/
~PerlinNoise() override final;

/**
* Declare parameter entries used by this model to the Parameters system.
*/
static void declare_entries(Parameters &prm, const std::string &parent_name = "");
Comment on lines +50 to +64
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And you have all the function documentation here that should be copied to continental_plate as well 😄


/**
* Parse parameter values from the Parameters instance and prepare
* any internal state (e.g. permutation table shuffling).
*/
void parse_entries(Parameters &prm, const std::vector<Point<2>> &coordinates) override final;

/**
* Compute the topography at the given position. Respects depth
* ranges and combines the generated value with the input topography
* according to `operation`.
*/
double get_topography(const Point<3> &position,
const Objects::NaturalCoordinate &position_in_natural_coordinates,
double topography) const override final;

private:
// parameters
double min_depth;
Objects::Surface min_depth_surface;
double max_depth;
Objects::Surface max_depth_surface;
double min_topography;
double max_topography;
double frequency;
unsigned int octaves;
double persistence;
double lacunarity;
Operations operation;

// Perlin noise implementation details
using state_type = std::array<std::uint8_t, 256>;
state_type p;

/**
* Smoothstep function used by Perlin interpolation.
*/
double fade(double t) const;

/**
* Linear interpolation helper.
*/
double lerp(double t, double a, double b) const;

/**
* Gradient function for Perlin noise.
*/
double grad(int hash, double x, double y, double z) const;

/**
* Base Perlin noise function returning value in [-1,1].
*/
double noise(double x, double y, double z) const;

/**
* Layered (octave) Perlin noise normalized to [-1,1].
*/
double octave_noise(double x, double y, double z, unsigned int octaves_in) const;
};
} // namespace Topography
} // namespace OceanicPlateModels
} // namespace Features
} // namespace WorldBuilder

#endif
Loading
Loading