FEDEM Solver  R8.0
Source code of the dynamics solver
FFaMathString.H
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2023 SAP SE
2 //
3 // SPDX-License-Identifier: Apache-2.0
4 //
5 // This file is part of FEDEM - https://openfedem.org
7 
8 #ifndef FFA_MATH_STRING_H
9 #define FFA_MATH_STRING_H
10 
11 #include "FFaMathExpr.H"
12 
13 
14 namespace FFaMathString
15 {
16  char* CopyStr(const char* s, int i1 = 0, int i2 = 0);
17  char* SimplifyStr(char* s);
18  char* SupprSpaces(char* s);
19  char* InsStr(const char* s, int n, char c);
20  bool EqStr(const char* s1, const char* s2);
21  bool CompStr(const char* s, int n, const char* s2);
22  bool IsNumeric(const char* s);
23  int SearchCorOpenbracket(const char* s, int n);
24  int SearchCorClosebracket(const char* s, int n);
25  int SearchOperator(const char* s, FFaMathExpr::ROperator op);
26  int GetFunction(const char* s, int n, FFaMathExpr::ROperator& fn);
27  int IsVar(const char* s, int n, int nvar, FFaMathVar** ppvar);
28  int IsPi(const char* s, int n = 0);
29  int IsFunction(const char* s, int n, int nfunc, FFaMathFunction** ppfunc);
30  char* IsolateVars(char* s, int nvar, FFaMathVar** ppvar);
31  char* IsolateNumbers(char* s, int nvar, FFaMathVar** ppvar,
32  int nfunc, FFaMathFunction** ppfunc);
33 }
34 
35 #endif
ROperator
Definition: FFaMathExpr.H:28
Definition: FFaMathExpr.H:104
Definition: FFaMathVar.H:15
Definition: FFaMathString.H:15
char * IsolateVars(char *s, int nvar, FFaMathVar **ppvar)
Variables in a string is isolated with brackets.
Definition: FFaMathString.C:507
bool IsNumeric(const char *s)
Checks if a string is a number.
Definition: FFaMathString.C:122
int IsFunction(const char *s, int n, int nfunc, FFaMathFunction **ppfunc)
Searchs a string or a function f(*) for a function from a given position.
Definition: FFaMathString.C:482
int SearchCorOpenbracket(const char *s, int n)
Searchs a string, from a given position, for a corresponding bracket to '('.
Definition: FFaMathString.C:142
bool CompStr(const char *s, int n, const char *s2)
Searchs a string for another string from given position.
Definition: FFaMathString.C:96
int GetFunction(const char *s, int n, FFaMathExpr::ROperator &fn)
Searchs a string for a function from a given position.
Definition: FFaMathString.C:291
int SearchOperator(const char *s, FFaMathExpr::ROperator op)
A string is searched for a given operator.
Definition: FFaMathString.C:195
char * SupprSpaces(char *s)
All spaces in a string is removed.
Definition: FFaMathString.C:580
char * InsStr(const char *s, int n, char c)
A character is inserted into string in a given position.
Definition: FFaMathString.C:55
char * IsolateNumbers(char *s, int nvar, FFaMathVar **ppvar, int nfunc, FFaMathFunction **ppfunc)
Isolates numbers in a string or function f(*) with brackets.
Definition: FFaMathString.C:543
bool EqStr(const char *s1, const char *s2)
Equality of string one and two is checked.
Definition: FFaMathString.C:80
char * CopyStr(const char *s, int i1=0, int i2=0)
The string between to indices is returned.
Definition: FFaMathString.C:26
int IsPi(const char *s, int n=0)
Searchs a string for the constant "pi" from a given position.
Definition: FFaMathString.C:458
char * SimplifyStr(char *s)
Outer bracket of the string is removed.
Definition: FFaMathString.C:371
int IsVar(const char *s, int n, int nvar, FFaMathVar **ppvar)
Definition: FFaMathString.C:435
int SearchCorClosebracket(const char *s, int n)
Searchs a string, from a given position, for a corresponding bracket to ')'.
Definition: FFaMathString.C:168
real(dp), dimension(:,:), allocatable c
Definition: inverseModule.f90:39