source: issm/trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp@ 23587

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
Line 
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
9void GetSolutionFromInputsx(Vector<IssmDouble>** psolution,FemModel* femmodel){
10
11 /*intermediary: */
12 int gsize;
13 int 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(&analysisenum,AnalysisTypeEnum);
22
23 /*Get size of vector: */
24 gsize=femmodel->nodes->NumberOfDofs(GsetEnum);
25 if(gsize==0) _error_("Allocating a Vec of size 0 as gsize=0 ");
26
27 /*Initialize solution: */
28 solution=new Vector<IssmDouble>(gsize);
29
30 /*Go through elements and plug solution: */
31 Analysis* analysis = EnumToAnalysis(analysisenum);
32 for(int i=0;i<femmodel->elements->Size();i++){
33 Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
34 analysis->GetSolutionFromInputs(solution,element);
35 }
36 delete analysis;
37
38 /*Assemble vector: */
39 solution->Assemble();
40
41 /*Assign output pointers:*/
42 *psolution=solution;
43}
Note: See TracBrowser for help on using the repository browser.