Merge lp:~als88/fenics-plasticity/plasticity_update_ghost into lp:fenics-plasticity

Proposed by Antony Siahaan
Status: Merged
Merged at revision: 112
Proposed branch: lp:~als88/fenics-plasticity/plasticity_update_ghost
Merge into: lp:fenics-plasticity
Diff against target: 66 lines (+13/-3)
3 files modified
src/IPData.cpp (+6/-1)
src/IPData.h (+5/-2)
src/PlasticityProblem.cpp (+2/-0)
To merge this branch: bzr merge lp:~als88/fenics-plasticity/plasticity_update_ghost
Reviewer Review Type Date Requested Status
Garth Wells Pending
Review via email: mp+157235@code.launchpad.net

Description of the change

Adding a method (Strain::update_ghost_displacement in IPData.cpp) which updates the ghost value of displacement in order for GenericVector::get_local to catch the the correct values.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/IPData.cpp'
2--- src/IPData.cpp 2013-03-04 13:06:28 +0000
3+++ src/IPData.cpp 2013-04-04 21:31:23 +0000
4@@ -166,7 +166,7 @@
5 dolfin::error("Only 2D and 3D is supported");
6 }
7 //-----------------------------------------------------------------------------
8-StrainData::StrainData(const dolfin::Function& U, const dolfin::FunctionSpace& Q) :
9+StrainData::StrainData(dolfin::Function& U, const dolfin::FunctionSpace& Q) :
10 _u_comp_elem(*U[0].function_space()->element()),
11 _u_dofmap(*U.function_space()->dofmap()),
12 _q_dofmap(*Q[0]->dofmap()),
13@@ -194,6 +194,11 @@
14 {
15 delete [] _derivatives;
16 }
17+
18+void StrainData::update_ghost_disp()
19+{
20+ _vector.update_ghost_values();
21+}
22 //-----------------------------------------------------------------------------
23 void StrainData::update(const dolfin::Cell& cell)
24 {
25
26=== modified file 'src/IPData.h'
27--- src/IPData.h 2013-03-04 13:06:28 +0000
28+++ src/IPData.h 2013-04-04 21:31:23 +0000
29@@ -142,11 +142,14 @@
30 public:
31
32 /// Constructor
33- StrainData(const dolfin::Function& U, const dolfin::FunctionSpace& Q);
34+ StrainData(dolfin::Function& U, const dolfin::FunctionSpace& Q);
35
36 /// Destructor
37 ~StrainData();
38
39+
40+ void update_ghost_disp();
41+
42 // Update ip coordinates and expansion coefficients for displacement
43 // function for given cell.
44 void update(const dolfin::Cell& cell);
45@@ -167,7 +170,7 @@
46 const dolfin::GenericDofMap& _q_dofmap;
47
48 // Vector of expansion coefficients
49- const dolfin::GenericVector& _vector;
50+ dolfin::GenericVector& _vector;
51
52 // Number of integration points
53 unsigned int _num_ip;
54
55=== modified file 'src/PlasticityProblem.cpp'
56--- src/PlasticityProblem.cpp 2013-02-26 11:20:02 +0000
57+++ src/PlasticityProblem.cpp 2013-04-04 21:31:23 +0000
58@@ -76,6 +76,8 @@
59 // Elastic tangent
60 const arma::mat& elastic_tangent = plastic_model.elastic_tangent;
61
62+ strain_data.update_ghost_disp();
63+
64 // Zero local ip data
65 cons_tangent.zeros();
66 trial_stress.zeros();

Subscribers

People subscribed via source and target branches