Cosmetics: space after "if" in src/ASM/LR/*

This commit is contained in:
Kjetil Andre Johannessen 2016-11-18 14:43:17 +01:00 committed by Arne Morten Kvarving
parent 5a8ea08f2a
commit 691565d575
5 changed files with 52 additions and 52 deletions

View File

@ -63,7 +63,7 @@ bool ASMu2D::read (std::istream& is)
// read inputfile as either an LRSpline file directly or a tensor product B-spline and convert // read inputfile as either an LRSpline file directly or a tensor product B-spline and convert
char firstline[256]; char firstline[256];
is.getline(firstline, 256); is.getline(firstline, 256);
if(strncmp(firstline, "# LRSPLINE", 10) == 0) { if (strncmp(firstline, "# LRSPLINE", 10) == 0) {
lrspline.reset(new LR::LRSplineSurface()); lrspline.reset(new LR::LRSplineSurface());
is >> *lrspline; is >> *lrspline;
} else { // probably a SplineSurface, so we'll read that and convert } else { // probably a SplineSurface, so we'll read that and convert
@ -179,7 +179,7 @@ bool ASMu2D::diagonalRefine (int minBasisfunctions)
u += h; u += h;
v += h; v += h;
iter++; iter++;
if( u>end1 ) { if ( u>end1 ) {
h /= 2.0; h /= 2.0;
iter = 0; iter = 0;
u = h/2.0; u = h/2.0;
@ -204,17 +204,17 @@ bool ASMu2D::uniformRefine (int minBasisfunctions)
double u = h/2.0; double u = h/2.0;
double v = h/2.0; double v = h/2.0;
while(lrspline->nBasisFunctions() < minBasisfunctions) { while(lrspline->nBasisFunctions() < minBasisfunctions) {
if(step_u) { if (step_u) {
lrspline->insert_const_u_edge(u, 0, end2); lrspline->insert_const_u_edge(u, 0, end2);
u += h; u += h;
if(u > end1) { if (u > end1) {
step_u = !step_u; step_u = !step_u;
u = h/4.0; u = h/4.0;
} }
} else { } else {
lrspline->insert_const_v_edge(v, 0, end1); lrspline->insert_const_v_edge(v, 0, end1);
v += h; v += h;
if(v > end2) { if (v > end2) {
step_u = !step_u; step_u = !step_u;
v = h/4.0; v = h/4.0;
h /= 2.0; h /= 2.0;
@ -1389,7 +1389,7 @@ bool ASMu2D::getGridParameters (RealArray& prm, int dir, int nSegPerSpan) const
for(int iu=0; iu<=nSegPerSpan; iu++) { for(int iu=0; iu<=nSegPerSpan; iu++) {
double u = umin + (umax-umin)/nSegPerSpan*iu; double u = umin + (umax-umin)/nSegPerSpan*iu;
double v = vmin + (vmax-vmin)/nSegPerSpan*iv; double v = vmin + (vmax-vmin)/nSegPerSpan*iv;
if(dir==0) if (dir==0)
prm.push_back(u); prm.push_back(u);
else else
prm.push_back(v); prm.push_back(v);
@ -1451,9 +1451,9 @@ bool ASMu2D::tesselate (ElementBlock& grid, const int* npe) const
#ifdef SP_DEBUG #ifdef SP_DEBUG
std::cout << "ASMu2D::tesselate( )\n"; std::cout << "ASMu2D::tesselate( )\n";
#endif #endif
if(!lrspline) return false; if (!lrspline) return false;
if(npe[0] != npe[1]) { if (npe[0] != npe[1]) {
std::cerr << "ASMu2D::tesselate does not support different tesselation resolution in " std::cerr << "ASMu2D::tesselate does not support different tesselation resolution in "
<< "u- and v-direction. nviz u = " << npe[0] << ", nviz v = " << npe[1] << "\n"; << "u- and v-direction. nviz u = " << npe[0] << ", nviz v = " << npe[1] << "\n";
return false; return false;

View File

@ -636,7 +636,7 @@ bool ASMu2Dmx::refine (const LR::RefineData& prm,
// do actual refinement // do actual refinement
if (doRefine == 'E') if (doRefine == 'E')
m_basis[bas]->refineByDimensionIncrease(prm.errors,beta); m_basis[bas]->refineByDimensionIncrease(prm.errors,beta);
else if(strat == LR_STRUCTURED_MESH) else if (strat == LR_STRUCTURED_MESH)
m_basis[bas]->refineBasisFunction(prm.elements); m_basis[bas]->refineBasisFunction(prm.elements);
else else
m_basis[bas]->refineElement(prm.elements); m_basis[bas]->refineElement(prm.elements);

View File

@ -280,11 +280,11 @@ LR::LRSplineSurface* ASMu2D::scRecovery (const IntegrandBase& integrand) const
// Special case for basis functions with too many zero knot spans by using // Special case for basis functions with too many zero knot spans by using
// the extended support // the extended support
// if(nel*ng1*ng2 < nPol) // if (nel*ng1*ng2 < nPol)
if(true) if (true)
{ {
// I am unsure as to the consequence of going back to previous if-statement // I am unsure as to the consequence of going back to previous if-statement
// here so we keep if(true) for now. This was introduced mainly when considering // here so we keep if (true) for now. This was introduced mainly when considering
// functions that live on the boundary and have support on few elements; // functions that live on the boundary and have support on few elements;
// corner functions have support on one element. Using i.e. 2x2 points // corner functions have support on one element. Using i.e. 2x2 points
// for every element is not enough to fit 1,x,x^2,x^3,y,xy,...x^3y^3 when // for every element is not enough to fit 1,x,x^2,x^3,y,xy,...x^3y^3 when

View File

@ -61,7 +61,7 @@ bool ASMu3D::read (std::istream& is)
// read inputfile as either an LRSpline file directly or a tensor product B-spline and convert // read inputfile as either an LRSpline file directly or a tensor product B-spline and convert
char firstline[256]; char firstline[256];
is.getline(firstline, 256); is.getline(firstline, 256);
if(strncmp(firstline, "# LRSPLINE", 10) == 0) { if (strncmp(firstline, "# LRSPLINE", 10) == 0) {
lrspline.reset(new LR::LRSplineVolume()); lrspline.reset(new LR::LRSplineVolume());
is >> *lrspline; is >> *lrspline;
} else { // probably a SplineVolume, so we'll read that and convert } else { // probably a SplineVolume, so we'll read that and convert
@ -446,7 +446,7 @@ void ASMu3D::closeFaces (int dir, int basis, int master)
void ASMu3D::constrainFace (int dir, bool open, int dof, int code, char) void ASMu3D::constrainFace (int dir, bool open, int dof, int code, char)
{ {
if(open) if (open)
std::cerr << "\nWARNING: ASMu3D::constrainFace, open boundary conditions not supported yet. Treating it as closed" << std::endl; std::cerr << "\nWARNING: ASMu3D::constrainFace, open boundary conditions not supported yet. Treating it as closed" << std::endl;
int bcode = code; int bcode = code;
@ -460,17 +460,17 @@ void ASMu3D::constrainFace (int dir, bool open, int dof, int code, char)
// get all the boundary functions from the LRspline object // get all the boundary functions from the LRspline object
std::vector<LR::Basisfunction*> thisEdge; std::vector<LR::Basisfunction*> thisEdge;
if(dir == -1) if (dir == -1)
lrspline->getEdgeFunctions(thisEdge, LR::WEST, 1); lrspline->getEdgeFunctions(thisEdge, LR::WEST, 1);
else if(dir == 1) else if (dir == 1)
lrspline->getEdgeFunctions(thisEdge, LR::EAST, 1); lrspline->getEdgeFunctions(thisEdge, LR::EAST, 1);
else if(dir == -2) else if (dir == -2)
lrspline->getEdgeFunctions(thisEdge, LR::SOUTH, 1); lrspline->getEdgeFunctions(thisEdge, LR::SOUTH, 1);
else if(dir == 2) else if (dir == 2)
lrspline->getEdgeFunctions(thisEdge, LR::NORTH, 1); lrspline->getEdgeFunctions(thisEdge, LR::NORTH, 1);
else if(dir == -3) else if (dir == -3)
lrspline->getEdgeFunctions(thisEdge, LR::BOTTOM, 1); lrspline->getEdgeFunctions(thisEdge, LR::BOTTOM, 1);
else if(dir == 3) else if (dir == 3)
lrspline->getEdgeFunctions(thisEdge, LR::TOP, 1); lrspline->getEdgeFunctions(thisEdge, LR::TOP, 1);
std::cout << "\nNumber of constraints: " << thisEdge.size() << std::endl; std::cout << "\nNumber of constraints: " << thisEdge.size() << std::endl;
@ -495,29 +495,29 @@ std::vector<int> ASMu3D::getEdge(int lEdge, bool open, int) const
// lEdge = 9-12, running index is w // lEdge = 9-12, running index is w
int edge = LR::NONE; int edge = LR::NONE;
if(lEdge == 1) if (lEdge == 1)
edge = LR::BOTTOM | LR::SOUTH; edge = LR::BOTTOM | LR::SOUTH;
else if(lEdge == 2) else if (lEdge == 2)
edge = LR::BOTTOM | LR::NORTH; edge = LR::BOTTOM | LR::NORTH;
else if(lEdge == 3) else if (lEdge == 3)
edge = LR::TOP | LR::SOUTH; edge = LR::TOP | LR::SOUTH;
else if(lEdge == 4) else if (lEdge == 4)
edge = LR::TOP | LR::NORTH; edge = LR::TOP | LR::NORTH;
else if(lEdge == 5) else if (lEdge == 5)
edge = LR::BOTTOM | LR::WEST; edge = LR::BOTTOM | LR::WEST;
else if(lEdge == 6) else if (lEdge == 6)
edge = LR::BOTTOM | LR::EAST; edge = LR::BOTTOM | LR::EAST;
else if(lEdge == 7) else if (lEdge == 7)
edge = LR::TOP | LR::WEST; edge = LR::TOP | LR::WEST;
else if(lEdge == 8) else if (lEdge == 8)
edge = LR::TOP | LR::EAST; edge = LR::TOP | LR::EAST;
else if(lEdge == 9) else if (lEdge == 9)
edge = LR::SOUTH | LR::WEST; edge = LR::SOUTH | LR::WEST;
else if(lEdge == 10) else if (lEdge == 10)
edge = LR::SOUTH | LR::EAST; edge = LR::SOUTH | LR::EAST;
else if(lEdge == 11) else if (lEdge == 11)
edge = LR::NORTH | LR::WEST; edge = LR::NORTH | LR::WEST;
else if(lEdge == 12) else if (lEdge == 12)
edge = LR::NORTH | LR::EAST; edge = LR::NORTH | LR::EAST;
// get all the boundary functions from the LRspline object // get all the boundary functions from the LRspline object
@ -532,7 +532,7 @@ std::vector<int> ASMu3D::getEdge(int lEdge, bool open, int) const
void ASMu3D::constrainEdge (int lEdge, bool open, int dof, int code, char) void ASMu3D::constrainEdge (int lEdge, bool open, int dof, int code, char)
{ {
if(open) if (open)
std::cerr << "\nWARNING: ASMu3D::constrainEdge, open boundary conditions not supported yet. Treating it as closed" << std::endl; std::cerr << "\nWARNING: ASMu3D::constrainEdge, open boundary conditions not supported yet. Treating it as closed" << std::endl;
// enforce the boundary conditions // enforce the boundary conditions
@ -619,11 +619,11 @@ void ASMu3D::constrainLine (int fdir, int ldir, double xi, int dof,
void ASMu3D::constrainCorner (int I, int J, int K, int dof, int code, char) void ASMu3D::constrainCorner (int I, int J, int K, int dof, int code, char)
{ {
int corner = LR::NONE; int corner = LR::NONE;
if( I < 0) corner |= LR::WEST; if ( I < 0) corner |= LR::WEST;
else corner |= LR::EAST; else corner |= LR::EAST;
if( J < 0) corner |= LR::SOUTH; if ( J < 0) corner |= LR::SOUTH;
else corner |= LR::NORTH; else corner |= LR::NORTH;
if( K < 0) corner |= LR::BOTTOM; if ( K < 0) corner |= LR::BOTTOM;
else corner |= LR::TOP; else corner |= LR::TOP;
std::vector<LR::Basisfunction*> one_function; std::vector<LR::Basisfunction*> one_function;
@ -887,12 +887,12 @@ void ASMu3D::evaluateBasis (FiniteElement &el, int derivs) const
size_t jp, n = 1; size_t jp, n = 1;
for (jp = 0; jp < nBasis; jp++, n++) { for (jp = 0; jp < nBasis; jp++, n++) {
el.N (n) = result[jp][0]; el.N (n) = result[jp][0];
if(derivs > 0) { if (derivs > 0) {
el.dNdX (n,1) = result[jp][1]; el.dNdX (n,1) = result[jp][1];
el.dNdX (n,2) = result[jp][2]; el.dNdX (n,2) = result[jp][2];
el.dNdX (n,3) = result[jp][3]; el.dNdX (n,3) = result[jp][3];
} }
if(derivs > 1) { if (derivs > 1) {
el.d2NdX2(n,1,1) = result[jp][4]; el.d2NdX2(n,1,1) = result[jp][4];
el.d2NdX2(n,1,2) = el.d2NdX2(n,2,1) = result[jp][5]; el.d2NdX2(n,1,2) = el.d2NdX2(n,2,1) = result[jp][5];
el.d2NdX2(n,1,3) = el.d2NdX2(n,3,1) = result[jp][6]; el.d2NdX2(n,1,3) = el.d2NdX2(n,3,1) = result[jp][6];
@ -1147,37 +1147,37 @@ bool ASMu3D::integrate (Integrand& integrand,
int allP = p1*p2*p3; int allP = p1*p2*p3;
double sum = 0; double sum = 0;
for(int qq=1; qq<=N; qq++) sum+= fe.N(qq); for(int qq=1; qq<=N; qq++) sum+= fe.N(qq);
if(fabs(sum-1) > 1e-10) { if (fabs(sum-1) > 1e-10) {
std::cerr << "fe.N not sums to one at integration point #" << ig << std::endl; std::cerr << "fe.N not sums to one at integration point #" << ig << std::endl;
exit(123); exit(123);
} }
sum = 0; sum = 0;
for(int qq=1; qq<=N; qq++) sum+= dNdu(qq,1); for(int qq=1; qq<=N; qq++) sum+= dNdu(qq,1);
if(fabs(sum) > 1e-10) { if (fabs(sum) > 1e-10) {
std::cerr << "dNdu not sums to zero at integration point #" << ig << std::endl; std::cerr << "dNdu not sums to zero at integration point #" << ig << std::endl;
exit(123); exit(123);
} }
sum = 0; sum = 0;
for(int qq=1; qq<=N; qq++) sum+= dNdu(qq,2); for(int qq=1; qq<=N; qq++) sum+= dNdu(qq,2);
if(fabs(sum) > 1e-10) { if (fabs(sum) > 1e-10) {
std::cerr << "dNdv not sums to zero at integration point #" << ig << std::endl; std::cerr << "dNdv not sums to zero at integration point #" << ig << std::endl;
exit(123); exit(123);
} }
sum = 0; sum = 0;
for(int qq=1; qq<=N; qq++) sum+= dNdu(qq,3); for(int qq=1; qq<=N; qq++) sum+= dNdu(qq,3);
if(fabs(sum) > 1e-10) { if (fabs(sum) > 1e-10) {
std::cerr << "dNdw not sums to zero at integration point #" << ig << std::endl; std::cerr << "dNdw not sums to zero at integration point #" << ig << std::endl;
exit(123); exit(123);
} }
sum = 0; sum = 0;
for(int qq=1; qq<=allP; qq++) sum+= B(qq,1); for(int qq=1; qq<=allP; qq++) sum+= B(qq,1);
if(fabs(sum-1) > 1e-10) { if (fabs(sum-1) > 1e-10) {
std::cerr << "Bezier basis not sums to one at integration point #" << ig << std::endl; std::cerr << "Bezier basis not sums to one at integration point #" << ig << std::endl;
exit(123); exit(123);
} }
sum = 0; sum = 0;
for(int qq=1; qq<=allP; qq++) sum+= B(qq,2); for(int qq=1; qq<=allP; qq++) sum+= B(qq,2);
if(fabs(sum) > 1e-10) { if (fabs(sum) > 1e-10) {
std::cerr << "Bezier derivatives not sums to zero at integration point #" << ig << std::endl; std::cerr << "Bezier derivatives not sums to zero at integration point #" << ig << std::endl;
exit(123); exit(123);
} }
@ -1642,9 +1642,9 @@ bool ASMu3D::getGridParameters (RealArray& prm, int dir, int nSegPerSpan) const
double u = umin + (umax-umin)/nSegPerSpan*iu; double u = umin + (umax-umin)/nSegPerSpan*iu;
double v = vmin + (vmax-vmin)/nSegPerSpan*iv; double v = vmin + (vmax-vmin)/nSegPerSpan*iv;
double w = wmin + (wmax-wmin)/nSegPerSpan*iw; double w = wmin + (wmax-wmin)/nSegPerSpan*iw;
if(dir==0) if (dir==0)
prm.push_back(u); prm.push_back(u);
else if(dir==1) else if (dir==1)
prm.push_back(v); prm.push_back(v);
else else
prm.push_back(w); prm.push_back(w);
@ -1657,9 +1657,9 @@ bool ASMu3D::getGridParameters (RealArray& prm, int dir, int nSegPerSpan) const
bool ASMu3D::tesselate (ElementBlock& grid, const int* npe) const bool ASMu3D::tesselate (ElementBlock& grid, const int* npe) const
{ {
if(!lrspline) return false; if (!lrspline) return false;
if(npe[0] != npe[1] || npe[0] != npe[2]) { if (npe[0] != npe[1] || npe[0] != npe[2]) {
std::cerr << "ASMu2D::tesselate does not support different tesselation resolution in " std::cerr << "ASMu2D::tesselate does not support different tesselation resolution in "
<< "u- and v-direction. nviz u = " << npe[0] << ", nviz v = " << npe[1] << "u- and v-direction. nviz u = " << npe[0] << ", nviz v = " << npe[1]
<< ", nviz w = " << npe[2] << std::endl; << ", nviz w = " << npe[2] << std::endl;
@ -2020,7 +2020,7 @@ int ASMu3D::getCorner(int I, int J, int K, int basis) const
std::vector<LR::Basisfunction*> corner; // vector of one function for corner-input std::vector<LR::Basisfunction*> corner; // vector of one function for corner-input
vol->getEdgeFunctions(corner, (LR::parameterEdge) edge); vol->getEdgeFunctions(corner, (LR::parameterEdge) edge);
if( corner.empty() ) if ( corner.empty() )
return -1; return -1;
size_t ofs = 1; size_t ofs = 1;

View File

@ -297,11 +297,11 @@ LR::LRSplineVolume* ASMu3D::scRecovery (const IntegrandBase& integrand) const
// Special case for basis functions with too many zero knot spans by using // Special case for basis functions with too many zero knot spans by using
// the extended support // the extended support
// if(nel*ng1*ng2*ng3 < nPol) // if (nel*ng1*ng2*ng3 < nPol)
if(true) if (true)
{ {
// I am unsure as to the consequence of going back to previous if-statement // I am unsure as to the consequence of going back to previous if-statement
// here so we keep if(true) for now. This was introduced mainly when considering // here so we keep if (true) for now. This was introduced mainly when considering
// functions that live on the boundary and have support on few elements; // functions that live on the boundary and have support on few elements;
// corner functions have support on one element. Using i.e. 2x2 points // corner functions have support on one element. Using i.e. 2x2 points
// for every element is not enough to fit 1,x,x^2,x^3,y,xy,...x^3y^3 when // for every element is not enough to fit 1,x,x^2,x^3,y,xy,...x^3y^3 when