source:
issm/oecreview/Archive/16133-16554/ISSM-16236-16237.diff
Last change on this file was 16556, checked in by , 11 years ago | |
---|---|
File size: 14.6 KB |
-
../trunk-jpl/src/c/bamg/Geometry.h
59 59 long GetId(const GeomEdge *t) const; 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 }; 66 65 -
../trunk-jpl/src/c/bamg/Triangle.cpp
251 251 t->AdjEdgeIndex[aat]=a; 252 252 } 253 253 }/*}}}*/ 254 /*FUNCTION Triangle::SetAllFlag{{{*/255 void Triangle::SetAllFlag(int a,int f){256 AdjEdgeIndex[a] = (AdjEdgeIndex[a] &3) + (1020 & f);257 }/*}}}*/258 254 /*FUNCTION Triangle::SetHidden{{{*/ 259 255 void Triangle::SetHidden(int a){ 260 256 //Get Adjacent Triangle number a -
../trunk-jpl/src/c/bamg/Geometry.cpp
462 462 long Geometry::GetId(const Curve * c) const { 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(){ 493 467 /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/AfterRead)*/ -
../trunk-jpl/src/c/bamg/Triangle.h
45 45 int Locked(int a)const; 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; 51 50 AdjacentTriangle Adj(int i) const; -
../trunk-jpl/src/c/bamg/Metric.h
76 76 double lmax() const; 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 83 81 //operators -
../trunk-jpl/src/c/bamg/EigenMetric.cpp
98 98 void EigenMetric::Abs(){ 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 104 }/*}}}*/ 109 /*FUNCTION EigenMetric::BoundAniso{{{*/110 void EigenMetric::BoundAniso(const double c){111 BoundAniso2(1/(c*c));112 }/*}}}*/113 105 /*FUNCTION EigenMetric::Echo {{{*/ 114 106 void EigenMetric::Echo(void){ 115 107 -
../trunk-jpl/src/c/bamg/Mesh.cpp
138 138 triangles[nbt].color = Tho.subdomains[reft[i]].ReferenceNumber; 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"); 146 143 } 147 144 delete [] kk; 148 145 delete [] reft; 149 146 delete [] refv; 150 //double cutoffradian = 10.0/180.0*Pi;151 147 BuildGeometryFromMesh(bamgopts); 152 148 Gh.PostRead(); 153 149 SetIntCoor(); 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 /*}}}*/ 165 158 /*FUNCTION Mesh::Mesh(Mesh & Th,Geometry * pGh,Mesh * pBth,long maxnbv_in) COPY{{{*/ … … 1724 1717 long i0 = GetId(triangles[it][VerticesOfTriangularEdge[j][0]]); 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; 1739 1729 delete [] colorV; -
../trunk-jpl/src/c/modules/InputArtificialNoisex/InputArtificialNoisex.h
1 /*!\file: InputArtificialNoisex.h2 * \brief header file for updating datasets from inputs3 */4 5 #ifndef _INPUTARTIFICIALNOISEX_H6 #define _INPUTARTIFICIALNOISEX_H7 8 #include "../../classes/classes.h"9 10 /* local prototypes: */11 void InputArtificialNoisex( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,int enum_name,IssmDouble min,IssmDouble max);12 13 #endif /* _UPDATEINPUTSFROMVECTORXX_H */ -
../trunk-jpl/src/c/modules/InputArtificialNoisex/InputArtificialNoisex.cpp
1 /*!\file InputArtificialNoisex2 * \brief: update datasets using parameter inputs3 */4 5 #include "./InputArtificialNoisex.h"6 #include "../../shared/shared.h"7 #include "../../toolkits/toolkits.h"8 9 void InputArtificialNoisex( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,int enum_name,IssmDouble min,IssmDouble max){10 11 int i;12 13 /*Update elements, nodes, loads and materials from inputs: */14 for(i=0;i<elements->Size();i++){15 Element* element=dynamic_cast<Element*>(elements->GetObjectByOffset(i));16 element->InputArtificialNoise(enum_name,min,max);17 }18 } -
../trunk-jpl/src/c/modules/modules.h
50 50 #include "./InputUpdateFromVectorx/InputUpdateFromVectorx.h" 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" 56 55 #include "./KMLMeshWritex/KMLMeshWritex.h" -
../trunk-jpl/src/c/Makefile.am
297 297 ./modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp\ 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\ 304 302 ./modules/ComputeBasalStressx/ComputeBasalStressx.h\ -
../trunk-jpl/src/c/CMakeLists.txt
56 56 $ENV{ISSM_DIR}/src/c/modules/GetSolutionFromInputsx 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 62 61 $ENV{ISSM_DIR}/src/c/modules/ComputeStrainRatex … … 205 204 ./modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp 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 211 209 ./modules/ComputeStrainRatex/ComputeStrainRatex.cpp -
../trunk-jpl/src/c/classes/Loads/Riftfront.h
84 84 bool InAnalysis(int analysis_type); 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_ */ -
../trunk-jpl/src/c/classes/Loads/Riftfront.cpp
732 732 else return 0; 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){ 858 737 if (
Note:
See TracBrowser
for help on using the repository browser.