Changeset 14975
- Timestamp:
- 05/09/13 01:46:02 (12 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 3 deleted
- 40 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/Container/Constraints.h
r14960 r14975 4 4 /*forward declarations */ 5 5 #include "./DataSet.h" 6 class Materials;7 class Parameters;8 class Elements;9 class Vertices;10 class Loads;11 class Nodes;12 class Inputs;13 6 14 7 #include "../shared/Enum/Enum.h" -
issm/trunk-jpl/src/c/Container/DataSet.h
r14965 r14975 9 9 /*forward declarations */ 10 10 class Object; 11 class Elements;12 class Loads;13 class Nodes;14 class Vertices;15 class Materials;16 class Parameters;17 class Patch;18 11 class Results; 19 class Patch;20 12 21 13 /*! \brief Declaration of DataSet class -
issm/trunk-jpl/src/c/Container/Elements.cpp
r14960 r14975 12 12 13 13 #include "./Elements.h" 14 #include "./Results.h" 14 15 #include "./Parameters.h" 15 16 #include "../classes/classes.h" -
issm/trunk-jpl/src/c/Container/Elements.h
r14953 r14975 6 6 class Materials; 7 7 class Parameters; 8 class Elements;9 8 class Vertices; 10 9 class Loads; 11 10 class Nodes; 12 class Inputs;11 class Patch; 13 12 14 13 /*! \brief Declaration of Elements class -
issm/trunk-jpl/src/c/Container/Inputs.cpp
r14960 r14975 426 426 } 427 427 /*}}}*/ 428 429 /*Methods relating to inputs: */ 430 void IsInputConverged(IssmDouble* peps, Input** new_inputs,Input** old_inputs,int num_inputs,int criterion_enum){ /*{{{*/ 431 432 /*figure out convergence at the input level. 433 We are given a list of inputs, new and old, and a criterion, and using the 434 inputs, we return the value of the criterion test, which will be used at the 435 solution level to determine convergence. 436 */ 437 438 int i,j; 439 440 /*output: */ 441 IssmDouble eps; 442 443 /*intermediary: */ 444 IssmDouble *newvalues = NULL; 445 IssmDouble *oldvalues = NULL; 446 int num_values; 447 IssmDouble ndu = 0; 448 IssmDouble nu = 0; 449 450 if(criterion_enum==RelativeEnum){ 451 452 /*conpute ndu/du (where u could be velocity, pressure, temperature, etc ...): */ 453 for(i=0;i<num_inputs;i++){ 454 455 /*in debugging mode, check that the inputs are of the same type*/ 456 _assert_(new_inputs[i]->ObjectEnum()==old_inputs[i]->ObjectEnum()); 457 458 /*Get pointers*/ 459 new_inputs[i]->GetValuesPtr(&newvalues,&num_values); 460 old_inputs[i]->GetValuesPtr(&oldvalues,&num_values); 461 for(j=0;j<num_values;j++){ 462 ndu+=pow(newvalues[j]-oldvalues[j],2); 463 nu+=pow(oldvalues[j],2); 464 } 465 } 466 467 /*take square root: */ 468 ndu=sqrt(ndu); 469 nu=sqrt(nu); 470 471 /*now, compute eps: */ 472 if(reCast<bool>(nu))eps=ndu/nu; 473 else eps=0; 474 } 475 else _error_("convergence criterion " << EnumToStringx(criterion_enum) << " not supported yet!"); 476 477 /*Assign output pointers:*/ 478 *peps=eps; 479 } 480 /*}}}*/ -
issm/trunk-jpl/src/c/Container/Inputs.h
r14953 r14975 5 5 class Parameters; 6 6 class Input; 7 7 8 #include "./DataSet.h" 8 9 #include "../shared/Numerics/types.h" … … 42 43 }; 43 44 45 /*Methods relating to inputs: */ 46 void IsInputConverged(IssmDouble* peps, Input** new_inputs,Input** old_inputs,int num_inputs,int criterion_enum); 47 44 48 #endif //ifndef _INPUTS_H_ -
issm/trunk-jpl/src/c/Container/Loads.cpp
r14960 r14975 16 16 #include <iostream> 17 17 18 #include "./ DataSet.h"18 #include "./Loads.h" 19 19 #include "../shared/shared.h" 20 20 #include "../shared/Enum/Enum.h" -
issm/trunk-jpl/src/c/Container/Loads.h
r14476 r14975 3 3 4 4 /*forward declarations */ 5 #include "./DataSet.h" 5 6 class Materials; 6 7 class Parameters; 7 8 class Elements; 8 9 class Vertices; 9 class Loads;10 10 class Nodes; 11 class DataSet;12 class Inputs;13 11 14 12 /*!\brief Declaration of Loads class. -
issm/trunk-jpl/src/c/Container/Materials.h
r14953 r14975 9 9 class Loads; 10 10 class Nodes; 11 class Inputs;12 11 13 12 /*! \brief Declaration of Materials class. -
issm/trunk-jpl/src/c/Container/Nodes.h
r14953 r14975 3 3 4 4 #include "./DataSet.h" 5 class Parameters; 6 class Elements; 7 class Vertices; 8 class Loads; 9 class Nodes; 10 class Materials; 11 5 12 6 13 /*!\brief Declaration of Nodes class. -
issm/trunk-jpl/src/c/Container/Options.cpp
r14960 r14975 16 16 17 17 #include "./DataSet.h" 18 #include "./Options.h" 18 19 #include "../shared/shared.h" 19 20 #include "../shared/io/io.h" -
issm/trunk-jpl/src/c/Container/Parameters.cpp
r14960 r14975 16 16 #include <iostream> 17 17 18 #include "./ DataSet.h"18 #include "./Parameters.h" 19 19 #include "../shared/shared.h" 20 20 #include "../shared/Enum/Enum.h" … … 490 490 } 491 491 /*}}}*/ 492 493 /*Methods relating to parameters: */ 494 char* OptionsFromAnalysis(Parameters* parameters,int analysis_type){ /*{{{*/ 495 496 /* figure out ISSM options for current analysis, return a string. */ 497 498 /*output: */ 499 char* outstring=NULL; 500 501 /*intermediary: */ 502 int dummy; 503 IssmDouble *analyses = NULL; 504 char **strings = NULL; 505 char *string = NULL; 506 int numanalyses; 507 int found = -1; 508 int i; 509 510 numanalyses=0; 511 parameters->FindParam(&strings,&numanalyses,ToolkitsOptionsStringsEnum); 512 513 parameters->FindParam(&analyses,&dummy,ToolkitsOptionsAnalysesEnum); 514 515 if(numanalyses==0)return NULL; //we did not find petsc options, don't bother. 516 517 /*ok, go through analyses and figure out if it corresponds to our analysis_type: */ 518 for(i=0;i<numanalyses;i++){ 519 if(analyses[i]==analysis_type){ 520 found=i; 521 break; 522 } 523 } 524 if(found==-1){ 525 /*still haven't found a list of petsc options, go find the default one, for analysis type NoneAnalysisEnum: */ 526 for(i=0;i<numanalyses;i++){ 527 if(analyses[i]==DefaultAnalysisEnum){ 528 found=i; 529 break; 530 } 531 } 532 } 533 if (found==-1){ 534 _error_("could find neither a default analysis nor analysis " << EnumToStringx(analysis_type)); 535 } 536 537 /*ok, grab the option string: */ 538 outstring=xNew<char>(strlen(strings[found])+1); 539 strcpy(outstring,strings[found]); 540 541 /*Free ressources*/ 542 xDelete<IssmDouble>(analyses); 543 for(i=0;i<numanalyses;i++){ 544 string=strings[i]; 545 xDelete<char>(string); 546 } 547 xDelete<char*>(strings); 548 return outstring; 549 } 550 /*}}}*/ 551 void ToolkitsOptionsFromAnalysis(Parameters* parameters,int analysis_type){ /*{{{*/ 552 553 /*!\file: ToolkitsOptionsFromAnalysis.cpp 554 * \brief: for each analysis, setup the issmoptions string. 555 * This is mainly for the case where we run our toolkits using petsc. In this case, we need to 556 * plug our toolkits options directly into the petsc options database. This is the case for each analysis type 557 * and parameters 558 */ 559 560 561 char* options=NULL; 562 563 /*Recover first the options string for this analysis: */ 564 options=OptionsFromAnalysis(parameters,analysis_type); 565 566 /*Initialize our Toolkit Options: */ 567 ToolkitOptions::Init(options); 568 569 #ifdef _HAVE_PETSC_ 570 /*In case we are using PETSC, we do not rely on issmoptions. Instead, we dump issmoptions into the Petsc 571 * options database: */ 572 573 #if _PETSC_MAJOR_ == 2 574 PetscOptionsDestroy(); 575 PetscOptionsCreate(); 576 //PetscOptionsCheckInitial_Private(); 577 //PetscOptionsCheckInitial_Components(); 578 PetscOptionsSetFromOptions(); 579 PetscOptionsInsertMultipleString(options); //our patch 580 #else 581 PetscOptionsSetFromOptions(); 582 PetscOptionsClear(); 583 //PetscOptionsSetFromOptions(); 584 PetscOptionsInsertMultipleString(options); //our patch 585 #endif 586 587 #endif 588 589 xDelete<char>(options); 590 } 591 /*}}}*/ -
issm/trunk-jpl/src/c/Container/Parameters.h
r14957 r14975 6 6 template <class doublematrix> class Matrix; 7 7 template <class doubletype> class Vector; 8 class Materials;9 class Parameters;10 class Elements;11 class Vertices;12 class Loads;13 class Nodes;14 class Inputs;15 8 #include "./DataSet.h" 16 9 #include "../shared/Numerics/types.h" … … 65 58 }; 66 59 60 /*Methods relating to parameters: */ 61 char *OptionsFromAnalysis(Parameters *parameters,int analysis_type); 62 void ToolkitsOptionsFromAnalysis(Parameters* parameters,int analysis_type); 63 64 67 65 #endif //ifndef _PARAMETERS_H_ -
issm/trunk-jpl/src/c/Container/Results.h
r14953 r14975 5 5 6 6 /*forward declarations */ 7 class Materials;8 7 class Parameters; 9 class Elements;10 class Vertices;11 class Loads;12 class Nodes;13 class Inputs;14 8 15 9 /*!\brief Declaration of Results class. -
issm/trunk-jpl/src/c/Container/Vertices.cpp
r14960 r14975 16 16 #include <iostream> 17 17 18 #include "./ DataSet.h"18 #include "./Vertices.h" 19 19 #include "../shared/shared.h" 20 20 #include "../shared/Enum/Enum.h" -
issm/trunk-jpl/src/c/Container/Vertices.h
r14476 r14975 3 3 4 4 /*forward declarations */ 5 class Materials; 6 class Elements; 7 class Vertices; 8 class Loads; 9 class Nodes; 10 class DataSet; 11 class Inputs; 5 #include "./DataSet.h" 6 #include "../shared/Numerics/types.h" 12 7 13 8 /*!\brief Declaration of Vertices class. -
issm/trunk-jpl/src/c/Makefile.am
r14960 r14975 200 200 ./shared/Numerics/Verbosity.h\ 201 201 ./shared/Numerics/Verbosity.cpp\ 202 ./shared/Numerics/IsInputConverged.cpp\203 202 ./shared/Numerics/GaussPoints.h\ 204 203 ./shared/Numerics/GaussPoints.cpp\ … … 210 209 ./shared/Numerics/XZvectorsToCoordinateSystem.cpp\ 211 210 ./shared/Numerics/UnitConversion.cpp\ 212 ./shared/Numerics/OptionsFromAnalysis.cpp\213 ./shared/Numerics/ToolkitsOptionsFromAnalysis.cpp\214 211 ./shared/Exceptions/exceptions.h\ 215 212 ./shared/Exceptions/Exceptions.cpp\ -
issm/trunk-jpl/src/c/classes/IoModel.cpp
r14950 r14975 18 18 #include "../shared/io/io.h" 19 19 #include "../Container/Parameters.h" 20 #include "../Container/Elements.h" 20 21 #include "../shared/shared.h" 21 22 -
issm/trunk-jpl/src/c/classes/kriging/ExponentialVariogram.cpp
r14960 r14975 12 12 #include <string.h> 13 13 #include "../objects/objects.h" 14 #include "../../shared/Enum/Enum.h"15 14 #include "../../shared/shared.h" 15 #include "../../Container/Container.h" 16 16 17 17 /*ExponentialVariogram constructors and destructor*/ -
issm/trunk-jpl/src/c/classes/kriging/GaussianVariogram.cpp
r14960 r14975 12 12 #include <string.h> 13 13 #include "../objects/objects.h" 14 #include "../../shared/Enum/Enum.h"15 14 #include "../../shared/shared.h" 15 #include "../../Container/Container.h" 16 16 17 17 /*GaussianVariogram constructors and destructor*/ -
issm/trunk-jpl/src/c/classes/kriging/PowerVariogram.cpp
r14960 r14975 12 12 #include <string.h> 13 13 #include "../objects/objects.h" 14 #include "../../shared/Enum/Enum.h"15 14 #include "../../shared/shared.h" 15 #include "../../Container/Container.h" 16 16 17 17 /*PowerVariogram constructors and destructor*/ -
issm/trunk-jpl/src/c/classes/kriging/SphericalVariogram.cpp
r14960 r14975 12 12 #include <string.h> 13 13 #include "../objects/objects.h" 14 #include "../../shared/Enum/Enum.h"15 14 #include "../../shared/shared.h" 15 #include "../../Container/Container.h" 16 16 17 17 /*SphericalVariogram constructors and destructor*/ -
issm/trunk-jpl/src/c/classes/objects/DependentObject.h
r13699 r14975 11 11 /*}}}*/ 12 12 13 class Elements;14 class Nodes;15 class Vertices;16 class Loads;17 class Materials;18 class Parameters;19 13 class FemModel; 20 14 -
issm/trunk-jpl/src/c/classes/objects/ElementResults/ElementResult.h
r13623 r14975 9 9 /*{{{*/ 10 10 #include "../Object.h" 11 class Patch; 11 12 /*}}}*/ 12 13 -
issm/trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp
r14960 r14975 16 16 #include "../../../shared/Enum/Enum.h" 17 17 #include "../../../shared/shared.h" 18 #include "../../../Container/Inputs.h" 19 #include "../../../Container/Parameters.h" 18 20 /*}}}*/ 19 21 … … 218 220 /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective 219 221 * datasets, using internal ids and offsets hidden in hooks: */ 220 hnodes->configure( nodesin);221 hvertices->configure( verticesin);222 helement->configure( elementsin);223 hmatpar->configure( materialsin);222 hnodes->configure((DataSet*)nodesin); 223 hvertices->configure((DataSet*)verticesin); 224 helement->configure((DataSet*)elementsin); 225 hmatpar->configure((DataSet*)materialsin); 224 226 225 227 /*Initialize hooked fields*/ -
issm/trunk-jpl/src/c/classes/objects/Loads/Icefront.h
r14761 r14975 17 17 class IoModel; 18 18 class ElementVector; 19 class Vertex; 19 20 /*}}}*/ 20 21 -
issm/trunk-jpl/src/c/classes/objects/Loads/Load.h
r14951 r14975 10 10 /*Headers:*/ 11 11 /*{{{*/ 12 class Object;12 class Node; 13 13 template <class doublematrix> class Matrix; 14 14 template <class doubletype> class Vector; 15 class Elements; 16 class Loads; 17 class Nodes; 18 class Vertices; 19 class Materials; 20 class Parameters; 15 21 16 22 #include "../Object.h" 17 23 #include "../../Update.h" 18 #include "../../../toolkits/toolkits.h" 19 #include "../../../Container/Container.h" 24 20 25 /*}}}*/ 21 26 -
issm/trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp
r14960 r14975 16 16 #include "../../../shared/shared.h" 17 17 #include "../../classes.h" 18 #include "../../../Container/Inputs.h" 19 #include "../../../Container/Parameters.h" 18 20 /*}}}*/ 19 21 … … 238 240 /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective 239 241 * datasets, using internal ids and offsets hidden in hooks: */ 240 hnodes->configure( nodesin);241 hvertices->configure( verticesin);242 helement->configure( elementsin);242 hnodes->configure((DataSet*)nodesin); 243 hvertices->configure((DataSet*)verticesin); 244 helement->configure((DataSet*)elementsin); 243 245 244 246 /*Initialize hooked fields*/ -
issm/trunk-jpl/src/c/classes/objects/Loads/Penpair.cpp
r14960 r14975 16 16 #include "../../../shared/Enum/Enum.h" 17 17 #include "../../../shared/shared.h" 18 #include "../../../Container/Parameters.h" 18 19 /*}}}*/ 19 20 … … 111 112 /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective 112 113 * datasets, using internal ids and offsets hidden in hooks: */ 113 hnodes->configure( nodesin);114 hnodes->configure((DataSet*)nodesin); 114 115 115 116 /*Initialize hooked fields*/ -
issm/trunk-jpl/src/c/classes/objects/Materials/Matdamageice.cpp
r14960 r14975 14 14 #include "../../../shared/Enum/Enum.h" 15 15 #include "../../../shared/shared.h" 16 #include "../../../Container/Inputs.h" 17 #include "../../../Container/Parameters.h" 16 18 17 19 /*Matdamageice constructors and destructor*/ … … 112 114 /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective 113 115 * datasets, using internal ids and offsets hidden in hooks: */ 114 helement->configure( elementsin);116 helement->configure((DataSet*)elementsin); 115 117 } 116 118 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Materials/Matice.cpp
r14960 r14975 14 14 #include "../../../shared/Enum/Enum.h" 15 15 #include "../../../shared/shared.h" 16 #include "../../../Container/Inputs.h" 17 #include "../../../Container/Parameters.h" 16 18 17 19 /*Matice constructors and destructor*/ … … 112 114 /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective 113 115 * datasets, using internal ids and offsets hidden in hooks: */ 114 helement->configure( elementsin);116 helement->configure((DataSet*)elementsin); 115 117 } 116 118 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Options/GenericOption.h
r14960 r14975 17 17 #include "../../../shared/Exceptions/exceptions.h" 18 18 #include "../../../shared/MemOps/MemOps.h" 19 #include "../../../shared/io/io.h" 20 #include "../../../shared/Enum/Enum.h" 19 #include "../../../shared/shared.h" 21 20 #include "./OptionUtilities.h" 22 21 -
issm/trunk-jpl/src/c/classes/objects/Vertex.cpp
r14960 r14975 12 12 #include <string.h> 13 13 #include "../classes.h" 14 #include "../../shared/Enum/Enum.h"15 14 #include "../../shared/shared.h" 15 #include "../../Container/Parameters.h" 16 16 /*}}}*/ 17 17 -
issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp
r14917 r14975 7 7 #include "../../toolkits/toolkits.h" 8 8 #include "../../classes/objects/objects.h" 9 #include "../../Container/Container.h" 9 10 10 11 using namespace bamg; -
issm/trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.h
r13623 r14975 8 8 9 9 #include "../../classes/objects/objects.h" 10 #include "../../Container/Parameters.h" 11 #include "../../Container/Nodes.h" 10 12 11 13 /* local prototypes: */ -
issm/trunk-jpl/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.h
r13623 r14975 8 8 9 9 #include "../../classes/objects/objects.h" 10 #include "../../Container/Container.h" 10 11 11 12 /* local prototypes: */ -
issm/trunk-jpl/src/c/shared/Elements/Arrhenius.cpp
r14951 r14975 4 4 5 5 #include <math.h> 6 #include ". /elements.h"6 #include "../Numerics/types.h" 7 7 #include "../Exceptions/exceptions.h" 8 8 -
issm/trunk-jpl/src/c/shared/Elements/elements.h
r14951 r14975 7 7 8 8 #include "../Numerics/types.h" 9 class ElementMatrix;10 class ElementVector;11 class Vertex;12 class Node;13 9 14 10 IssmDouble Paterson(IssmDouble temperature); -
issm/trunk-jpl/src/c/shared/Numerics/numerics.h
r14915 r14975 11 11 #include "./recast.h" 12 12 #include "./types.h" 13 #include "./constants.h" 13 14 14 15 class Input; … … 26 27 void OptimalSearch(IssmDouble *psearch_scalar,IssmDouble*pJ,OptPars*optpars,IssmDouble (*f)(IssmDouble,OptArgs*), OptArgs*optargs); 27 28 void cross(IssmDouble *result,IssmDouble*vector1,IssmDouble*vector2); 28 void IsInputConverged(IssmDouble *peps, Input**new_inputs,Input**old_inputs,int num_inputs,int criterion_enum);29 29 void UnitConversion(IssmDouble *values, int numvalues,int direction_enum, int type_enum); 30 30 IssmDouble UnitConversion(IssmDouble value, int direction_enum, int type_enum); 31 char *OptionsFromAnalysis(Parameters *parameters,int analysis_type);32 31 void XZvectorsToCoordinateSystem(IssmDouble *T,IssmDouble*xzvectors); 33 32 int cubic(IssmDouble a, IssmDouble b, IssmDouble c, IssmDouble d, double X[3], int *num); 34 void ToolkitsOptionsFromAnalysis(Parameters* parameters,int analysis_type);35 33 36 34 #endif //ifndef _NUMERICS_H_ -
issm/trunk-jpl/src/c/shared/Numerics/recast.h
r14927 r14975 17 17 #if !defined(_HAVE_ADOLC_) || defined(_WRAPPERS_) 18 18 19 template<class To, class From> 20 To reCast(const From& from) { 19 template<class To, class From> To reCast(const From& from) { 21 20 return (To)from; 22 21 } … … 25 24 #include "./types.h" 26 25 27 template<class To, class From> 28 struct ForPartialSpecialization { 26 template<class To, class From> struct ForPartialSpecialization { 29 27 static To reCast(const From& from ) { return (To) from;} 30 28 }; 31 29 32 template<class To, class From> 33 To reCast(const From& from) { 30 template<class To, class From> To reCast(const From& from) { 34 31 return ForPartialSpecialization<To,From>::reCast(from); 35 32 } … … 37 34 * partial specialization 38 35 */ 39 template<class To> 40 struct ForPartialSpecialization<To,adouble> { 36 template<class To> struct ForPartialSpecialization<To,adouble> { 41 37 static To reCast(const adouble& from ) { return (To) (from.getValue());} 42 38 };
Note:
See TracChangeset
for help on using the changeset viewer.