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
11 changes: 11 additions & 0 deletions .github/workflows/build-and-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,20 @@ jobs:

# Step: Upload artifacts
- name: Upload artifacts
id: upload_artifacts
uses: actions/upload-artifact@v7
if: always()
continue-on-error: true
with:
name: meshkernel-${{ inputs.platform }}-${{ inputs.build_type }}
path: ${{ steps.paths.outputs.install_dir }}
if-no-files-found: error

- name: Retry upload artifacts on transient failure
uses: actions/upload-artifact@v7
if: always() && steps.upload_artifacts.outcome == 'failure'
with:
name: meshkernel-${{ inputs.platform }}-${{ inputs.build_type }}
path: ${{ steps.paths.outputs.install_dir }}
if-no-files-found: error
overwrite: true
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#pragma once

#include <MeshKernel/Cartesian3DPoint.hpp>
#include <MeshKernel/Entities.hpp>
#include <MeshKernel/Parameters.hpp>
#include <MeshKernel/Utilities/LinearAlgebra.hpp>
Expand Down Expand Up @@ -90,7 +91,19 @@ namespace meshkernel
const double upperRightX,
const double upperRightY) const;

std::unique_ptr<CurvilinearGrid> Compute(const double originX,
const double originY,
const double blockSizeX,
const double blockSizeY,
const double upperRightX,
const double upperRightY,
const double angle) const;

private:
Point RotateByAngle(const double originX, const double originY,
const double upperRightX, const double upperRightY,
const double cosAngle, const double sinAngle) const;

/// @brief Compute a rectangular curvilinear grid on cartesian coordinates.
/// @param[in] numColumns The number of columns in x direction
/// @param[in] numRows The number of columns in y direction
Expand Down Expand Up @@ -120,13 +133,44 @@ namespace meshkernel
/// @param[in] blockSizeX The grid block size in x dimension
/// @param[in] blockSizeY The grid block size in y dimension
/// @returns[in] The coordinates of the grid point
static lin_alg::Matrix<Point> ComputeSpherical(const int numColumns,
lin_alg::Matrix<Point> ComputeSpherical(const int numColumns,
const int numRows,
const double originX,
const double originY,
const double angle,
const double blockSizeX,
const double blockSizeY) const;

// Preserves Orthogonality: Standard flat 2D rotations introduce a slight
// shearing skew over a curved globe because degrees of longitude shrink
// away from the equator. Rodrigues' 3D rotation preserves the exact
// geometry of your initial unrotated grid matrix relative to the surface
// plane.
lin_alg::Matrix<Point> ComputeSphericalOnExtension(const int numColumns,
const int numRows,
const double originX,
const double originY,
const double angle,
const double blockSizeX,
const double blockSizeY) const;

// Not really RGF grid algorithm, there seems to be a step missing
lin_alg::Matrix<Point> ComputeSphericalRgfGrid(const int numColumns,
const int numRows,
const double originX,
const double originY,
const double angle,
const double blockSizeX,
const double blockSizeY);
const double blockSizeY) const;

// Generate the rotated grid using fixed delta-x and delta-y when generating
lin_alg::Matrix<Point> ComputeSphericalFixedDelta(const int numColumns,
const int numRows,
const double originX,
const double originY,
const double angle,
const double blockSizeX,
const double blockSizeY) const;

/// @brief Compute the adjusted latitude for keeping an aspect ratio of 1, considering the spherical coordinates
/// @param[in] blockSize The grid block size in y dimension
Expand Down
6 changes: 6 additions & 0 deletions libs/MeshKernel/include/MeshKernel/Utilities/Utilities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <string>
#include <vector>

#include "MeshKernel/Cartesian3DPoint.hpp"
#include "MeshKernel/Entities.hpp"
#include "MeshKernel/Mesh2D.hpp"
#include "MeshKernel/Point.hpp"
Expand All @@ -43,6 +44,11 @@ namespace meshkernel
/// Only nodes and node connectivity need be printed to visualise the graph.
void Print(const std::vector<Point>& nodes, const std::vector<Edge>& edges, std::ostream& out = std::cout);

/// @brief Print the (simplified) graph in a form that can be loaded into matlab/octave.
///
/// Only nodes and node connectivity need be printed to visualise the graph.
void Print(const std::vector<Cartesian3DPoint>& nodes, const std::vector<Edge>& edges, std::ostream& out = std::cout);

/// @brief Print the (simplified) graph in a form that can be loaded into matlab/octave.
///
/// Only nodes and node connectivity need be printed to visualise the graph.
Expand Down
Loading
Loading