Misc

InitCSX

InitCSX()

Full definition:

function CSX = InitCSX()

Inititalize the CSX data-structure.

variable arguments:

  • ‘CoordSystem’ : define the default coordinate system

    • 0 -> Cartesian

    • 1 -> Cylindircal

    • 2 -> Sphercial (not yet implemented)

example:

CSX = InitCSX(); %for a default cartesian mesh

or

CSX = InitCSX('CoordSystem','1'); % for a cylindrical mesh definition

See also DefineRectGrid, SmoothMeshLines, SmoothMeshLines2, SetBackgroundMaterial


author: Thorsten Liebig

AddPropAttribute

AddPropAttribute(CSX, name, att_name, att_value)

Full definition:

CSX = AddPropAttribute(CSX, name, att_name, att_value)

Add a given attribute (name and value) to the given property


author: Thorsten Liebig (c) 2013

CSXGeomPlot

CSXGeomPlot(CSX_filename<, args_string>)

Full definition:

function CSXGeomPlot(CSX_filename<, args_string>)

Show the geometry stored in the CSX file using AppCSXCAD

Optional AppCSXCAD arguments (args_string):

  • ‘–RenderDiscMaterial’, enable material rendering

exports:

  • ‘–export-polydata-vtk=’

  • ‘–export-STL=’

See also InitCSX, DefineRectGrid


author: Thorsten Liebig

WriteCSX

WriteCSX(filename, CSX)

Full definition:

function WriteCSX(filename, CSX)

Write a CSX structure to an XML file.

This is a convenience wrapper around struct_2_xml for writing CSXCAD structures created with InitCSX and the Add*/Define* functions.

arguments: filename – output file name, e.g. ‘my_structure.xml’ CSX – CSXCAD structure as returned by InitCSX

example:

CSX = InitCSX();
CSX = AddMetal(CSX, 'copper');
CSX = AddBox(CSX, 'copper', 10, [-1 -1 -1], [1 1 1]);
WriteCSX('my_structure.xml', CSX);

See also InitCSX, DefineRectGrid, AddMetal, AddMaterial


author: Thorsten Liebig

struct_2_xml

struct_2_xml(filename, xml_struct, rootName)

Full definition:

function struct_2_xml(filename, xml_struct, rootName)

Write a Matlab/Octave structure to an XML file.

This is the low-level XML writer behind the CSXCAD structure files. Field names become element names, and a field named ATTRIBUTE becomes the attributes of its element. To write a CSXCAD structure, use WriteCSX, which wraps this function.

arguments: filename – output file name, e.g. ‘my_structure.xml’ xml_struct – structure to write rootName – name of the XML root element

example:

CSX = InitCSX();
CSX = AddMetal(CSX, 'copper');
struct_2_xml('my_structure.xml', CSX, 'ContinuousStructure');

See also WriteCSX, InitCSX


author: Thorsten Liebig

DirChar2Int

DirChar2Int(dir_char)

Full definition:

function n = DirChar2Int(dir_char)

internal function to convert a character like ‘x’,’y’,’z’ into a numeric direction: 0..2! If input already is a numeric value from 0..2, it will just be copied! Everything else will raise an error!


author: Thorsten Liebig (c) 2013

isOctave

isOctave()

Full definition:

[isOct,version] = isOctave()

Function to test if matlab or octave is used.

Output:

  • isOct: bool; true, if interpreter is Octave

  • version: struct

    • .major: number; major version

    • .minor: number; minor version

    • .release: number; release version

example (Octave 3.6.1):

isOct = true
version.major = 3
version.minor = 6
version.release = 1

example (Matlab 7.8.0.347 (R2009a)):

isOct = false
version.major = 7
version.minor = 8
version.release = 0

(C) 2011 Thorsten Liebig thorsten.leibig@gmx.de (C) 2012 Sebastian Held sebastian.held@gmx.de

searchBinary

searchBinary(name, searchpath<, err_fail>)

Full definition:

[binary_location] = searchBinary(name, searchpath<, err_fail>)

Function to search for executable. If the executable isn’t found in searchpath, look in environment search path.

parameter:

  • name: name of the binary to search

  • searchpath: (list of) search paths

  • err_fail: 0/1, throw an error if binary is not found (default is 1)

Output:

  • binary_location:

    • if found in searchpath: full path of binary

    • if found in environment search path: name of binary

    • if not found: empty string


(C) 2013 Stefan Mahr dac922@gmx.de