Coder Social home page Coder Social logo

geomtk's Introduction

Introduction

This toolkit (Geofluid Modeling Toolkit) is used to assist the development of my Lagrangian dynamics program, but it may be useful for other projects.

The following items are enclosed:

  • SpaceCoord class hierarchy;
  • Domain class hierarchy;
  • Mesh class hierarchy;
  • Field class hierarchy;
  • Regrid class hierarchy;

The Lagrangian advection scheme that I am developing should be able to be applied to models with different mesh systems. The above Mesh, Field and Regrid class hierarchies are designed for this purpose by hiding the mesh details from the scheme, so the switching among models will be easy and the core of the scheme will not be changed.

Basic usage

#include "geomtk.h"

// Choose the specific classes for use.
typedef geomtk::SphereDomain Domain;
typedef geomtk::RLLMesh Mesh;
typedef geomtk::RLLField<double, 2> Field;
typedef geomtk::TimeManager TimeManager;
typedef geomtk::TimeLevelIndex<2> TimeLevelIndex;
typedef geomtk::IOManager<geomtk::RLLDataFile> IOManager;
typedef geomtk::ConfigManager ConfigManager;

int CENTER = geomtk::RLLStagger::Location::CENTER;
...

Domain sphere(3);
Mesh mesh(sphere);
Field q(); // Field with two time levels.
TimeLevelIndex timeIdx; // Time level index.

sphere.setRadius(6371.299e3);

// Initialize the regular lat-lon mesh.
mesh.init(128, 64);

// zonal virtual grids are added, which is apparent to user
q.create("q", "kg m-3", "moisture density", mesh, CENTER, sphere.getNumDim());

for (int k = mesh.ks(FULL); k <= mesh.ke(FULL); ++k) {
	for (int j = mesh.js(FULL); j <= mesh.je(FULL); ++j) {
		for (int i = mesh.is(FULL); i <= mesh.ie(FULL); ++i) {
			q(timeIdx, i, j, k) = ...;
		}
	}
}

// Shift time level index.
timeIdx.shift();

...

Author

geomtk's People

Contributors

dongli 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.