Coder Social home page Coder Social logo

fmesh's Introduction

fmesh

Simple mesh generation for regional FESOM2 setups.

Originally created by Sergey Kirillov.

Video with process of defining regions and looking at the result can be found under the link below:

Installation

Create new conda environment from requirements.yml by executing:

conda env create -f requirements.yml

and activate it

conda activate fmesh

Downloading necessary data

You have to download bathymetry and coastlines. This can be done by executing:

./download_data.sh

Usage

You have to configure your future mesh in the configure.yaml and then run:

python fmesh.py

in the fmesh directory.

Configuration

The process of mesh creation is split into several steps, that you can configure. In general you define the base resolution (ether constant, or increasing towards poles) and perform refinement on some regions of the basis mesh.

Define base resolution

The main step is defining your base resolution. There are two options here:

  • constant resolution (do_mercator_refinement: false)
  • resolution changing with latitude (do_mercator_refinement: true)

For the resolution changing with latitude you can define the latitude where resolution become constant ( norhtern_boundary, southern_boundary) and the value of constant resolution (norhtern_lowest_resolution, southern_lowest_resolution).

Refine resolution along coastlines

To turn it on you have to set do_refine_along_coastlines: true. You can control:

  • min_resolution resolution at the coast.
  • max_distance distance from the coast, where resolution is set back to base resolution. So the resolution will change from min_resolution at the coast to base mesh resolution at max_distance.
  • min_length minimum length of the coastline to be considered. For example if it set to 200, the island with 200 km coastline will not be considered.
  • averaging the smothing lenghth of the coastline.

Select regions with increased resolution

Regions are defined in .kml files, that contain two paths for inner region (where the resolution will be set to constant resolution value) and outer region, where resolution will be set to the base resolution. In the area between the paths resolution will be linearly changing from resolution value to base resolution.

The easiest way to create paths is to use Goole Earth, and path tool. The paths should not be closed, this will be done automatically by fmesh. Screenshot 2022-10-19 at 21 29 04

Additional parameters for each region:

  • precision each section of polygon will by splitted in precision nuber of times, to make linear interpolation more precise.
  • order If True, fist polygon is internal and second is external. I False, then other way round.

Set vertical levels

For convinience you can set vertical levels in your resulting aux3d.out file with levels parameter.

First look at the mesh

The fmesh also saves .vtk file, with resulting mesh, that can be opened in ParaView: Screenshot 2022-10-19 at 21 40 35

fmesh's People

Contributors

koldunovn avatar pgierz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.