msh

package module
v0.0.0-...-5e8d56f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 13 Imported by: 1

README

msh

golang interface of gmsh

Documentation

Overview

The MSH file format version 2:

https://gmsh.info/doc/texinfo/gmsh.html#MSH-file-format-version-2-_0028Legacy_0029

$MeshFormat
version-number file-type data-size
$EndMeshFormat

$PhysicalNames
number-of-names
physical-dimension physical-tag "physical-name"
…
$EndPhysicalNames

$Nodes
number-of-nodes
node-number x-coord y-coord z-coord
…
$EndNodes

$Elements
number-of-elements
elm-number elm-type number-of-tags < tag > … node-number-list
…
$EndElements

Index

Constants

View Source
const (
	Point       ElementType = 15
	Line                    = 1
	Triangle                = 2
	Quadrangle              = 3
	Tetrahedron             = 4
)

Variables

View Source
var GmshApp = flag.String("gmsh", "", "Example:\n`gmsh` for Linux\n`gmsh.exe` for Windows")

Functions

func DefaultGmsh

func DefaultGmsh()

func Generate

func Generate(geoContent string) (mshContent string, err error)

Types

type Element

type Element struct {
	Id     int
	EType  ElementType
	Tags   []int
	NodeId []int
}

type ElementType

type ElementType int

type Msh

type Msh struct {
	PhysicalNames []PhysicalName
	Nodes         []Node
	Elements      []Element
}

func New

func New(geoContent string) (m *Msh, err error)

func Parse

func Parse(meshContent string) (msh *Msh, err error)

func (*Msh) AddMsh

func (msh *Msh) AddMsh(source Msh) (err error)

AddMesh add mesh

func (Msh) Clone

func (src Msh) Clone() Msh

func (Msh) GetNode

func (msh Msh) GetNode(Id int) (index int)

func (*Msh) Index1

func (msh *Msh) Index1() (err error)

func (*Msh) MaxElementIndex

func (msh *Msh) MaxElementIndex() int

func (*Msh) MaxNodeIndex

func (msh *Msh) MaxNodeIndex() int

func (*Msh) MergeNodes

func (msh *Msh) MergeNodes(minDistance float64)

func (*Msh) RemoveElements

func (msh *Msh) RemoveElements(ets ...ElementType)

func (*Msh) Sort

func (msh *Msh) Sort(ets ...ElementType)

func (Msh) String

func (msh Msh) String() string

type Node

type Node struct {
	Id    int
	Coord gog.Point3d
}

type PhysicalName

type PhysicalName struct {
	Dimension int
	Tag       int
	Name      string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL