[petsc-dev] hg problem
Mark F. Adams
mark.adams at columbia.edu
Wed Aug 24 19:58:47 CDT 2011
I tried revert on this file (which I did not touch) iga.c but got a message to try 'hg revert help' ... which was no help.
So I just went ahead and committed the whole thing and and that cleared it up. I've appended the diffs, but as I said I've never touched this file. Hope I didn't clobber someones stuff,
Mark
diff -r 4bf480f9a778 src/dm/impls/iga/iga.c
--- a/src/dm/impls/iga/iga.c Wed Aug 24 17:08:17 2011 -0700
+++ b/src/dm/impls/iga/iga.c Wed Aug 24 17:43:52 2011 -0700
@@ -1555,24 +1555,22 @@
#define __FUNCT__ "CreateKnotVector"
PetscErrorCode CreateKnotVector(PetscInt N,PetscInt p,PetscInt C,PetscInt m, PetscReal *U,PetscReal U0,PetscReal Uf)
{
- PetscInt i,j;
+ PetscInt i,j;
PetscReal dU;
- PetscInt k0;
PetscFunctionBegin;
- for(i=0;i<p+1;i++) /* open part */
+
+ dU = (Uf-U0)/N;
+ for(i=0;i<(N-1);i++) /* insert N-1 knots */
+ for(j=0;j<(p-C);j++) /* p-C times */
+ U[(p+1) + i*(p-C) + j] = U0 + (i+1)*dU;
+
+ for(i=0;i<(p+1);i++) /* open part */
{
U[i] = U0;
U[m-i-1] = Uf;
}
- dU = (Uf-U0)/((PetscReal) N);
- k0 = p+1;
- for(i=0;i<(N-1);i++) /* insert N-1 knots */
- {
- for(j=0;j<(p-C);j++) /* p-C+1 times */
- U[k0 + i*(p-C) + j] = U0+((PetscReal) (i+1))*dU;
- }
PetscFunctionReturn(0);
}
@@ -1580,29 +1578,22 @@
#define __FUNCT__ "CreatePeriodicKnotVector"
PetscErrorCode CreatePeriodicKnotVector(PetscInt N,PetscInt p,PetscInt C,PetscInt m, PetscReal *U,PetscReal U0,PetscReal Uf)
{
- PetscInt i,j;
+ PetscInt i,j;
PetscReal dU;
- PetscInt k0;
- PetscFunctionBegin; /* periodic part */
- U[p] = U0;
- U[m-p-1] = Uf;
+ PetscFunctionBegin;
- dU = (Uf-U0)/((PetscReal) N);
- k0 = p+1;
- for(i=0;i<(N-1);i++) /* insert N-1 knots */
+ dU = (Uf-U0)/N;
+ for(i=0;i<(N+1);i++) /* insert N+1 knots */
+ for(j=0;j<(p-C);j++) /* p-C times */
+ U[(C+1) + i*(p-C) + j] = U0 + i*dU;
+
+ for(i=0;i<(C+1);i++) /* periodic part */
{
- for(j=0;j<(p-C);j++) /* p-C+1 times */
- U[k0 + i*(p-C) + j] = U0+((PetscReal) (i+1))*dU;
+ U[i] = U0 - (Uf - U[(m-1-p)-(C+1)+i]);
+ U[m-(C+1)+i] = Uf + (U[p+1+i] - U0);
}
- for(i=0;i<p;i++)
- {
- U[i] = -U[m-p-1]+U[m-p-1-(p-i)];
- U[m-p+i] = U[m-p-1]+U[p+i+1];
- }
-
-
PetscFunctionReturn(0);
}
On Aug 24, 2011, at 8:45 PM, Jed Brown wrote:
> On Wed, Aug 24, 2011 at 19:16, Mark F. Adams <mark.adams at columbia.edu> wrote:
> I'm stuck. I seem to have some file that I know nothing about:
>
> examples/tutorials> hg status -m
> M src/dm/impls/iga/iga.c
>
> that seems to be holding me up from doing just about anything with hg. I've tried reverting it with not luck.
>
> hg diff -- to see if there is anything you want to keep
> hg revert src/dm/impls/iga/iga.c -- to discard those changes
> hg update -C -- to discard any changes in the current working tree and update to the given revision (tip, by default)
>
> If you have a problem with these, paste the full output.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110824/74fa81ae/attachment.html>
More information about the petsc-dev
mailing list