Chaste Commit::1fd4e48e3990e67db148bc1bc4cf6991a0049d0c
FibreWriter< DIM > Class Template Reference

#include <FibreWriter.hpp>

+ Collaboration diagram for FibreWriter< DIM >:

Public Member Functions

 FibreWriter (const std::string &rDirectory, const std::string &rBaseName, const bool clearOutputDir=true)
 
 ~FibreWriter ()
 
void WriteAllAxi (const std::vector< c_vector< double, DIM > > &fibres)
 
void WriteAllOrtho (const std::vector< c_vector< double, DIM > > &fibres, const std::vector< c_vector< double, DIM > > &second, const std::vector< c_vector< double, DIM > > &third)
 
void SetWriteFileAsBinary ()
 

Private Member Functions

out_stream OpenFileAndWriteHeader (const std::string &rFileName, unsigned numItems)
 

Private Attributes

OutputFileHandlermpOutputFileHandler
 
std::string mBaseName
 
bool mFileIsBinary
 

Detailed Description

template<unsigned DIM>
class FibreWriter< DIM >

A class for writing .axi files (files which define the fibre direction for each element) and .ortho files (files which define the fibre, sheet and normal directions for each element.

Definition at line 53 of file FibreWriter.hpp.

Constructor & Destructor Documentation

◆ FibreWriter()

template<unsigned DIM>
FibreWriter< DIM >::FibreWriter ( const std::string &  rDirectory,
const std::string &  rBaseName,
const bool  clearOutputDir = true 
)

Create a new FibreWriter.

Parameters
rDirectorythe directory in which to write the fibre to file
rBaseNamethe base name of the files in which to write the fibre data
clearOutputDirwhether to clean the directory (defaults to true)

Definition at line 40 of file FibreWriter.cpp.

References FibreWriter< DIM >::mpOutputFileHandler.

◆ ~FibreWriter()

template<unsigned DIM>
FibreWriter< DIM >::~FibreWriter ( )

Destructor

Definition at line 50 of file FibreWriter.cpp.

Member Function Documentation

◆ OpenFileAndWriteHeader()

template<unsigned DIM>
out_stream FibreWriter< DIM >::OpenFileAndWriteHeader ( const std::string &  rFileName,
unsigned  numItems 
)
private

Open a fibre file for writing and write the header line.

Parameters
rFileNameThe path and name of the file to create
numItemsThe number of items (~ number of elements)
Returns
an outstream pointer to the open file.

Definition at line 124 of file FibreWriter.cpp.

◆ SetWriteFileAsBinary()

template<unsigned DIM>
void FibreWriter< DIM >::SetWriteFileAsBinary ( )

Switch to write binary fibre file

(set to write ascii files in the constructor)

Definition at line 143 of file FibreWriter.cpp.

Referenced by FibreConverter::Convert().

◆ WriteAllAxi()

template<unsigned DIM>
void FibreWriter< DIM >::WriteAllAxi ( const std::vector< c_vector< double, DIM > > &  fibres)

Writes all axisymmetric vectors to the file.

Parameters
fibresa vector of fibre direction vectors

Definition at line 56 of file FibreWriter.cpp.

References ChasteBuildInfo::GetProvenanceString().

Referenced by FibreConverter::Convert().

◆ WriteAllOrtho()

template<unsigned DIM>
void FibreWriter< DIM >::WriteAllOrtho ( const std::vector< c_vector< double, DIM > > &  fibres,
const std::vector< c_vector< double, DIM > > &  second,
const std::vector< c_vector< double, DIM > > &  third 
)

Writes all orthonormal tensors to the file.

Parameters
fibresa vector of longitudial fibre direction vectors
seconda vector of transverse vectors (orthogonal to fibres)
thirda vector of normal vectors (orthogonal to others)

Definition at line 82 of file FibreWriter.cpp.

References ChasteBuildInfo::GetProvenanceString().

Referenced by FibreConverter::Convert().

Member Data Documentation

◆ mBaseName

template<unsigned DIM>
std::string FibreWriter< DIM >::mBaseName
private

Base name for the input files

Definition at line 58 of file FibreWriter.hpp.

◆ mFileIsBinary

template<unsigned DIM>
bool FibreWriter< DIM >::mFileIsBinary
private

Whether all data is to be written as binary

Definition at line 59 of file FibreWriter.hpp.

◆ mpOutputFileHandler

template<unsigned DIM>
OutputFileHandler* FibreWriter< DIM >::mpOutputFileHandler
private

Output file handler

Definition at line 56 of file FibreWriter.hpp.

Referenced by FibreWriter< DIM >::FibreWriter().


The documentation for this class was generated from the following files: