60 "Creates curved edge information using a function y=f(x) (2D only).");
68 "Expression of the curve: y = f(x).");
70 "Pts file containing coordinates (x,y).");
72 "Number of iterations to perform to obtain evenly distribution of points.");
74 "Relaxation parameter.");
113 int niter =
m_config[
"niter"].as<
int>();
116 edge->m_edgeNodes.resize(nq - 2);
119 if (
m_config[
"function"].as<string>().compare(
"NotSet") != 0)
122 "Function and file cannot be defined at the same time.");
124 std::string fstr =
m_config[
"function"].as<
string>();
131 "Need to define either function or file.");
132 std::string inFile =
m_config[
"file"].as<
string>();
158 Vmath::Sadd(nq-1, (n2->m_x - n1->m_x) / (nq-1), dx, 1, dx, 1);
161 for (
int s = 0; s < niter; ++s)
164 for (
int k = 1; k < nq; ++k)
166 x[k] = x[k-1] + dx[k-1] + gamma*s_deviation[k-1];
169 dx[k-1] = x[k] - x[k-1];
170 dy[k-1] = y[k] - y[k-1];
171 ds[k-1] = sqrt(dx[k-1]*dx[k-1] + dy[k-1]*dy[k-1]);
173 s_average = s_average + ds[k-1]/(nq-1);
176 for (
int k = 0; k < nq-1; ++k)
178 s_deviation[k] = (s_average - ds[k])*
184 gamma =
m_config[
"gamma"].as<
double>();
188 for (
int k = 0; k < nq-1; ++k)
190 if( dx[k]*(dx[k]+gamma*s_deviation[k]) < 0.0)
201 for (
int k = 1; k < nq-1; ++k)
204 new Node(0, x[k], y[k], n1->m_z));
#define ASSERTL0(condition, msg)
int DefineFunction(const std::string &vlist, const std::string &expr)
Defines a function for the purposes of evaluation.
A class that contains algorithms for interpolation between pts fields, expansions and different meshe...
NekDouble Evaluate(const int id)
Evaluate a function which depends only on constants and/or parameters.
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
std::shared_ptr< Edge > EdgeSharedPtr
Shared pointer to an edge.
std::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
CommFactory & GetCommFactory()
std::shared_ptr< Node > NodeSharedPtr
1D Evenly-spaced points using Lagrange polynomial
virtual ~ProcessCurve()
Destructor.
LibUtilities::PtsFieldSharedPtr m_fieldPts
std::shared_ptr< PtsIO > PtsIOSharedPtr
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
void Interpolate(const LibUtilities::PtsFieldSharedPtr ptsInField, LibUtilities::PtsFieldSharedPtr &ptsOutField)
Interpolate from a pts field to a pts field.
std::shared_ptr< PtsField > PtsFieldSharedPtr
std::pair< ModuleType, std::string > ModuleKey
LibUtilities::Interpreter m_fEval
Represents a command-line configuration option.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::map< std::string, ConfigOption > m_config
List of configuration values.
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.
void v_GenerateEdgeNodes(NekMeshUtils::EdgeSharedPtr edge)
NekDouble EvaluateCoordinate(NekDouble xCoord)
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
std::pair< ModuleType, std::string > ModuleKey
ModuleFactory & GetModuleFactory()