Go to the documentation of this file.
64 vector& avgPos = avg[vertI];
66 if (fixedPoints[vertI])
68 avgPos =
s.localPoints()[vertI];
72 const labelList& pEdges = pointEdges[vertI];
76 const edge&
e =
s.edges()[pEdges[myEdgeI]];
78 label otherVertI =
e.otherVertex(vertI);
80 avgPos +=
s.localPoints()[otherVertI];
83 avgPos /= pEdges.
size();
113 <<
"Did not match all feature points to points on the surface"
119 if (from0To1[fpI] != -1)
121 fixedPoints[from0To1[fpI]] =
true;
129 int main(
int argc,
char *argv[])
141 "fix points from a file containing feature points and edges"
151 if (lambda < 0 || lambda > 1)
155 <<
"0: no change 1: move vertices to average of neighbours"
158 if (mu < 0 || mu > 1)
162 <<
"0: no change 1: move vertices to average of neighbours"
167 <<
"mu : " <<
mu <<
nl
168 <<
"Iters : " << iters <<
nl
169 <<
"Reading surface from " << surfFileName <<
" ..." <<
endl;
173 Info<<
"Faces : " << surf1.size() <<
nl
174 <<
"Vertices : " << surf1.nPoints() <<
nl
175 <<
"Bounding Box: " <<
boundBox(surf1.localPoints()) <<
endl;
182 Info<<
"Reading features from " << featureFileName <<
" ..." <<
endl;
186 getFixedPoints(feMesh, surf1.localPoints(), fixedPoints);
188 Info<<
"Number of fixed points on surface = " << fixedPoints.
count()
192 for (
label iter = 0; iter < iters; iter++)
198 (1 -
lambda)*surf1.localPoints()
199 +
lambda*avg(surf1, fixedPoints)
206 surf1.movePoints(newPoints);
214 (1 +
mu)*surf1.localPoints()
215 -
mu*avg(surf1, fixedPoints)
222 surf1.movePoints(newPoints);
226 Info<<
"Writing surface to " << outFileName <<
" ..." <<
endl;
227 surf1.
write(outFileName);
static SLList< string > validArgs
A list of valid (mandatory) arguments.
vectorField pointField
pointField is a vectorField.
A class for handling file names.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
const dimensionedScalar mu
Atomic mass unit.
#define forAll(list, i)
Loop across all elements in list.
A class for managing temporary objects.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Extract command arguments and options from the supplied argc and argv parameters.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Determine correspondence between points. See below.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
virtual Ostream & write(const token &)=0
Write next token to stream.
const pointField & points() const
Return points.
int main(int argc, char *argv[])
unsigned int count() const
Count number of bits set, O(log(n))
const string & option(const word &opt) const
Return the argument string associated with the named option.
static HashTable< string > validOptions
A list of valid options.
const double e
Elementary charge.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
bool optionFound(const word &opt) const
Return true if the named option is found.
A bounding box defined in terms of the points at its extremities.
A List with indirect addressing.
T argRead(const label index) const
Read a value from the argument at index.
void size(const label)
Override size to be inconsistent with allocated storage.
static void noParallel()
Remove the parallel options.
Foam::argList args(argc, argv)
Points connected by edges.
bool matchPoints(const UList< point > &pts0, const UList< point > &pts1, const UList< scalar > &matchDistance, const bool verbose, labelList &from0To1, const point &origin=point::zero)
Determine correspondence between pointFields. Gets passed.
#define WarningInFunction
Report a warning using Foam::Warning.
dimensionedScalar lambda(laminarTransport.lookup("lambda"))