Last change
on this file since 23587 was 23587, checked in by Mathieu Morlighem, 6 years ago |
CHG: simplifying some functions now that nodes and loads are for one single analysis
|
File size:
1.1 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: */
|
---|
[23587] | 12 | int gsize;
|
---|
| 13 | int 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(&analysisenum,AnalysisTypeEnum);
|
---|
[4043] | 22 |
|
---|
[3821] | 23 | /*Get size of vector: */
|
---|
[23587] | 24 | gsize=femmodel->nodes->NumberOfDofs(GsetEnum);
|
---|
| 25 | if(gsize==0) _error_("Allocating a Vec of size 0 as gsize=0 ");
|
---|
[13622] | 26 |
|
---|
[3821] | 27 | /*Initialize solution: */
|
---|
[13216] | 28 | solution=new Vector<IssmDouble>(gsize);
|
---|
[13622] | 29 |
|
---|
[3821] | 30 | /*Go through elements and plug solution: */
|
---|
[16675] | 31 | Analysis* analysis = EnumToAnalysis(analysisenum);
|
---|
[15849] | 32 | for(int i=0;i<femmodel->elements->Size();i++){
|
---|
[18521] | 33 | Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
|
---|
[16675] | 34 | analysis->GetSolutionFromInputs(solution,element);
|
---|
[3971] | 35 | }
|
---|
[16675] | 36 | delete analysis;
|
---|
[3821] | 37 |
|
---|
| 38 | /*Assemble vector: */
|
---|
[11679] | 39 | solution->Assemble();
|
---|
[3821] | 40 |
|
---|
| 41 | /*Assign output pointers:*/
|
---|
| 42 | *psolution=solution;
|
---|
| 43 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.