Last change
on this file since 18521 was 18521, checked in by Mathieu Morlighem, 11 years ago |
CHG: removed ALL dynamic casts, now change the template shared/Numerics/recast.h to change back to dynamic_casts
|
File size:
1.3 KB
|
Rev | Line | |
---|
[3821] | 1 | /*!\file GetSolutionFromInputsx
|
---|
| 2 | * \brief: update datasets using parameter inputs
|
---|
| 3 | */
|
---|
| 4 |
|
---|
| 5 | #include "./GetSolutionFromInputsx.h"
|
---|
[3913] | 6 | #include "../../shared/shared.h"
|
---|
| 7 | #include "../../toolkits/toolkits.h"
|
---|
[3821] | 8 |
|
---|
[15849] | 9 | void GetSolutionFromInputsx(Vector<IssmDouble>** psolution,FemModel* femmodel){
|
---|
[3821] | 10 |
|
---|
| 11 | /*intermediary: */
|
---|
[15849] | 12 | int gsize;
|
---|
[16675] | 13 | int configuration,analysisenum;
|
---|
[3821] | 14 |
|
---|
| 15 | /*output: */
|
---|
[13216] | 16 | Vector<IssmDouble>* solution=NULL;
|
---|
[14822] | 17 |
|
---|
[15104] | 18 | if(VerboseModule()) _printf0_(" Get solution from inputs\n");
|
---|
[3821] | 19 |
|
---|
[4043] | 20 | /*retrive parameters: */
|
---|
[16675] | 21 | femmodel->parameters->FindParam(&configuration,ConfigurationTypeEnum);
|
---|
| 22 | femmodel->parameters->FindParam(&analysisenum,AnalysisTypeEnum);
|
---|
[4043] | 23 |
|
---|
[3821] | 24 | /*Get size of vector: */
|
---|
[16675] | 25 | gsize=femmodel->nodes->NumberOfDofs(configuration,GsetEnum);
|
---|
| 26 | if(gsize==0) _error_("Allocating a Vec of size 0 as gsize=0 for configuration "<<EnumToStringx(configuration));
|
---|
[13622] | 27 |
|
---|
[3821] | 28 | /*Initialize solution: */
|
---|
[13216] | 29 | solution=new Vector<IssmDouble>(gsize);
|
---|
[13622] | 30 |
|
---|
[3821] | 31 | /*Go through elements and plug solution: */
|
---|
[16675] | 32 | Analysis* analysis = EnumToAnalysis(analysisenum);
|
---|
[15849] | 33 | for(int i=0;i<femmodel->elements->Size();i++){
|
---|
[18521] | 34 | Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
|
---|
[16675] | 35 | analysis->GetSolutionFromInputs(solution,element);
|
---|
[3971] | 36 | }
|
---|
[16675] | 37 | delete analysis;
|
---|
[3821] | 38 |
|
---|
| 39 | /*Assemble vector: */
|
---|
[11679] | 40 | solution->Assemble();
|
---|
[3821] | 41 |
|
---|
| 42 | /*Assign output pointers:*/
|
---|
| 43 | *psolution=solution;
|
---|
| 44 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.