inp

package module
v0.0.0-...-18b9002 Latest Latest
Warning

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

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

README

inp fileformat parser

That library created for convert finite element file in format INP to format STD.

Typically using case:

  1. Creating mesh model in GMSH

  2. Saving into mesh format INP.

    Example: gmsh -2 -format inp cone.geo

  3. Use that software for convert into STD format

  4. Enjoy!!

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func CcxCpu

func CcxCpu(cpu int)

func DefaultCcx

func DefaultCcx()

Types

type BeamSection

type BeamSection struct {
	Section  string
	Elset    string
	Material string

	Offset1, Offset2 float64

	Thks   [2]float64
	Vector [3]float64
}

func (BeamSection) String

func (b BeamSection) String() string

type Boundary

type Boundary struct {
	LoadLocation string
	Start        int
	Finish       int
	Factor       float64
}

Boundary for structures: – 1: translation in the local x-direction – 2: translation in the local y-direction – 3: translation in the local z-direction – 4: rotation about the local x-axis (only for nodes belonging to beams or shells) – 5: rotation about the local y-axis (only for nodes belonging to beams or shells) – 6: rotation about the local z-axis (only for nodes belonging to beams or shells) – 11: temperature

First line:

*BOUNDARY
Enter any needed parameters and their value.

Following line:

Node number or node set label
First degree of freedom constrained
Last degree of freedom constrained. This field may be left blank if only one degree of freedom is constrained.

type Cload

type Cload struct {
	Position  string
	Direction int
	Value     float64
}

func (Cload) String

func (load Cload) String() string

type Condition

type Condition struct {
	Type            string
	NodeSet         string
	TemperatureNode float64
}

func (Condition) String

func (c Condition) String() string

type Dat

type Dat struct {
	BucklingFactors    []float64
	Temperatures       []Single
	Displacements      []Record
	EigenDisplacements [][]Record
	Stresses           []Stress
	Forces             []Record
	TotalForces        []Record
	EqPlasticStrain    []Pe
}

func ParseDat

func ParseDat(content []byte) (dat *Dat, err error)

func (Dat) MaxTime

func (d Dat) MaxTime() (mt float64)

type DistributingCoupling

type DistributingCoupling struct {
	ElsetName     string
	ElsetNode     int
	NodeIndexes   []int // with weight 1.0
	NodeNames     []string
	ReferenceNode int
}

First line:

*DISTRIBUTING COUPLING
Enter the ELSET parameter and its value

Following line:

Node number or node set
Weight

Repeat this line if needed.

func (DistributingCoupling) String

func (d DistributingCoupling) String() string

type Dload

type Dload struct {
	Values []string
}

func (Dload) String

func (load Dload) String() string

type Element

type Element struct {
	Type  string
	Elset string
	Index int
	Nodes []int
}

Element - indexes in inp format

type Expansion

type Expansion struct {
	Value       float64 // Expansion
	Temperature float64 // Temperature
}

type File

type File struct {
	Options []string
}

type Material

type Material struct {
	Name       string
	Density    float64
	Expansions []Expansion
	Properties []Property
	Plastic    struct {
		Hardening string
		Data      [10]struct {
			StressVonMises float64
			PlasticStrain  float64
			Temperature    float64
		}
	}
}

func (Material) String

func (m Material) String() string

type Model

type Model struct {
	Heading           string
	Nodes             []Node
	Elements          []Element
	Nsets             []Set
	Elsets            []Set
	Surfaces          []Surface
	Materials         []Material
	InitialConditions Condition
	BeamSections      []BeamSection
	SolidSections     []SolidSection
	ShellSections     []ShellSection
	Boundaries        []Boundary
	Springs           []Spring
	Steps             []Step
	TimePoint         struct {
		Name     string
		Generate bool
		Time     []float64
	}
	RigidBodies           []RigidBody
	DistributingCouplings []DistributingCoupling
}

Model - summary inp format

func Parse

func Parse(content []byte) (f *Model, err error)

func (Model) String

func (f Model) String() string

type Node

type Node struct {
	Nodeset string // NSET
	Index   int
	Coord   [3]float64
}

Node - coordinate in inp format

type Pe

type Pe struct {
	Name     string
	Time     float64
	Elem     int
	IntegPnt int
	Value    float64
}

type Print

type Print struct {
	SetName        string
	Frequency      string
	Output         string
	TimePoints     string
	TotalOnly      bool
	ContactElement bool
	Global         bool
	Options        []string
}

type Property

type Property struct {
	E           float64 // Young`s modudlus
	V           float64 // Poisson`s ratio
	Temperature float64 // Temperature
}

type Record

type Record struct {
	Name string
	Time float64
	Node int

	// (vx,vy,vz)
	// (fx,fy,fz)
	Values [3]float64
}

type RigidBody

type RigidBody struct {
	Nset    string
	RefNode int
	RotNode int
}

First and only line:

*RIGID BODY
Enter any needed parameters and their values

func (RigidBody) String

func (r RigidBody) String() string

type Set

type Set struct {
	Name     string
	Generate bool
	Addition []string
	Indexes  []int
	Names    []string
}

func (Set) String

func (s Set) String(name string) string

type ShellSection

type ShellSection struct {
	Elset          string
	Offset         float64
	Composite      bool
	NodalThickness bool
	Property       [12]struct {
		Thickness float64
		Material  string
	}
}

func (ShellSection) String

func (ss ShellSection) String() string

type Single

type Single struct {
	Name  string
	Time  float64
	Node  int
	Value float64
}

type SolidSection

type SolidSection struct {
	Elset    string
	Material string
}

*SOLID SECTION,ELSET=EALL,MATERIAL=HY

func (SolidSection) String

func (ss SolidSection) String() string

type Spring

type Spring struct {
	ElsetName      string
	Freedom        [2]int
	SpringConstant float64
}

Spring

First line: *SPRING Enter the parameter ELSET and its value and any optional parameter, if needed.

Second line for SPRINGA type elements: enter a blank line Second line for SPRING1 or SPRING2 type elements: • first degree of freedom (integer, for SPRING1 and SPRING2 elements) • second degree of freedom (integer, only for SPRING2 elements) Following line if the parameter NONLINEAR is not used: • Spring constant (real number).

func (Spring) String

func (s Spring) String() string

type Step

type Step struct {
	IsStatic bool
	Static   struct {
		TimeInc    float64
		TimePeriod float64
	}

	Nlgeom bool // genuine nonlinear geometric calculation
	Inc    int  // The maximum number of increments in the step (for automatic

	Boundaries []Boundary

	Buckle struct {
		Number   int     // Number of buckling factors desired (usually 1)
		Accuracy float64 // Accuracy desired (default: 0.01).
	}
	NodeFiles    []Print
	ElFiles      []Print
	NodePrints   []Print
	ElPrints     []Print
	Cloads       []Cload
	Dloads       []Dload
	Temperatures []Temperature
}

func (Step) String

func (s Step) String() string

type Stress

type Stress struct {
	Name       string
	Time       float64
	Node       int
	IntegPnt   int
	Values     [6]float64 // (elem, integ.pnt.,sxx,syy,szz,sxy,sxz,syz)
	SecondName string
}

func (Stress) StressIV

func (s Stress) StressIV() float64

type Surface

type Surface struct {
	Name          string
	IsElementType bool
	List          [][2]string
}

func (Surface) String

func (s Surface) String() string

type Temperature

type Temperature struct {
	Parameters      []string
	NodeSet         string
	TemperatureNode float64
	Gradient2       float64
	Gradient1       float64
}

func (Temperature) String

func (t Temperature) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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