1 | /*!\file GetSolutionFromInputsx
|
---|
2 | * \brief: update datasets using parameter inputs
|
---|
3 | */
|
---|
4 |
|
---|
5 | #include "./GetSolutionFromInputsx.h"
|
---|
6 | #include "../../shared/shared.h"
|
---|
7 | #include "../../toolkits/toolkits.h"
|
---|
8 |
|
---|
9 | void GetSolutionFromInputsx(Vector<IssmDouble>** psolution,FemModel* femmodel){
|
---|
10 |
|
---|
11 | /*intermediary: */
|
---|
12 | int gsize;
|
---|
13 | int configuration,analysisenum;
|
---|
14 |
|
---|
15 | /*output: */
|
---|
16 | Vector<IssmDouble>* solution=NULL;
|
---|
17 |
|
---|
18 | if(VerboseModule()) _printf0_(" Get solution from inputs\n");
|
---|
19 |
|
---|
20 | /*retrive parameters: */
|
---|
21 | femmodel->parameters->FindParam(&configuration,ConfigurationTypeEnum);
|
---|
22 | femmodel->parameters->FindParam(&analysisenum,AnalysisTypeEnum);
|
---|
23 |
|
---|
24 | /*Get size of vector: */
|
---|
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));
|
---|
27 |
|
---|
28 | /*Initialize solution: */
|
---|
29 | solution=new Vector<IssmDouble>(gsize);
|
---|
30 |
|
---|
31 | /*Go through elements and plug solution: */
|
---|
32 | Analysis* analysis = EnumToAnalysis(analysisenum);
|
---|
33 | for(int i=0;i<femmodel->elements->Size();i++){
|
---|
34 | Element* element=dynamic_cast<Element*>(femmodel->elements->GetObjectByOffset(i));
|
---|
35 | analysis->GetSolutionFromInputs(solution,element);
|
---|
36 | }
|
---|
37 | delete analysis;
|
---|
38 |
|
---|
39 | /*Assemble vector: */
|
---|
40 | solution->Assemble();
|
---|
41 |
|
---|
42 | /*Assign output pointers:*/
|
---|
43 | *psolution=solution;
|
---|
44 | }
|
---|