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
=== modified file 'src/IPData.cpp'
--- src/IPData.cpp 2013-03-04 13:06:28 +0000
+++ src/IPData.cpp 2013-04-04 21:31:23 +0000
@@ -166,7 +166,7 @@
166 dolfin::error("Only 2D and 3D is supported");166 dolfin::error("Only 2D and 3D is supported");
167}167}
168//-----------------------------------------------------------------------------168//-----------------------------------------------------------------------------
169StrainData::StrainData(const dolfin::Function& U, const dolfin::FunctionSpace& Q) :169StrainData::StrainData(dolfin::Function& U, const dolfin::FunctionSpace& Q) :
170 _u_comp_elem(*U[0].function_space()->element()),170 _u_comp_elem(*U[0].function_space()->element()),
171 _u_dofmap(*U.function_space()->dofmap()),171 _u_dofmap(*U.function_space()->dofmap()),
172 _q_dofmap(*Q[0]->dofmap()),172 _q_dofmap(*Q[0]->dofmap()),
@@ -194,6 +194,11 @@
194{194{
195 delete [] _derivatives;195 delete [] _derivatives;
196}196}
197
198void StrainData::update_ghost_disp()
199{
200 _vector.update_ghost_values();
201}
197//-----------------------------------------------------------------------------202//-----------------------------------------------------------------------------
198void StrainData::update(const dolfin::Cell& cell)203void StrainData::update(const dolfin::Cell& cell)
199{204{
200205
=== modified file 'src/IPData.h'
--- src/IPData.h 2013-03-04 13:06:28 +0000
+++ src/IPData.h 2013-04-04 21:31:23 +0000
@@ -142,11 +142,14 @@
142 public:142 public:
143143
144 /// Constructor144 /// Constructor
145 StrainData(const dolfin::Function& U, const dolfin::FunctionSpace& Q);145 StrainData(dolfin::Function& U, const dolfin::FunctionSpace& Q);
146146
147 /// Destructor147 /// Destructor
148 ~StrainData();148 ~StrainData();
149149
150
151 void update_ghost_disp();
152
150 // Update ip coordinates and expansion coefficients for displacement153 // Update ip coordinates and expansion coefficients for displacement
151 // function for given cell.154 // function for given cell.
152 void update(const dolfin::Cell& cell);155 void update(const dolfin::Cell& cell);
@@ -167,7 +170,7 @@
167 const dolfin::GenericDofMap& _q_dofmap;170 const dolfin::GenericDofMap& _q_dofmap;
168171
169 // Vector of expansion coefficients172 // Vector of expansion coefficients
170 const dolfin::GenericVector& _vector;173 dolfin::GenericVector& _vector;
171174
172 // Number of integration points175 // Number of integration points
173 unsigned int _num_ip;176 unsigned int _num_ip;
174177
=== modified file 'src/PlasticityProblem.cpp'
--- src/PlasticityProblem.cpp 2013-02-26 11:20:02 +0000
+++ src/PlasticityProblem.cpp 2013-04-04 21:31:23 +0000
@@ -76,6 +76,8 @@
76 // Elastic tangent76 // Elastic tangent
77 const arma::mat& elastic_tangent = plastic_model.elastic_tangent;77 const arma::mat& elastic_tangent = plastic_model.elastic_tangent;
7878
79 strain_data.update_ghost_disp();
80
79 // Zero local ip data81 // Zero local ip data
80 cons_tangent.zeros();82 cons_tangent.zeros();
81 trial_stress.zeros();83 trial_stress.zeros();

Subscribers

People subscribed via source and target branches