Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A Fortran library for reference counted object and container classes.

License

NotificationsYou must be signed in to change notification settings

trixi-framework/FTObjectLibrary

Repository files navigation

Build StatusCoverallsCodecovLicense: MIT

FTObjectLibrary provides a collection of reference counted Fortran 2003 classesto facilitate writing generic object oriented Fortran programs. Referencecounting is implemented to assist with memory management so that the lifespansof objects are properly maintained and are so that objects are deleted onlywhen no other references are made to them.

The library includes three categories of classes:

  • Value classes
  • Container classes
  • Error reporting and testing classes

Value classes include the base class, FTObject and at the current time, a subclass, FTValue.

  • FTObject is the base class that implements the reference counting mechanism and other functions that should be overridden in subclasses. It the base class for all classes in the FTObjectLibrary library. You will usually not allocate objects of this class. Instead you will create your own subclasses of it that have data and procedures as needed.
  • FTValue is a wrapper class that allows storage of real, integer, character and logical values, which can then be stored in containers.

Container classes let you store any subclass of the base class FTObject in them. This makes it easy to store, for instance, a linked list of linked lists, or an array of dictionaries.

Included in the library are the following standard container classes:

  • FTStack is a subclass of FTLinkedList that adds the usual push, pop, and peek routines.
  • FTSparseMatrix associates a double index (i,j) to an FTObject. Basically this is a two dimensional sparse matrix of pointers to FTObjects.
  • FTMultiIndexTable associates an integer array keys(:) to an FTObject. Basically this is an m--dimensional sparse matrix of pointers to FTObjects.
  • FTDictionary is an ``associative container'', that associates a string to another FTObject.
  • FTValueDictionary is a subclass of FTDictionary that has additional methods to store and retrievevalues.
  • FTMutableObjectArray is a mutable one-dimensional array class that can store any FTObject
  • FTStringSet is different as it encapsulates set operations like set membership, union, intersection, difference, but only for strings. Although other objects cannot be added to string sets, StringSets can be added to other containers

The library also contains classes for testing (FTAssertions, TestSuiteManagerClass) and for reporting errors through the FTException class.

News

New about changes can be foundhere.

Documentation

Documentation can be found in theuser's guide.

Examples

Examples can be found in theExamples directory and in theTesting directory. The examples include a simple reverse Polish calculator using a stack, and another showing the use of a linked list. The testing directory includes tests that can be run on the library, which themselves serve as examples of the use of all of the classes.

Building the Library

The library (.a) can be built with either CMake or default make.

Spack

You can install FTObjectLibrary using theSpack package manager.To install the FTObjectLibrary with Spack,

git clone https://github.com/spack/spack.git ~/spacksource ~/spack/share/spack/setup-env.shspack install ftobjectlibrary@main

Once installed, FTObjectLibrary can be added to your environment using

spack load ftobjectlibrary

CMake

To install the FTObjectLibrary with CMake,

mkdir build && cd buildcmake -DCMAKE_INSTALL_PREFIX=/path/to/install ../makemake install

make

cd to the directory "makeLibrary" and type

make

That will create the necessary files in that directory, which can be moved to somewhere else as desired.

Updating Spack Packages

When new releases of FTObjectLibrary are made, you can contribute the new release to the spack packages.Before making an update to the Spack package, you should familiarize yourself withthe Spack packaging guide

To add a new FTObjectLibrary release to Spack,

  1. Fork the Spack repository on GitHub.

  2. Install and initialize spack on your local system from your fork

git clone https://github.com/YOUR GITHUB ACCOUNT/spack.git ~/spacksource ~/spack/share/spack/setup-env.sh
  1. Open the FTObjectLibrary package for editing
spack edit ftobjectlibrary
  1. Add a newversion metadata item to the ftobjectlibrary package. The first argument is the version name as it will appear in the spack package manager. Use thetag argument to specify the name of the tag as it appears in the FTObjectLibrary repository. As an example, a new version line forv1.0.1 is shown below.
    version('v1.0.1', tag='v1.0.1')
  1. (Optional) If you would like to be noted as a maintainer, add your github handle to the maintainers list. Maintainers will be notified if Spack users experience issues installing FTObjectLibrary and when modifications are being made to the FTObjectLibrary package in Spack.
    maintainers = ['schoonovernumerics','your-github-handle']
  1. When you are finished editing, save the package file. You can verify the new version is registered in your local repository by obtaining aspec for FTObjectLibrary at the new version you've added.
spack spec ftobjectlibrary@v1.0.1
  1. Test to make sure the installation works
spack install ftobjectlibrary@v1.0.1
  1. Run thespack style command to ensure that you are meeting Spack's style requirements.

  2. When ready, commit your changes and push them to your Github repository.

  3. Open a Pull Request againstgithub.com/spack/spack to merge your changes with thespack/spack/develop branch.

Authors

FTObjectLibrary was initiated byDavid A. Kopriva, who is also the principal developer.The full list of contributors can be found inAUTHORS.md.

License and contributing

FTObjectLibrary is licensed under the MIT license (seeLICENSE.md).

About

A Fortran library for reference counted object and container classes.

Resources

License

Security policy

Stars

Watchers

Forks

Contributors6

Languages


[8]ページ先頭

©2009-2025 Movatter.jp