Last change
on this file since 11679 was 11679, checked in by Eric.Larour, 13 years ago |
Large commit, to strip out Petsc from the code. Created new Matrix and Vector
wrapper objects to the Petsc Mat and Vec objects. These wrappers make it possible
to hook up a different package to handle matrix and vector operations.
|
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** 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* 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: %s",EnumToStringx(configuration_type));
|
---|
29 |
|
---|
30 | /*Initialize solution: */
|
---|
31 | solution=new Vector(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.