GEOSX
Functions
LvArray::input Namespace Reference

Contains functions for filling array objects from strings. More...

Functions

template<typename T , int NDIM, typename PERMUTATION , typename INDEX_TYPE , template< typename > class BUFFER_TYPE>
static void stringToArray (Array< T, NDIM, PERMUTATION, INDEX_TYPE, BUFFER_TYPE > &array, std::string valueString)
 This function reads the contents of a string into an Array. More...
 

Detailed Description

Contains functions for filling array objects from strings.

Function Documentation

◆ stringToArray()

template<typename T , int NDIM, typename PERMUTATION , typename INDEX_TYPE , template< typename > class BUFFER_TYPE>
static void LvArray::input::stringToArray ( Array< T, NDIM, PERMUTATION, INDEX_TYPE, BUFFER_TYPE > &  array,
std::string  valueString 
)
static

This function reads the contents of a string into an Array.

Parameters
arrayReference to the array that will receive the contents of the input.
valueStringThe string that contains the data to read into array.

The contents of valueString are parsed and placed into array. array is resized to allow space for receiving the contents of valueString. The required notation for array values in valueString are similar to the requirements of initialization of a standard c-array:

Array<T,1> --> "{ val[0], val[1], val[2], ... }"
Array<T,2> --> "{ { val[0][0], val[0][1], val[0][2], ... },
{ val[1][0], val[1][1], val[1][2], ... }, ... } "
Note
* A null initializer is allowed via "{}". All values must be delimited with a ','. All spaces are stripped prior to processing, please don't use tabs for anything.

Definition at line 121 of file input.hpp.