Changeset 16237
- Timestamp:
- 09/23/13 13:49:40 (11 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 1 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/CMakeLists.txt
r16231 r16237 57 57 $ENV{ISSM_DIR}/src/c/modules/GetVectorFromInputsx 58 58 $ENV{ISSM_DIR}/src/c/modules/InputUpdateFromVectorx 59 $ENV{ISSM_DIR}/src/c/modules/InputArtificialNoisex60 59 $ENV{ISSM_DIR}/src/c/modules/ConfigureObjectsx 61 60 $ENV{ISSM_DIR}/src/c/modules/ComputeBasalStressx … … 206 205 ./modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp 207 206 ./modules/InputUpdateFromVectorx/InputUpdateFromVectorx.cpp 208 ./modules/InputArtificialNoisex/InputArtificialNoisex.cpp209 207 ./modules/ConfigureObjectsx/ConfigureObjectsx.cpp 210 208 ./modules/ComputeBasalStressx/ComputeBasalStressx.cpp -
issm/trunk-jpl/src/c/Makefile.am
r16231 r16237 298 298 ./modules/InputUpdateFromVectorx/InputUpdateFromVectorx.h\ 299 299 ./modules/InputUpdateFromVectorx/InputUpdateFromVectorx.cpp\ 300 ./modules/InputArtificialNoisex/InputArtificialNoisex.h\301 ./modules/InputArtificialNoisex/InputArtificialNoisex.cpp\302 300 ./modules/ConfigureObjectsx/ConfigureObjectsx.h\ 303 301 ./modules/ConfigureObjectsx/ConfigureObjectsx.cpp\ -
issm/trunk-jpl/src/c/bamg/EigenMetric.cpp
r16233 r16237 99 99 lambda1=bamg::Abs(lambda1),lambda2=bamg::Abs(lambda2); 100 100 }/*}}}*/ 101 /*FUNCTION EigenMetric::Aniso{{{*/102 double EigenMetric::Aniso() const {103 return sqrt( Aniso2());104 }/*}}}*/105 101 /*FUNCTION EigenMetric::Aniso2{{{*/ 106 102 double EigenMetric::Aniso2() const { 107 103 return lmax()/lmin(); 108 }/*}}}*/109 /*FUNCTION EigenMetric::BoundAniso{{{*/110 void EigenMetric::BoundAniso(const double c){111 BoundAniso2(1/(c*c));112 104 }/*}}}*/ 113 105 /*FUNCTION EigenMetric::Echo {{{*/ -
issm/trunk-jpl/src/c/bamg/Geometry.cpp
r16166 r16237 463 463 return c - curves; 464 464 }/*}}}*/ 465 /*FUNCTION Geometry::Containing{{{*/466 GeomEdge* Geometry::Containing(const R2 P, GeomEdge * start) const {467 /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/Contening)*/468 469 GeomEdge* on =start,* pon=0;470 // walk with the cos on geometry471 int counter=0;472 while(pon != on){473 counter++;474 _assert_(counter<100);475 pon = on;476 R2 A= (*on)[0];477 R2 B= (*on)[1];478 R2 AB = B-A;479 R2 AP = P-A;480 R2 BP = P-B;481 if ( (AB,AP) < 0)482 on = on->Adj[0];483 else if ( (AB,BP) > 0)484 on = on->Adj[1];485 else486 return on;487 }488 return on;489 }490 /*}}}*/491 465 /*FUNCTION Geometry::PostRead{{{*/ 492 466 void Geometry::PostRead(){ -
issm/trunk-jpl/src/c/bamg/Geometry.h
r13623 r16237 60 60 long GetId(const Curve *c) const; 61 61 void UnMarkEdges(); 62 GeomEdge *ProjectOnCurve(const Edge &,double,BamgVertex &,VertexOnGeom &) const; 63 GeomEdge *Containing(const R2 P, GeomEdge *start) const; 62 GeomEdge *ProjectOnCurve(const Edge &,double,BamgVertex &,VertexOnGeom &) const; 64 63 void WriteGeometry(BamgGeom *bamggeom, BamgOpts*bamgopts); 65 64 }; -
issm/trunk-jpl/src/c/bamg/Mesh.cpp
r16231 r16237 139 139 nbt++; 140 140 } 141 if (kt!=nbt){142 _error_("kt!=nbt");143 }144 141 if (nbt==0 && nbv==0) { 145 142 _error_("All triangles have been removed"); … … 148 145 delete [] reft; 149 146 delete [] refv; 150 //double cutoffradian = 10.0/180.0*Pi;151 147 BuildGeometryFromMesh(bamgopts); 152 148 Gh.PostRead(); … … 154 150 ReconstructExistingMesh(); 155 151 156 if (!nbsubdomains){ 157 _error_("nbsubdomains==0"); 158 } 159 if (!subdomains[0].head || !subdomains[0].head->link){ 160 _error_("!subdomains[0].head || !subdomains[0].head->link"); 161 } 162 152 /*Final checks*/ 153 _assert_(kt==nbt); 154 _assert_(nbsubdomains); 155 _assert_(subdomains[0].head && subdomains[0].head->link); 163 156 } 164 157 /*}}}*/ … … 1725 1718 long i1 = GetId(triangles[it][VerticesOfTriangularEdge[j][1]]); 1726 1719 k = edge4->SortAndFind(i0,i1); 1727 if(k>=0){ 1728 subdomains[i].direction = (vertices + i0 == edges[k].v[0]) ? 1 : -1; 1729 subdomains[i].edge = edges+k; 1730 Gh.subdomains[i].edge = Gh.edges + k; 1731 Gh.subdomains[i].direction = subdomains[i].direction; 1732 Gh.subdomains[i].ReferenceNumber = subdomains[i].ReferenceNumber; 1733 } 1734 else 1735 _error_("%i should be >=0"); 1736 } 1720 _assert_(k>=0); 1721 subdomains[i].direction = (vertices + i0 == edges[k].v[0]) ? 1 : -1; 1722 subdomains[i].edge = edges+k; 1723 Gh.subdomains[i].edge = Gh.edges + k; 1724 Gh.subdomains[i].direction = subdomains[i].direction; 1725 Gh.subdomains[i].ReferenceNumber = subdomains[i].ReferenceNumber; 1726 } 1737 1727 1738 1728 delete edge4; -
issm/trunk-jpl/src/c/bamg/Metric.h
r16233 r16237 77 77 double lmin() const; 78 78 double Aniso2() const; 79 double Aniso() const;80 void BoundAniso(const double c);81 79 inline void BoundAniso2(const double coef); 82 80 -
issm/trunk-jpl/src/c/bamg/Triangle.cpp
r16233 r16237 251 251 t->AdjEdgeIndex[aat]=a; 252 252 } 253 }/*}}}*/254 /*FUNCTION Triangle::SetAllFlag{{{*/255 void Triangle::SetAllFlag(int a,int f){256 AdjEdgeIndex[a] = (AdjEdgeIndex[a] &3) + (1020 & f);257 253 }/*}}}*/ 258 254 /*FUNCTION Triangle::SetHidden{{{*/ -
issm/trunk-jpl/src/c/bamg/Triangle.h
r16233 r16237 46 46 int Hidden(int a)const; 47 47 int GetAllflag(int a); 48 void SetAllFlag(int a,int f);49 48 double QualityQuad(int a,int option=1) const; 50 49 short NuEdgeTriangleAdj(int i) const; -
issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp
r16232 r16237 733 733 } 734 734 /*}}}*/ 735 /*FUNCTION Riftfront::PotentialUnstableConstraint {{{*/736 int Riftfront::PotentialUnstableConstraint(int* punstable){737 738 IssmDouble penetration;739 int unstable;740 IssmDouble vx1;741 IssmDouble vy1;742 IssmDouble vx2;743 IssmDouble vy2;744 745 /*Objects: */746 Tria *tria1 = NULL;747 Tria *tria2 = NULL;748 749 /*enum of element? */750 if(elements[0]->ObjectEnum()!=TriaEnum)_error_("only Tria element allowed for Riftfront load!");751 752 /*recover elements on both side of rift: */753 tria1=(Tria*)elements[0];754 tria2=(Tria*)elements[1];755 756 /*First recover velocity: */757 tria1->GetInputValue(&vx1,nodes[0],VxEnum);758 tria2->GetInputValue(&vx2,nodes[1],VxEnum);759 tria1->GetInputValue(&vy1,nodes[0],VyEnum);760 tria2->GetInputValue(&vy2,nodes[1],VyEnum);761 762 /*Node 1 faces node 2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */763 penetration=(vx2-vx1)*normal[0]+(vy2-vy1)*normal[1];764 765 /*Ok, we are looking for positive penetration in an active constraint: */766 if(this->active){767 if (penetration>=0){768 unstable=1;769 }770 else{771 unstable=0;772 }773 }774 else{775 unstable=0;776 }777 778 /*assign output pointer: */779 *punstable=unstable;780 return 1;781 }782 /*}}}*/783 /*FUNCTION Riftfront::PreConstrain {{{*/784 int Riftfront::PreConstrain(int* punstable){785 786 IssmDouble penetration;787 int unstable;788 IssmDouble vx1;789 IssmDouble vy1;790 IssmDouble vx2;791 IssmDouble vy2;792 793 /*Objects: */794 Tria *tria1 = NULL;795 Tria *tria2 = NULL;796 797 /*enum of element? */798 if(elements[0]->ObjectEnum()!=TriaEnum)_error_("only Tria element allowed for Riftfront load!");799 800 /*recover elements on both side of rift: */801 tria1=(Tria*)elements[0];802 tria2=(Tria*)elements[1];803 804 /*First recover velocity: */805 tria1->GetInputValue(&vx1,nodes[0],VxEnum);806 tria2->GetInputValue(&vx2,nodes[1],VxEnum);807 tria1->GetInputValue(&vy1,nodes[0],VyEnum);808 tria2->GetInputValue(&vy2,nodes[1],VyEnum);809 810 /*Node 1 faces node 2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */811 penetration=(vx2-vx1)*normal[0]+(vy2-vy1)*normal[1];812 813 /*Ok, we are preconstraining here. Ie, anything that penetrates is constrained until stability of the entire set814 * of constraints is reached.: */815 if(penetration<0){816 if (!this->active){817 /*This is the first time penetration happens: */818 this->active=1;819 unstable=1;820 }821 else{822 /*This constraint was already active: */823 this->active=1;824 unstable=0;825 }826 }827 else{828 /*No penetration happening. : */829 if (!this->active){830 /*This penalty was not active, and no penetration happening. Do nonthing: */831 this->active=0;832 unstable=0;833 }834 else{835 /*Ok, this penalty wants to get released. But not now, this is preconstraint, not constraint: */836 this->active=1;837 unstable=0;838 }839 }840 841 /*assign output pointer: */842 *punstable=unstable;843 return 1;844 }845 /*}}}*/846 /*FUNCTION Riftfront::PreStable {{{*/847 bool Riftfront::PreStable(){848 return prestable;849 }850 /*}}}*/851 /*FUNCTION Riftfront::SetPreStable {{{*/852 void Riftfront::SetPreStable(){853 prestable=1;854 }855 /*}}}*/856 735 /*FUNCTION Riftfront::IsInput{{{*/ 857 736 bool Riftfront::IsInput(int name){ -
issm/trunk-jpl/src/c/classes/Loads/Riftfront.h
r16232 r16237 85 85 /*}}}*/ 86 86 /*Riftfront specific routines: {{{*/ 87 bool PreStable();88 87 ElementMatrix* PenaltyCreateKMatrixStressbalanceHoriz(IssmDouble kmax); 89 88 ElementVector* PenaltyCreatePVectorStressbalanceHoriz(IssmDouble kmax); 90 void SetPreStable();91 int PreConstrain(int* punstable);92 89 int Constrain(int* punstable); 93 90 void FreezeConstraints(void); 94 91 bool IsFrozen(void); 95 int PotentialUnstableConstraint(int* punstable);96 92 bool IsInput(int name); 97 93 /*}}}*/ 98 94 }; 99 100 95 #endif /* _RIFTFRONT_H_ */ -
issm/trunk-jpl/src/c/modules/modules.h
r16126 r16237 51 51 #include "./InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.h" 52 52 #include "./InputUpdateFromMatrixDakotax/InputUpdateFromMatrixDakotax.h" 53 #include "./InputArtificialNoisex/InputArtificialNoisex.h"54 53 #include "./IoModelToConstraintsx/IoModelToConstraintsx.h" 55 54 #include "./KMLFileReadx/KMLFileReadx.h"
Note:
See TracChangeset
for help on using the changeset viewer.