v0.14.0
electrostatics.hpp
Go to the documentation of this file.
1 
2 #ifndef __ELECTROSTATICS_HPP__
3 #define __ELECTROSTATICS_HPP__
4 
5 #include <MoFEM.hpp>
6 using namespace MoFEM;
7 constexpr auto domainField = "POTENTIAL";
8 constexpr int BASE_DIM = 1;
9 constexpr int FIELD_DIM = 1;
11 const double bodySource = 0.0;
12 
13 // aliases for elements types from the pipeline
22 using PostProcFaceEle =
24 
25 template <int SPACE_DIM> struct intPostProc {};
26 
27 template <> struct intPostProc<2> {
29 };
30 
31 template <> struct intPostProc<3> {
33 };
34 
36 
37 // forms integrators to calculate the LHS and RHS
38 using OpDomainLhsMatrixK =
41 
43  PETSC>::LinearForm<GAUSS>::OpSource<BASE_DIM, FIELD_DIM>; // rhs: F Vector
45  PETSC>::LinearForm<GAUSS>::OpSource<BASE_DIM, FIELD_DIM>; // rhs: b Vector
46 
47 // Common data structure for blocks
48 struct BlockData {
49  int iD;
50  double chargeDensity;
51  double epsPermit;
56 };
57 
58 struct DataAtIntegrationPts {
61  double blockChrgDens;
63  blockPermittivity = 0.0;
64  blockChrgDens = 0.0;
65  PetscInt ghosts[2] = {0, 1};
66  if (!m_field.get_comm_rank())
67  petscVec = createGhostVector(m_field.get_comm(), 2, 2, 0, ghosts);
68  else
69  petscVec = createGhostVector(m_field.get_comm(), 0, 2, 2, ghosts);
70  }
71 };
72 
73 // Operator to get the charge density on the interface
74 struct OpBlockChargeDensity : public IntEleOp {
76  boost::shared_ptr<DataAtIntegrationPts> common_data_ptr,
77  boost::shared_ptr<std::map<int, BlockData>> int_block_sets_ptr,
78  const std::string &field_name)
79  : IntEleOp(field_name, field_name, OPROWCOL, false),
80  commonDataPtr(common_data_ptr), intBlockSetsPtr(int_block_sets_ptr) {
81  std::fill(&doEntities[MBVERTEX], &doEntities[MBMAXTYPE], false);
82  doEntities[MBVERTEX] = true;
83  }
84 
85  MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type,
86  EntityType col_type, EntData &row_data,
87  EntData &col_data) {
89  for (const auto &m : *intBlockSetsPtr) {
90  if (m.second.interfaceEnts.find(getFEEntityHandle()) !=
91  m.second.interfaceEnts.end()) {
92  commonDataPtr->blockChrgDens = m.second.chargeDensity;
93  }
94  }
96  }
97 
98 protected:
99  boost::shared_ptr<DataAtIntegrationPts> commonDataPtr;
100  boost::shared_ptr<std::map<int, BlockData>> intBlockSetsPtr;
101 };
102 // Operator to get the permittivity of the domain/block
104 
106  boost::shared_ptr<DataAtIntegrationPts> common_data_ptr,
107  boost::shared_ptr<map<int, BlockData>> perm_block_sets_ptr,
108  const std::string &field_name)
109  : DomainEleOp(field_name, field_name, OPROWCOL, false),
110  commonDataPtr(common_data_ptr), permBlockSetsPtr(perm_block_sets_ptr) {
111  std::fill(&doEntities[MBVERTEX], &doEntities[MBMAXTYPE], false);
112  doEntities[MBVERTEX] = true;
113  }
114 
115  MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type,
116  EntityType col_type,
117  EntitiesFieldData::EntData &row_data,
118  EntitiesFieldData::EntData &col_data) {
120  for (auto &m : (*permBlockSetsPtr)) {
121  if (m.second.domainEnts.find(getFEEntityHandle()) !=
122  m.second.domainEnts.end()) {
123  commonDataPtr->blockPermittivity = m.second.epsPermit;
124  }
125  }
127  }
128 
129 protected:
130  boost::shared_ptr<map<int, BlockData>> permBlockSetsPtr;
131  boost::shared_ptr<DataAtIntegrationPts> commonDataPtr;
132 };
133 
134 // Operator to calculate Total Electrgy density in Post Porocessing
135 struct OpTotalEnergy : public DomainEleOp {
137  const std::string &field_name,
138  boost::shared_ptr<MatrixDouble> grad_u_negative,
139  boost::shared_ptr<std::map<int, BlockData>> perm_block_sets_ptr,
140  boost::shared_ptr<std::map<int, BlockData>> int_domain_block_sets_ptr,
141  boost::shared_ptr<DataAtIntegrationPts> common_data_ptr,
142  SmartPetscObj<Vec> petsc_vec_energy)
144  gradUNegative(grad_u_negative), permBlockSetsPtr(perm_block_sets_ptr),
145  intDomainBlocksetsPtr(int_domain_block_sets_ptr),
146  commonDataPtr(common_data_ptr), petscTotalEnergy(petsc_vec_energy) {
147  std::fill(&doEntities[MBVERTEX], &doEntities[MBMAXTYPE], false);
148  doEntities[MBVERTEX] = true;
149  }
150  MoFEMErrorCode doWork(int side, EntityType type, EntData &data) {
152 
153  auto t_negative_grad_u = getFTensor1FromMat<SPACE_DIM>(*gradUNegative);
155  double area = getMeasure();
156  auto t_w = getFTensor0IntegrationWeight();
157  auto nb_gauss_pts = getGaussPts().size2();
158  double totalEnergy = 0.0;
159  int index = 0;
160  // Total Energy Density = 0.5 * E^2 * Perm * Area
161  for (const auto &m : *intDomainBlocksetsPtr) {
162 
163  double blockPermittivity = 0.0;
164 
165  if (m.second.internalDomainEnts.find(getFEEntityHandle()) !=
166  m.second.internalDomainEnts.end()) {
167  for (const auto &n : *permBlockSetsPtr) {
168  if (n.second.domainEnts.find(getFEEntityHandle()) !=
169  n.second.domainEnts.end()) {
170  blockPermittivity = n.second.epsPermit;
171  }
172  }
173 
174  for (int gg = 0; gg != nb_gauss_pts; gg++) {
175  totalEnergy += 0.5 * t_negative_grad_u(I) * t_negative_grad_u(I) *
176  blockPermittivity * t_w * area;
177  ++t_negative_grad_u;
178  ++t_w;
179  }
180  }
181  }
182  CHKERR VecSetValues(petscTotalEnergy, 1, &index, &totalEnergy, ADD_VALUES);
183 
185  }
186 
187 private:
188  boost::shared_ptr<MatrixDouble> gradUNegative;
189  boost::shared_ptr<std::map<int, BlockData>> permBlockSetsPtr;
190  boost::shared_ptr<std::map<int, BlockData>> intDomainBlocksetsPtr;
191  boost::shared_ptr<DataAtIntegrationPts> commonDataPtr;
193 };
194 
195 struct OpEnergyDensity : public DomainEleOp {
196 
198  const std::string &field_name,
199  boost::shared_ptr<MatrixDouble> grad_u_negative,
200  boost::shared_ptr<VectorDouble> energy_densiity_ptr,
201  boost::shared_ptr<std::map<int, BlockData>> perm_block_sets_ptr,
202  boost::shared_ptr<DataAtIntegrationPts> common_data_ptr)
203  : DomainEleOp(field_name, field_name, OPROWCOL, false),
204  energyDensity(energy_densiity_ptr), gradUNegative(grad_u_negative),
205  permBlockSetsPtr(perm_block_sets_ptr), commonDataPtr(common_data_ptr) {
206  std::fill(&doEntities[MBVERTEX], &doEntities[MBMAXTYPE], false);
207  doEntities[MBVERTEX] = true;
208  }
209 
210  MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type,
211  EntityType col_type,
212  EntitiesFieldData::EntData &row_data,
213  EntitiesFieldData::EntData &col_data) {
215 
216  size_t nb_gauss_pts = getGaussPts().size2();
217  energyDensity->resize(nb_gauss_pts, false);
218  energyDensity->clear();
219  auto t_energy_density = getFTensor0FromVec(*energyDensity);
220  auto t_negative_grad_u = getFTensor1FromMat<SPACE_DIM>(*gradUNegative);
222  double blockPermittivity = 0.0;
223  for (const auto &n : *permBlockSetsPtr) {
224  if (n.second.domainEnts.find(getFEEntityHandle()) !=
225  n.second.domainEnts.end()) {
226  blockPermittivity = n.second.epsPermit;
227  }
228  }
229  // E = 0.5 * E^2 * Perm
230  for (int gg = 0; gg != nb_gauss_pts; gg++) {
231  t_energy_density =
232  0.5 * t_negative_grad_u(I) * t_negative_grad_u(I) * blockPermittivity;
233  ++t_negative_grad_u;
234  ++t_energy_density;
235  }
236 
238  }
239 
240 private:
241  boost::shared_ptr<MatrixDouble> gradUNegative;
242  boost::shared_ptr<VectorDouble> energyDensity;
243  boost::shared_ptr<std::map<int, BlockData>> permBlockSetsPtr;
244  boost::shared_ptr<DataAtIntegrationPts> commonDataPtr;
245 };
246 
247 struct OpGradTimesPerm : public DomainEleOp {
248 
250  const std::string &field_name,
251  boost::shared_ptr<MatrixDouble> grad_u_negative,
252  boost::shared_ptr<MatrixDouble> grad_times_perm,
253  boost::shared_ptr<std::map<int, BlockData>> perm_block_sets_ptr,
254  boost::shared_ptr<DataAtIntegrationPts> common_data_ptr)
255  : DomainEleOp(field_name, field_name, OPROWCOL, false),
256  gradTimesPerm(grad_times_perm), gradUNegative(grad_u_negative),
257  permBlockSetsPtr(perm_block_sets_ptr), commonDataPtr(common_data_ptr) {
258  std::fill(&doEntities[MBVERTEX], &doEntities[MBMAXTYPE], false);
259  doEntities[MBVERTEX] = true;
260  }
261 
262  MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type,
263  EntityType col_type,
264  EntitiesFieldData::EntData &row_data,
265  EntitiesFieldData::EntData &col_data) {
267 
268  size_t nb_gauss_pts = getGaussPts().size2();
269  gradTimesPerm->resize(SPACE_DIM, nb_gauss_pts, false);
270  gradTimesPerm->clear();
271  auto t_grad_times_perm = getFTensor1FromMat<SPACE_DIM>(*gradTimesPerm);
272  auto t_negative_grad_u = getFTensor1FromMat<SPACE_DIM>(*gradUNegative);
274  double blockPermittivity = 0.0;
275  for (const auto &n : *permBlockSetsPtr) {
276  if (n.second.domainEnts.find(getFEEntityHandle()) !=
277  n.second.domainEnts.end()) {
278  blockPermittivity = n.second.epsPermit;
279  }
280  }
281  for (int gg = 0; gg != nb_gauss_pts; gg++) {
282  t_grad_times_perm(I) = t_negative_grad_u(I) * blockPermittivity;
283 
284  ++t_negative_grad_u;
285  ++t_grad_times_perm;
286  }
287 
289  }
290 
291 private:
292  boost::shared_ptr<MatrixDouble> gradUNegative;
293  boost::shared_ptr<MatrixDouble> gradTimesPerm;
294  boost::shared_ptr<std::map<int, BlockData>> permBlockSetsPtr;
295  boost::shared_ptr<DataAtIntegrationPts> commonDataPtr;
296 };
297 
298 // operator to get the electric jump on the all side elecment of the domain:
299 // d = E1 * perm1 - E2 * perm1
300 template <int SPACE_DIM> struct OpElectricDispJump : public SideEleOp {
302  const std::string field_name, boost::shared_ptr<MatrixDouble> grad_ptr,
303  boost::shared_ptr<MatrixDouble> d_jump,
304  boost::shared_ptr<DataAtIntegrationPts> common_data_ptr,
305  boost::shared_ptr<std::map<int, BlockData>> perm_block_sets_ptr)
306  : SideEleOp(field_name, SideEleOp::OPROW, false), gradPtr(grad_ptr),
307  djump(d_jump), commonDataPtr(common_data_ptr),
308  permBlockSetsPtr(perm_block_sets_ptr)
309 
310  {
311  std::fill(&doEntities[MBVERTEX], &doEntities[MBMAXTYPE], false);
312  doEntities[MBVERTEX] = true;
313  }
314 
315  MoFEMErrorCode doWork(int side, EntityType type, EntData &data) {
317 
319  auto t_field_grad = getFTensor1FromMat<SPACE_DIM>(*gradPtr);
320 
321  double blockPermittivity = 0.0;
322 
323  for (const auto &n : *permBlockSetsPtr) {
324  if (n.second.domainEnts.find(getFEEntityHandle()) !=
325  n.second.domainEnts.end()) {
326  blockPermittivity = n.second.epsPermit;
327  }
328  }
329  auto N_InLoop = getNinTheLoop();
330  auto sensee = getSkeletonSense();
331  auto nb_gauss_pts = getGaussPts().size2();
332 
333  if (N_InLoop == 0) {
334  djump->resize(SPACE_DIM, nb_gauss_pts, false);
335  djump->clear();
336  }
337  auto t_jump = getFTensor1FromMat<SPACE_DIM>(*djump);
338 
339  for (int gg = 0; gg != nb_gauss_pts; gg++) {
340  t_jump(i) -= t_field_grad(i) * blockPermittivity * sensee;
341  ++t_jump;
342  ++t_field_grad;
343  }
344 
346  }
347 
348 protected:
349  boost::shared_ptr<MatrixDouble> gradPtr;
350  boost::shared_ptr<MatrixDouble> djump;
351  boost::shared_ptr<std::map<int, BlockData>> permBlockSetsPtr;
352  boost::shared_ptr<DataAtIntegrationPts> commonDataPtr;
353 };
354 
355 // operator to get the charge value on the inerface: Alpha = d * n
356 
357 template <int SPACE_DIM> struct OpElectrodeCharge : public IntEleOp {
359  const std::string field_name, boost::shared_ptr<MatrixDouble> d_jump,
360  SmartPetscObj<Vec> alpha_vec,
361  boost::shared_ptr<std::map<int, BlockData>> electrode_block_sets_ptr)
362  : IntEleOp(field_name, IntEleOp::OPROW, false), dJumpPtr(d_jump),
363  petscVec(alpha_vec), elecBlockSetsPtr(electrode_block_sets_ptr) {
364  std::fill(&doEntities[MBVERTEX], &doEntities[MBMAXTYPE], false);
365  doEntities[MBVERTEX] = true;
366  }
367  MoFEMErrorCode doWork(int side, EntityType type, EntData &data) {
370  int index = 0;
371  auto fe_ent = getFEEntityHandle();
372  auto nb_gauss_pts = getGaussPts().size2();
373  double area = getMeasure();
374  dJumpPtr->resize(SPACE_DIM, nb_gauss_pts, false);
375  auto t_jump = getFTensor1FromMat<SPACE_DIM>(*dJumpPtr);
376  auto t_normal = getFTensor1NormalsAtGaussPts();
377  auto t_w = getFTensor0IntegrationWeight();
378  for (auto &m : *elecBlockSetsPtr) {
379  double alphaPart = 0.0;
380  if (m.second.electrodeEnts.find(fe_ent) != m.second.electrodeEnts.end()) {
381 
382  for (int gg = 0; gg != nb_gauss_pts; gg++) {
384  t_r(i) = t_normal(i);
385  auto t_r_normalized = t_r.normalize();
386  alphaPart += (t_jump(i) * t_r(i)) * t_w * area;
387  ++t_jump;
388  ++t_normal;
389  ++t_w;
390  }
391  CHKERR ::VecSetValues(petscVec, 1, &index, &alphaPart,
392  ADD_VALUES); // add the alpha value to the vector
393  }
394  ++index;
395  }
396 
398  }
399 
400 protected:
401  boost::shared_ptr<MatrixDouble> dJumpPtr;
402  boost::shared_ptr<std::map<int, BlockData>> elecBlockSetsPtr;
404 };
405 
407  OpElectricField(boost::shared_ptr<MatrixDouble> grad_u_negative,
408  boost::shared_ptr<MatrixDouble> grad_u)
410  gradUNegative(grad_u_negative), gradU(grad_u) {}
411 
412  MoFEMErrorCode doWork(int side, EntityType type,
415 
416  const size_t nb_gauss_pts = getGaussPts().size2();
417  gradUNegative->resize(SPACE_DIM, nb_gauss_pts, false);
418  gradUNegative->clear();
419  auto t_grad_u = getFTensor1FromMat<SPACE_DIM>(*gradU);
420  auto t_negative_grad_u = getFTensor1FromMat<SPACE_DIM>(*gradUNegative);
422 
423  for (int gg = 0; gg != nb_gauss_pts; gg++) {
424  t_negative_grad_u(I) = -t_grad_u(I);
425  ++t_grad_u;
426  ++t_negative_grad_u;
427  }
428 
430  }
431 
432 private:
433  boost::shared_ptr<MatrixDouble> gradUNegative;
434  boost::shared_ptr<MatrixDouble> gradU;
435 };
436 
437 #endif // __ELECTROSTATICS_HPP__
NOSPACE
@ NOSPACE
Definition: definitions.h:83
OpBlockChargeDensity::doWork
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
Definition: electrostatics.hpp:85
MoFEM::EdgeElementForcesAndSourcesCore
Edge finite element.
Definition: EdgeElementForcesAndSourcesCore.hpp:30
MoFEM::EntitiesFieldData::EntData
Data on single entity (This is passed as argument to DataOperator::doWork)
Definition: EntitiesFieldData.hpp:128
EXECUTABLE_DIMENSION
#define EXECUTABLE_DIMENSION
Definition: plastic.cpp:13
OpGradTimesPerm::commonDataPtr
boost::shared_ptr< DataAtIntegrationPts > commonDataPtr
Definition: electrostatics.hpp:295
DataAtIntegrationPts::blockPermittivity
double blockPermittivity
Definition: electrostatics.hpp:60
OpTotalEnergy::doWork
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Definition: electrostatics.hpp:150
OpElectricDispJump::djump
boost::shared_ptr< MatrixDouble > djump
Definition: electrostatics.hpp:350
SPACE_DIM
constexpr int SPACE_DIM
Definition: electrostatics.hpp:10
OpElectrodeCharge::dJumpPtr
boost::shared_ptr< MatrixDouble > dJumpPtr
Definition: electrostatics.hpp:401
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
OpElectricDispJump::OpElectricDispJump
OpElectricDispJump(const std::string field_name, boost::shared_ptr< MatrixDouble > grad_ptr, boost::shared_ptr< MatrixDouble > d_jump, boost::shared_ptr< DataAtIntegrationPts > common_data_ptr, boost::shared_ptr< std::map< int, BlockData >> perm_block_sets_ptr)
Definition: electrostatics.hpp:301
OpElectrodeCharge::OpElectrodeCharge
OpElectrodeCharge(const std::string field_name, boost::shared_ptr< MatrixDouble > d_jump, SmartPetscObj< Vec > alpha_vec, boost::shared_ptr< std::map< int, BlockData >> electrode_block_sets_ptr)
Definition: electrostatics.hpp:358
MoFEM::PipelineManager::ElementsAndOpsByDim
Definition: PipelineManager.hpp:38
BlockData::chargeDensity
double chargeDensity
Definition: electrostatics.hpp:50
OpBodySourceVectorb
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< BASE_DIM, FIELD_DIM > OpBodySourceVectorb
Definition: electrostatics.hpp:45
MoFEM::CoreInterface::get_comm
virtual MPI_Comm & get_comm() const =0
BlockData::interfaceEnts
Range interfaceEnts
Definition: electrostatics.hpp:52
OpBlockPermittivity::commonDataPtr
boost::shared_ptr< DataAtIntegrationPts > commonDataPtr
Definition: electrostatics.hpp:131
IntElementForcesAndSourcesCore
intPostProc< SPACE_DIM >::intEle IntElementForcesAndSourcesCore
Definition: electrostatics.hpp:35
OpGradGrad
FormsIntegrators< DomainEleOp >::Assembly< A >::BiLinearForm< I >::OpGradGrad< 1, FIELD_DIM, SPACE_DIM > OpGradGrad
Definition: operators_tests.cpp:44
OpElectricField::doWork
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
Definition: electrostatics.hpp:412
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
OpInterfaceRhsVectorF
FormsIntegrators< IntEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< BASE_DIM, FIELD_DIM > OpInterfaceRhsVectorF
Definition: electrostatics.hpp:43
OpEnergyDensity::OpEnergyDensity
OpEnergyDensity(const std::string &field_name, boost::shared_ptr< MatrixDouble > grad_u_negative, boost::shared_ptr< VectorDouble > energy_densiity_ptr, boost::shared_ptr< std::map< int, BlockData >> perm_block_sets_ptr, boost::shared_ptr< DataAtIntegrationPts > common_data_ptr)
Definition: electrostatics.hpp:197
OpGradTimesPerm::gradTimesPerm
boost::shared_ptr< MatrixDouble > gradTimesPerm
Definition: electrostatics.hpp:293
OpTotalEnergy::OpTotalEnergy
OpTotalEnergy(const std::string &field_name, boost::shared_ptr< MatrixDouble > grad_u_negative, boost::shared_ptr< std::map< int, BlockData >> perm_block_sets_ptr, boost::shared_ptr< std::map< int, BlockData >> int_domain_block_sets_ptr, boost::shared_ptr< DataAtIntegrationPts > common_data_ptr, SmartPetscObj< Vec > petsc_vec_energy)
Definition: electrostatics.hpp:136
OpElectrodeCharge
Definition: electrostatics.hpp:357
OpTotalEnergy::petscTotalEnergy
SmartPetscObj< Vec > petscTotalEnergy
Definition: electrostatics.hpp:192
MoFEM::CoreInterface::get_comm_rank
virtual int get_comm_rank() const =0
domainField
constexpr auto domainField
Definition: electrostatics.hpp:7
MoFEM::PETSC
@ PETSC
Definition: FormsIntegrators.hpp:105
MoFEM.hpp
OpElectricField::gradUNegative
boost::shared_ptr< MatrixDouble > gradUNegative
Definition: electrostatics.hpp:433
OpGradTimesPerm::OpGradTimesPerm
OpGradTimesPerm(const std::string &field_name, boost::shared_ptr< MatrixDouble > grad_u_negative, boost::shared_ptr< MatrixDouble > grad_times_perm, boost::shared_ptr< std::map< int, BlockData >> perm_block_sets_ptr, boost::shared_ptr< DataAtIntegrationPts > common_data_ptr)
Definition: electrostatics.hpp:249
FIELD_DIM
constexpr int FIELD_DIM
Definition: electrostatics.hpp:9
MoFEM::VecSetValues
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
Definition: EntitiesFieldData.hpp:1589
OpEnergyDensity::gradUNegative
boost::shared_ptr< MatrixDouble > gradUNegative
Definition: electrostatics.hpp:241
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
I
constexpr IntegrationType I
Definition: operators_tests.cpp:31
OpTotalEnergy::permBlockSetsPtr
boost::shared_ptr< std::map< int, BlockData > > permBlockSetsPtr
Definition: electrostatics.hpp:189
OpBlockChargeDensity::commonDataPtr
boost::shared_ptr< DataAtIntegrationPts > commonDataPtr
Definition: electrostatics.hpp:99
SideEleOp
OpElectricDispJump
Definition: electrostatics.hpp:300
MoFEM::PostProcBrokenMeshInMoab
Definition: PostProcBrokenMeshInMoabBase.hpp:667
OpBlockChargeDensity::intBlockSetsPtr
boost::shared_ptr< std::map< int, BlockData > > intBlockSetsPtr
Definition: electrostatics.hpp:100
OpElectrodeCharge::doWork
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Definition: electrostatics.hpp:367
OpElectricDispJump::permBlockSetsPtr
boost::shared_ptr< std::map< int, BlockData > > permBlockSetsPtr
Definition: electrostatics.hpp:351
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
DataAtIntegrationPts::petscVec
SmartPetscObj< Vec > petscVec
Definition: electrostatics.hpp:59
bodySource
const double bodySource
Definition: electrostatics.hpp:11
MoFEM::createGhostVector
auto createGhostVector(MPI_Comm comm, PetscInt n, PetscInt N, PetscInt nghost, const PetscInt ghosts[])
Create smart ghost vector.
Definition: PetscSmartObj.hpp:179
OpBlockPermittivity::permBlockSetsPtr
boost::shared_ptr< map< int, BlockData > > permBlockSetsPtr
Definition: electrostatics.hpp:130
OpTotalEnergy
Definition: electrostatics.hpp:135
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
OpElectricDispJump::commonDataPtr
boost::shared_ptr< DataAtIntegrationPts > commonDataPtr
Definition: electrostatics.hpp:352
OpBlockChargeDensity
Definition: electrostatics.hpp:74
MoFEM::ForcesAndSourcesCore::UserDataOperator
Definition: ForcesAndSourcesCore.hpp:549
OpElectricDispJump::doWork
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Definition: electrostatics.hpp:315
convert.type
type
Definition: convert.py:64
OpBlockPermittivity::doWork
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
Definition: electrostatics.hpp:115
MoFEM::FormsIntegrators::Assembly
Assembly methods.
Definition: FormsIntegrators.hpp:317
OpBlockPermittivity::OpBlockPermittivity
OpBlockPermittivity(boost::shared_ptr< DataAtIntegrationPts > common_data_ptr, boost::shared_ptr< map< int, BlockData >> perm_block_sets_ptr, const std::string &field_name)
Definition: electrostatics.hpp:105
OpDomainLhsMatrixK
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradGrad< BASE_DIM, FIELD_DIM, SPACE_DIM > OpDomainLhsMatrixK
Definition: electrostatics.hpp:40
MoFEM::getFTensor0FromVec
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
DataAtIntegrationPts::DataAtIntegrationPts
DataAtIntegrationPts()
Definition: HookeElement.hpp:96
OpGradTimesPerm
Definition: electrostatics.hpp:247
OpEnergyDensity::energyDensity
boost::shared_ptr< VectorDouble > energyDensity
Definition: electrostatics.hpp:242
SideEle
ElementsAndOps< SPACE_DIM >::SideEle SideEle
Definition: plastic.cpp:61
OpElectricField
Definition: electrostatics.hpp:406
MoFEM::GAUSS
@ GAUSS
Definition: FormsIntegrators.hpp:136
OpTotalEnergy::commonDataPtr
boost::shared_ptr< DataAtIntegrationPts > commonDataPtr
Definition: electrostatics.hpp:191
MoFEM::FaceElementForcesAndSourcesCore
Face finite element.
Definition: FaceElementForcesAndSourcesCore.hpp:23
OpEnergyDensity
Definition: electrostatics.hpp:195
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
BlockData::domainEnts
Range domainEnts
Definition: electrostatics.hpp:53
BiLinearForm
intPostProc
Definition: electrostatics.hpp:25
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
FTensor::Index
Definition: Index.hpp:23
FTensor::Tensor1::normalize
Tensor1< T, Tensor_Dim > normalize()
Definition: Tensor1_value.hpp:77
convert.n
n
Definition: convert.py:82
OpTotalEnergy::gradUNegative
boost::shared_ptr< MatrixDouble > gradUNegative
Definition: electrostatics.hpp:188
IntEleOp
MoFEM::ForcesAndSourcesCore
structure to get information form mofem into EntitiesFieldData
Definition: ForcesAndSourcesCore.hpp:22
OpEnergyDensity::commonDataPtr
boost::shared_ptr< DataAtIntegrationPts > commonDataPtr
Definition: electrostatics.hpp:244
OpElectricField::gradU
boost::shared_ptr< MatrixDouble > gradU
Definition: electrostatics.hpp:434
OpElectricDispJump::gradPtr
boost::shared_ptr< MatrixDouble > gradPtr
Definition: electrostatics.hpp:349
Range
EntData
EntitiesFieldData::EntData EntData
Definition: electrostatics.hpp:18
DomainEleOp
OpGradTimesPerm::gradUNegative
boost::shared_ptr< MatrixDouble > gradUNegative
Definition: electrostatics.hpp:292
OpBlockChargeDensity::OpBlockChargeDensity
OpBlockChargeDensity(boost::shared_ptr< DataAtIntegrationPts > common_data_ptr, boost::shared_ptr< std::map< int, BlockData >> int_block_sets_ptr, const std::string &field_name)
Definition: electrostatics.hpp:75
UserDataOperator
ForcesAndSourcesCore::UserDataOperator UserDataOperator
Definition: HookeElement.hpp:75
OpBlockPermittivity
Definition: electrostatics.hpp:103
DataAtIntegrationPts::DataAtIntegrationPts
DataAtIntegrationPts(MoFEM::Interface &m_field)
Definition: electrostatics.hpp:62
MoFEM::BlockData
Definition: MeshsetsManager.cpp:755
OpElectrodeCharge::petscVec
SmartPetscObj< Vec > petscVec
Definition: electrostatics.hpp:403
OpElectricField::OpElectricField
OpElectricField(boost::shared_ptr< MatrixDouble > grad_u_negative, boost::shared_ptr< MatrixDouble > grad_u)
Definition: electrostatics.hpp:407
DataAtIntegrationPts::blockChrgDens
double blockChrgDens
Definition: electrostatics.hpp:61
OpEnergyDensity::permBlockSetsPtr
boost::shared_ptr< std::map< int, BlockData > > permBlockSetsPtr
Definition: electrostatics.hpp:243
OpEnergyDensity::doWork
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
Definition: electrostatics.hpp:210
IntEle
PipelineManager::ElementsAndOpsByDim< SPACE_DIM >::BoundaryEle IntEle
Definition: electrostatics.hpp:15
MoFEM::BlockData::iD
int iD
Definition: MeshsetsManager.cpp:759
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
OpGradTimesPerm::doWork
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
Definition: electrostatics.hpp:262
DomainEle
ElementsAndOps< SPACE_DIM >::DomainEle DomainEle
Definition: child_and_parent.cpp:34
OpTotalEnergy::intDomainBlocksetsPtr
boost::shared_ptr< std::map< int, BlockData > > intDomainBlocksetsPtr
Definition: electrostatics.hpp:190
MoFEM::SmartPetscObj< Vec >
BlockData::internalDomainEnts
Range internalDomainEnts
Definition: electrostatics.hpp:55
BlockData::epsPermit
double epsPermit
Definition: electrostatics.hpp:51
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
OpGradTimesPerm::permBlockSetsPtr
boost::shared_ptr< std::map< int, BlockData > > permBlockSetsPtr
Definition: electrostatics.hpp:294
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
OpElectrodeCharge::elecBlockSetsPtr
boost::shared_ptr< std::map< int, BlockData > > elecBlockSetsPtr
Definition: electrostatics.hpp:402
BlockData::electrodeEnts
Range electrodeEnts
Definition: electrostatics.hpp:54
BASE_DIM
constexpr int BASE_DIM
Definition: electrostatics.hpp:8
MoFEM::PostProcBrokenMeshInMoab< FaceElementForcesAndSourcesCore >
Definition: PostProcBrokenMeshInMoabBase.hpp:677