Skip to content

An Emacs major mode for editing OpenFOAM data files and utility commands for OpenFOAM case directories.

License

Notifications You must be signed in to change notification settings

kvvba/openfoam.el

 
 

Repository files navigation

// Open ∇             ┆ -*- mode: ∇; coding: utf-8; -*-
//      F ield        ┆
//      O peration    ┆
//      A nd          ┆
//      M anipulation ┆

/// Commentary:

// This Emacs package provides major modes for editing OpenFOAM data
// files and C++ code.  There are also user commands for managing
// OpenFOAM case directories.

/// Code:

FoamFile
{
    version 2.0;
    format ascii;
    class dictionary;
    object README;
}

features
{
    dataFiles
    {
        majorMode yes;
        syntacticIndentation yes;
        syntaxHighlighting yes;

        // Value is either ‘polymode’ (C++ major mode), ‘string’ (string
        // constant), or ‘nil’ (data block);
        verbatimTextBlocks polymode;

        // For example, if point is at an exponent inside a dimension
        // set, the corresponding dimension will be displayed in the
        // mini-buffer.
        eldocSupport yes;
    }

    C++Code
    {
        majorMode yes;

        style #codeStream
        {
            code
            #{
                c_set_style ("OpenFOAM");
            #};
        }
    }

    userCommands
    {
        createCaseDirectory "mycase";

        applyDataFileTemplate "mycase/0/p";

        insertDataFileHeader "mycase/0/p";
    }
}

installation
#{
    Copy file ‘openfoam.el’ and ‘openfoam-autoloads.el’ into a
    directory in your Emacs load path.  Optionally byte-compile
    ‘openfoam.el’.  Then add the following code to your Emacs
    initialization file:

         (require 'openfoam-autoloads)

    See file ‘init.el’ for my personal settings.

    You may also install the Polymode package from MELPA stable.
    Polymode provides multiple major mode support for editing C++
    code in verbatim text blocks.
#};

/// README ends here

About

An Emacs major mode for editing OpenFOAM data files and utility commands for OpenFOAM case directories.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Emacs Lisp 97.0%
  • Makefile 3.0%