Last change
on this file since 15100 was 15100, checked in by Eric.Larour, 12 years ago |
CHG: changed the names of _printString_ and _pprintString_
to _printf_ and _printf0_
|
File size:
1.2 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 |
|
---|
9 | void GetSolutionFromInputsx( Vector<IssmDouble>** psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters){
|
---|
10 |
|
---|
11 | /*intermediary: */
|
---|
12 | int gsize;
|
---|
13 | int i;
|
---|
14 | Element* element=NULL;
|
---|
15 |
|
---|
16 | int configuration_type;
|
---|
17 |
|
---|
18 | /*output: */
|
---|
19 | Vector<IssmDouble>* solution=NULL;
|
---|
20 |
|
---|
21 | if(VerboseModule()) _printf0_(" Get solution from inputs" << "\n");
|
---|
22 |
|
---|
23 | /*retrive parameters: */
|
---|
24 | parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
|
---|
25 |
|
---|
26 | /*Get size of vector: */
|
---|
27 | gsize=nodes->NumberOfDofs(configuration_type,GsetEnum);
|
---|
28 | if (gsize==0) _error_("Allocating a Vec of size 0 as gsize=0 for configuration: " << EnumToStringx(configuration_type));
|
---|
29 |
|
---|
30 | /*Initialize solution: */
|
---|
31 | solution=new Vector<IssmDouble>(gsize);
|
---|
32 |
|
---|
33 | /*Go through elements and plug solution: */
|
---|
34 | for (i=0;i<elements->Size();i++){
|
---|
35 | element=dynamic_cast<Element*>(elements->GetObjectByOffset(i));
|
---|
36 | element->GetSolutionFromInputs(solution);
|
---|
37 | }
|
---|
38 |
|
---|
39 | /*Assemble vector: */
|
---|
40 | solution->Assemble();
|
---|
41 |
|
---|
42 | /*Assign output pointers:*/
|
---|
43 | *psolution=solution;
|
---|
44 |
|
---|
45 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.