|
Last change
on this file since 13622 was 13622, checked in by Mathieu Morlighem, 13 years ago |
|
CHG: cosmetics, removing all deboule blank lines and indent single white lines correctly
|
|
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 "../../include/include.h"
|
|---|
| 8 | #include "../../toolkits/toolkits.h"
|
|---|
| 9 | #include "../../EnumDefinitions/EnumDefinitions.h"
|
|---|
| 10 |
|
|---|
| 11 | void GetSolutionFromInputsx( Vector<IssmDouble>** psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters){
|
|---|
| 12 |
|
|---|
| 13 | /*intermediary: */
|
|---|
| 14 | int gsize;
|
|---|
| 15 | int i;
|
|---|
| 16 | Element* element=NULL;
|
|---|
| 17 |
|
|---|
| 18 | int configuration_type;
|
|---|
| 19 |
|
|---|
| 20 | /*output: */
|
|---|
| 21 | Vector<IssmDouble>* solution=NULL;
|
|---|
| 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=(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.