-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeneralFunctions.h
55 lines (46 loc) · 1.41 KB
/
generalFunctions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef GENERALFUNCTIONS_H
#define GENERALFUNCTIONS_H
//#include "wx/process.h"
#include <iostream>
#include <fstream>
#include <sstream>
//#include "CMesh.h"
//#include "CResults.h"
//#include "DSimpleMessage.h"
#include "params.h"
#include "typenames.h"
// general type conversions
int str2Int(const string& number);
double str2Dbl(const string& number);
string int2Str(const int& number);
string dbl2Str(const double& number);
// string operations
string convert2UpperCase (const string& inputString);
string change2SingleSpace (const string& inputString);
string removeLeadingSpaces(const string& inputString);
vecStr splitString(
const string& inputString,
const char& splitter);
string replaceStringSegment(
const string& inputString,
const string& oldSegment,
const string& newSegment);
// file operations
bool fileExists(const string& filename);
int deleteFile(const string& filename);
bool getLine(
ifstream& inputFile,
string& line);
// IDW - Inverse Distance Weighting Method operations
int weightFactors(
vecVecDbl& nodeWeights,
const vecVecUInt& elementNodes,
const vecVecDbl& nodeCoords,
const vecVecDbl& elemCenterCoords);
int weightAverage(
vecDbl& nodeField,
const vecVecDbl& weights,
const vecVecUInt& elementNodes,
const vecDbl& elemField);
double elementSurface(vecVecDbl& coords);
#endif