space_time_unsteady_heat_elements.cc
Go to the documentation of this file.
1// LIC// ====================================================================
2// LIC// This file forms part of oomph-lib, the object-oriented,
3// LIC// multi-physics finite-element library, available
4// LIC// at http://www.oomph-lib.org.
5// LIC//
6// LIC// Copyright (C) 2006-2025 Matthias Heil and Andrew Hazel
7// LIC//
8// LIC// This library is free software; you can redistribute it and/or
9// LIC// modify it under the terms of the GNU Lesser General Public
10// LIC// License as published by the Free Software Foundation; either
11// LIC// version 2.1 of the License, or (at your option) any later version.
12// LIC//
13// LIC// This library is distributed in the hope that it will be useful,
14// LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16// LIC// Lesser General Public License for more details.
17// LIC//
18// LIC// You should have received a copy of the GNU Lesser General Public
19// LIC// License along with this library; if not, write to the Free Software
20// LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21// LIC// 02110-1301 USA.
22// LIC//
23// LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
24// LIC//
25// LIC//====================================================================
26// Non-inline functions for SpaceTimeUnsteadyHeat elements
28
29/////////////////////////////////////////////////////////////////////////
30/////////////////////////////////////////////////////////////////////////
31/////////////////////////////////////////////////////////////////////////
32
33namespace oomph
34{
35 //======================================================================
36 // Default parameters
37 //======================================================================
38 /// Default value for Alpha parameter (thermal inertia)
39 template<unsigned SPATIAL_DIM>
41 1.0;
42
43 /// Default value for Beta parameter (thermal conductivity)
44 template<unsigned SPATIAL_DIM>
46 1.0;
47
48 //======================================================================
49 // Set the data for the number of variables at each node
50 //======================================================================
51 template<unsigned SPATIAL_DIM, unsigned NNODE_1D>
52 const unsigned
54
55 //======================================================================
56 /// Compute element residual vector and/or element Jacobian matrix
57 ///
58 /// flag=0: compute only residual vector
59 /// flag=1: compute both
60 ///
61 /// Pure version without hanging nodes
62 //======================================================================
63 template<unsigned SPATIAL_DIM>
67 DenseMatrix<double>& jacobian,
68 const unsigned& flag)
69 {
70 // Find out how many nodes there are
71 unsigned n_node = nnode();
72
73 // Find the index at which the variable is stored
74 unsigned u_nodal_index = u_index_ust_heat();
75
76 // Set up memory for the shape functions
78
79 // Set up memory for the test functions
81
82 // Allocate space for the derivatives of the shape functions
84
85 // Allocate space for the derivatives of the test functions
87
88 // Set the value of n_intpt
89 unsigned n_intpt = integral_pt()->nweight();
90
91 // Storage for the local coordinates
93
94 // Get the Alpha parameter
95 double alpha_local = alpha();
96
97 // Get the Beta parameter
98 double beta_local = beta();
99
100 // Integer to hold the local equation
101 int local_eqn = 0;
102
103 // Integer to hold the local unknowns
104 int local_unknown = 0;
105
106 // Loop over the integration points
107 for (unsigned ipt = 0; ipt < n_intpt; ipt++)
108 {
109 // Assign values of s
110 for (unsigned i = 0; i < SPATIAL_DIM + 1; i++)
111 {
112 // Calculate the i-th local coordinate
113 s[i] = integral_pt()->knot(ipt, i);
114 }
115
116 // Get the integral weight
117 double w = integral_pt()->weight(ipt);
118
119 // Call the derivatives of the shape and test functions
120 double J = dshape_and_dtest_eulerian_at_knot_ust_heat(
122
123 // Premultiply the weights and the Jacobian
124 double W = w * J;
125
126 // Storage for the interpolated time value
127 double interpolated_t = 0.0;
128
129 // Storage for the interpolated solution value
130 double interpolated_u = 0.0;
131
132 // Storage for the interpolated time-derivative of the solution
133 double interpolated_dudt = 0.0;
134
135 // Storage for the spatial coordinates
137
138 // Storage for the spatial derivatives of the solution
139 Vector<double> interpolated_dudx(SPATIAL_DIM, 0.0);
140
141 // Storage for the mesh velocity
143
144 //-------------------------------------------------
145 // Calculate derivatives and source function value:
146 //-------------------------------------------------
147 // Loop over the nodes
148 for (unsigned l = 0; l < n_node; l++)
149 {
150 // Get the nodal value at the l-th node
152
153 // Update the interpolated time value
155
156 // Loop over the coordinate directions (both spatial AND time)
157 for (unsigned j = 0; j < SPATIAL_DIM; j++)
158 {
159 // Update the interpolated x value
161
162 // Update the interpolated du/dx_j value
163 interpolated_dudx[j] += u_value * dpsidx(l, j);
164 }
165
166 // Update the interpolated u value
167 interpolated_u += u_value * psi(l);
168
169 // Update the interpolated du/dt value
171 } // for (unsigned l=0;l<n_node;l++)
172
173 // Initialise the source term value
174 double source = 0.0;
175
176 // Get the interpolated source term value
177 get_source_ust_heat(interpolated_t, ipt, interpolated_x, source);
178
179 //---------------------------------
180 // Assemble residuals and Jacobian:
181 //---------------------------------
182 // Loop over the nodes (or equivalently the test functions)
183 for (unsigned l = 0; l < n_node; l++)
184 {
185 // Get the local equation number
187
188 // If it's not a boundary condition
189 if (local_eqn >= 0)
190 {
191 // Add source term and time derivative
193 (source + alpha_local * interpolated_dudt) * test(l) * W;
194
195 // Loop over the coordinate directions
196 for (unsigned k = 0; k < SPATIAL_DIM; k++)
197 {
198 // Add in the contribution from the Laplace operator
200 beta_local * interpolated_dudx[k] * dtestdx(l, k) * W;
201 }
202
203 //------------------------
204 // Calculate the Jacobian:
205 //------------------------
206 // If we also need to construct the Jacobian
207 if (flag)
208 {
209 // Loop over the velocity shape functions again
210 for (unsigned l2 = 0; l2 < n_node; l2++)
211 {
212 // Get the local equation number
214
215 // If we're at a non-zero degree of freedom add in the entry
216 if (local_unknown >= 0)
217 {
218 // Add in the time derivative contribution
219 jacobian(local_eqn, local_unknown) +=
220 (alpha_local * test(l) * dpsidx(l2, SPATIAL_DIM) * W);
221
222 // Laplace operator
223 for (unsigned i = 0; i < SPATIAL_DIM; i++)
224 {
225 // Add the test function contribution to the Jacobian
226 jacobian(local_eqn, local_unknown) +=
227 (beta_local * dpsidx(l2, i) * dtestdx(l, i) * W);
228 }
229 } // if (local_unknown>=0)
230 } // for (unsigned l2=0;l2<n_node;l2++)
231 } // if (flag)
232 } // if (local_eqn>=0)
233 } // for (unsigned l=0;l<n_node;l++)
234 } // for (unsigned ipt=0;ipt<n_intpt;ipt++)
235 } // End of fill_in_generic_residual_contribution_ust_heat
236
237 //======================================================================
238 /// Compute norm of FE solution
239 //======================================================================
240 template<unsigned SPATIAL_DIM>
242 {
243 // Initialise
244 norm = 0.0;
245
246 // Vector of local coordinates
247 Vector<double> s(SPATIAL_DIM + 1, 0.0);
248
249 // Vector for coordinates
250 Vector<double> x(SPATIAL_DIM + 1, 0.0);
251
252 // Find out how many nodes there are in the element
253 unsigned n_node = nnode();
254
255 // Allocate memory for the shape and test functions
257
258 // Set the value of n_intpt
259 unsigned n_intpt = integral_pt()->nweight();
260
261 // Loop over the integration points
262 for (unsigned ipt = 0; ipt < n_intpt; ipt++)
263 {
264 // Assign values of s
265 for (unsigned i = 0; i < SPATIAL_DIM + 1; i++)
266 {
267 // Get the i-th local coordinate at the ipt-th integration point
268 s[i] = integral_pt()->knot(ipt, i);
269 }
270
271 // Get the integral weight
272 double w = integral_pt()->weight(ipt);
273
274 // Get Jacobian of mapping
275 double J = J_eulerian(s);
276
277 // Pre-multiply the weights and the Jacobian
278 double W = w * J;
279
280 // Get FE function value
281 double u = interpolated_u_ust_heat(s);
282
283 // Update the norm value
284 norm += u * u * W;
285 } // for (unsigned ipt=0;ipt<n_intpt;ipt++)
286 } // End of compute_norm
287
288 //======================================================================
289 /// Self-test: Return 0 for OK
290 //======================================================================
291 template<unsigned SPATIAL_DIM>
293 {
294 // Initialise the boolean variable
295 bool passed = true;
296
297 // Check lower-level stuff
298 if (FiniteElement::self_test() != 0)
299 {
300 // If we get here then the lower-level self-tests did not pass
301 passed = false;
302 }
303
304 // If the self-tests passed
305 if (passed)
306 {
307 // Return the value zero
308 return 0;
309 }
310 // If the self-tests didn't pass
311 else
312 {
313 // Return the value one
314 return 1;
315 }
316 } // End of self_test
317
318 //======================================================================
319 /// Output function:
320 /// x,t,u or x,y,t,u
321 /// at nplot points in each coordinate direction
322 //======================================================================
323 template<unsigned SPATIAL_DIM>
325 std::ostream& outfile, const unsigned& nplot)
326 {
327 // Vector of local coordinates
328 Vector<double> s(SPATIAL_DIM + 1, 0.0);
329
330 // Tecplot header info
332
333 // Get the number of plot points
335
336 // Loop over plot points
337 for (unsigned iplot = 0; iplot < num_plot_points; iplot++)
338 {
339 // Get local coordinates of plot point
341
342 // Loop over the coordinate directions
343 for (unsigned i = 0; i < SPATIAL_DIM + 1; i++)
344 {
345 // Output the interpolated coordinate
346 outfile << interpolated_x(s, i) << " ";
347 }
348
349 // Calculate the interpolated solution value
350 outfile << interpolated_u_ust_heat(s) << std::endl;
351 } // for (unsigned iplot=0;iplot<num_plot_points;iplot++)
352
353 // Write tecplot footer (e.g. FE connectivity lists)
355 } // End of output
356
357 //======================================================================
358 /// C-style output function:
359 /// x,t,u or x,y,t,u
360 /// at nplot points in each coordinate direction
361 //======================================================================
362 template<unsigned SPATIAL_DIM>
364 FILE* file_pt, const unsigned& nplot)
365 {
366 // Vector of local coordinates
367 Vector<double> s(SPATIAL_DIM + 1, 0.0);
368
369 // Tecplot header info
371
372 // Get the number of plot points
374
375 // Loop over plot points
376 for (unsigned iplot = 0; iplot < num_plot_points; iplot++)
377 {
378 // Get local coordinates of plot point
380
381 // Loop over the coordinate directions
382 for (unsigned i = 0; i < SPATIAL_DIM + 1; i++)
383 {
384 // Print the i-th coordinate value at local coordinate s
385 fprintf(file_pt, "%g ", interpolated_x(s, i));
386 }
387
388 // Output the interpolated solution value at local coordinate s
389 fprintf(file_pt, "%g \n", interpolated_u_ust_heat(s));
390 } // for (unsigned iplot=0;iplot<num_plot_points;iplot++)
391
392 // Write tecplot footer (e.g. FE connectivity lists)
394 } // End of output
395
396 //======================================================================
397 /// Output exact solution at a given number of plot points:
398 /// x,t,u_exact or x,y,t,u_exact
399 /// Solution is provided via function pointer.
400 //======================================================================
401 template<unsigned SPATIAL_DIM>
403 std::ostream& outfile,
404 const unsigned& nplot,
406 {
407 // Vector of local coordinates
408 Vector<double> s(SPATIAL_DIM + 1, 0.0);
409
410 // Vector for spatial coordinates
412
413 // Tecplot header info
415
416 // Exact solution vector (here it's simply a scalar)
418
419 // Get the number of plot points
421
422 // Loop over plot points
423 for (unsigned iplot = 0; iplot < num_plot_points; iplot++)
424 {
425 // Get local coordinates of plot point
427
428 // Loop over the spatial coordinates
429 for (unsigned i = 0; i < SPATIAL_DIM; i++)
430 {
431 // Assign the i-th spatial coordinate
433
434 // Output the i-th coordinate at the point
435 outfile << spatial_coordinates[i] << " ";
436 }
437
438 // Output the time value at this point
440
441 // Get the exact solution at this point
442 (*exact_soln_pt)(spatial_coordinates, exact_soln);
443
444 // Output the exact solution at this point
445 outfile << exact_soln[0] << std::endl;
446 } // for (unsigned iplot=0;iplot<num_plot_points;iplot++)
447
448 // Write tecplot footer (e.g. FE connectivity lists)
450 } // End of output_fct
451
452 //======================================================================
453 /// Output exact solution at a given number of plot points:
454 /// x,t,u_exact or x,y,t,u_exact
455 /// Solution is provided via function pointer.
456 //======================================================================
457 template<unsigned SPATIAL_DIM>
459 std::ostream& outfile,
460 const unsigned& nplot,
461 const double& time,
463 {
464 // Storage for the time value
465 double interpolated_t = 0.0;
466
467 // Vector of local coordinates
468 Vector<double> s(SPATIAL_DIM + 1, 0.0);
469
470 // Vector for spatial coordinates
472
473 // Tecplot header info
475
476 // Exact solution vector (here it's simply a scalar)
478
479 // Get the number of plot points
481
482 // Loop over plot points
483 for (unsigned iplot = 0; iplot < num_plot_points; iplot++)
484 {
485 // Get local coordinates of plot point
487
488 // Loop over the spatial coordinates
489 for (unsigned i = 0; i < SPATIAL_DIM; i++)
490 {
491 // Assign the i-th spatial coordinate
493
494 // Output the i-th coordinate at the point
495 outfile << spatial_coordinates[i] << " ";
496 }
497
498 // Get the time value
500
501 // Output the time value at this point
502 outfile << interpolated_t << " ";
503
504 // Get the exact solution at this point
506
507 // Output the exact solution at this point
508 outfile << exact_soln[0] << std::endl;
509 } // for (unsigned iplot=0;iplot<num_plot_points;iplot++)
510
511 // Write tecplot footer (e.g. FE connectivity lists)
513 } // End of output_fct
514
515 //======================================================================
516 /// Validate against exact solution
517 ///
518 /// Solution is provided via function pointer.
519 /// Plot error at a given number of plot points.
520 //======================================================================
521 template<unsigned SPATIAL_DIM>
523 std::ostream& outfile,
525 double& error,
526 double& norm)
527 {
528 // Initialise error value
529 error = 0.0;
530
531 // Initialise norm value
532 norm = 0.0;
533
534 // Vector of local coordinates
535 Vector<double> s(SPATIAL_DIM + 1, 0.0);
536
537 // Vector for spatial coordinates
539
540 // Find out how many nodes there are in the element
541 unsigned n_node = nnode();
542
543 // Initialise shape functions
545
546 // Set the value of n_intpt
547 unsigned n_intpt = integral_pt()->nweight();
548
549 // Tecplot header info
550 outfile << "ZONE" << std::endl;
551
552 // Exact solution vector (here it's simply a scalar)
554
555 // Loop over the integration points
556 for (unsigned ipt = 0; ipt < n_intpt; ipt++)
557 {
558 // Assign values of s
559 for (unsigned i = 0; i < SPATIAL_DIM + 1; i++)
560 {
561 // Get the i-th local coordinate at the ipt-th integration point
562 s[i] = integral_pt()->knot(ipt, i);
563 }
564
565 // Get the integral weight
566 double w = integral_pt()->weight(ipt);
567
568 // Get jacobian of mapping
569 double J = J_eulerian(s);
570
571 // Premultiply the weights and the Jacobian
572 double W = w * J;
573
574 // Get FE function value
575 double u_fe = interpolated_u_ust_heat(s);
576
577 // Loop over the spatial coordinates
578 for (unsigned i = 0; i < SPATIAL_DIM; i++)
579 {
580 // Assign the i-th spatial coordinate
582
583 // Output the i-th coordinate at the point
584 outfile << spatial_coordinates[i] << " ";
585 }
586
587 // Output the i-th coordinate at this point
589
590 // Get exact solution at this point
591 (*exact_soln_pt)(spatial_coordinates, exact_soln);
592
593 // Output the error
594 outfile << exact_soln[0] << " " << exact_soln[0] - u_fe << std::endl;
595
596 // Add to (exact) solution norm value
597 norm += exact_soln[0] * exact_soln[0] * W;
598
599 // Update the error norm value
600 error += (exact_soln[0] - u_fe) * (exact_soln[0] - u_fe) * W;
601 } // for (unsigned ipt=0;ipt<n_intpt;ipt++)
602 } // End of compute_error
603
604 //======================================================================
605 /// Validate against exact solution at time t.
606 ///
607 /// Solution is provided via function pointer.
608 /// Plot error at a given number of plot points.
609 //======================================================================
610 template<unsigned SPATIAL_DIM>
612 std::ostream& outfile,
614 const double& time,
615 double& error,
616 double& norm)
617 {
618 // Initialise error value
619 error = 0.0;
620
621 // Initialise norm value
622 norm = 0.0;
623
624 // Storage for the time value
625 double interpolated_t = 0.0;
626
627 // Vector of local coordinates
628 Vector<double> s(SPATIAL_DIM + 1, 0.0);
629
630 // Vector for spatial coordinates
632
633 // Find out how many nodes there are in the element
634 unsigned n_node = nnode();
635
636 // Initialise shape functions
638
639 // Set the value of n_intpt
640 unsigned n_intpt = integral_pt()->nweight();
641
642 // Tecplot header info
643 outfile << "ZONE" << std::endl;
644
645 // Exact solution vector (here it's simply a scalar)
647
648 // Loop over the integration points
649 for (unsigned ipt = 0; ipt < n_intpt; ipt++)
650 {
651 // Assign values of s
652 for (unsigned i = 0; i < SPATIAL_DIM + 1; i++)
653 {
654 s[i] = integral_pt()->knot(ipt, i);
655 }
656
657 // Get the integral weight
658 double w = integral_pt()->weight(ipt);
659
660 // Get jacobian of mapping
661 double J = J_eulerian(s);
662
663 // Premultiply the weights and the Jacobian
664 double W = w * J;
665
666 // Get FE function value
667 double u_fe = interpolated_u_ust_heat(s);
668
669 // Loop over the spatial coordinates
670 for (unsigned i = 0; i < SPATIAL_DIM; i++)
671 {
672 // Assign the i-th spatial coordinate
674
675 // Output the i-th coordinate at the point
676 outfile << spatial_coordinates[i] << " ";
677 }
678
679 // Get the time value
681
682 // Output the time value at this point
683 outfile << interpolated_t << " ";
684
685 // Get the exact solution at this point
687
688 // Output the error
689 outfile << exact_soln[0] << " " << exact_soln[0] - u_fe << std::endl;
690
691 // Add to (exact) solution norm value
692 norm += exact_soln[0] * exact_soln[0] * W;
693
694 // Update the error norm value
695 error += (exact_soln[0] - u_fe) * (exact_soln[0] - u_fe) * W;
696 } // for (unsigned ipt=0;ipt<n_intpt;ipt++)
697 } // End of compute_error
698
699 //======================================================================
700 /// Output function:
701 /// x,t,u or x,y,t,u
702 /// at nplot points in each coordinate direction
703 //======================================================================
704 template<unsigned SPATIAL_DIM>
706 std::ofstream& file_out, const unsigned& nplot)
707 {
708 // Change the scientific format so that E is used rather than e
709 file_out.setf(std::ios_base::uppercase);
710
711 // Make variables to hold the number of nodes and elements
712 unsigned number_of_nodes = this->nplot_points_paraview(nplot);
713
714 // Make variables to hold the number of elements
715 unsigned total_number_of_elements = this->nsub_elements_paraview(nplot);
716
717 //------------------
718 // File Declaration:
719 //------------------
720 // Insert the necessary lines plus header of file, and
721 // number of nodes and elements
722 file_out << "<?xml version=\"1.0\"?>\n"
723 << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" "
724 << "byte_order=\"LittleEndian\">\n"
725 << "<UnstructuredGrid>\n"
726 << "<Piece NumberOfPoints=\"" << number_of_nodes
727 << "\" NumberOfCells=\"" << total_number_of_elements << "\">\n";
728
729 //------------
730 // Point Data:
731 //------------
732 // Check the number of degrees of freedom
733 unsigned ndof = this->nscalar_paraview();
734
735 // Point data is going in here
736 file_out << "<PointData ";
737
738 // Insert just the first scalar name, since paraview reads everything
739 // else after that as being of the same type. Get information from
740 // first element.
741 file_out << "Scalars=\"" << this->scalar_name_paraview(0) << "\">\n";
742
743 // Loop over i scalar fields and j number of elements
744 for (unsigned i = 0; i < ndof; i++)
745 {
746 file_out << "<DataArray type=\"Float32\" "
747 << "Name=\"" << this->scalar_name_paraview(i) << "\" "
748 << "format=\"ascii\""
749 << ">\n";
750
751 // Output the i-th scalar field with nplot plot points
752 this->scalar_value_paraview(file_out, i, nplot);
753
754 // Close of the DataArray
755 file_out << "</DataArray>\n";
756 }
757
758 // Close off the PointData set
759 file_out << "</PointData>\n";
760
761 //------------------
762 // Geometric Points:
763 //------------------
764 // Always has to be 3 components for an unstructured grid
765 file_out << "<Points>\n"
766 << "<DataArray type=\"Float32\""
767 << " NumberOfComponents=\"" << 3 << "\" "
768 << "format=\"ascii\">\n";
769
770 // Print the plot points
771 this->output_paraview(file_out, nplot);
772
773 // Close off the geometric points set
774 file_out << "</DataArray>\n"
775 << "</Points>\n";
776
777 //-------
778 // Cells:
779 //-------
780 file_out << "<Cells>\n"
781 << "<DataArray type=\"Int32\" Name=\""
782 << "connectivity\" format=\"ascii\">\n";
783
784 // Make counter for keeping track of all the local elements,
785 // because Paraview requires global coordinates
786 unsigned counter = 0;
787
788 // Write connectivity with the local elements
790
791 // Output header stuff
792 file_out << "</DataArray>\n"
793 << "<DataArray type=\"Int32\" "
794 << "Name=\"offsets\" format=\"ascii\">\n";
795
796 // Make variable that holds the current offset number
797 unsigned offset_sum = 0;
798
799 // Write the offset for the specific elements
800 this->write_paraview_offsets(file_out, nplot, offset_sum);
801
802 // Add in header information
803 file_out << "</DataArray>\n"
804 << "<DataArray type=\"UInt8\" Name=\"types\">\n";
805
806 // Get the type the element has
807 this->write_paraview_type(file_out, nplot);
808
809 // Finish off the data set
810 file_out << "</DataArray>\n"
811 << "</Cells>\n";
812
813 //--------------
814 // File Closure:
815 //--------------
816 file_out << "</Piece>\n"
817 << "</UnstructuredGrid>\n"
818 << "</VTKFile>";
819 } // End of output_element_paraview
820
821 //====================================================================
822 // Force build of templates
823 //====================================================================
827
831} // End of namespace oomph
static char t char * s
Definition cfortran.h:568
cstr elem_len * i
Definition cfortran.h:603
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
Definition shape.h:278
virtual void scalar_value_paraview(std::ofstream &file_out, const unsigned &i, const unsigned &nplot) const
Write values of the i-th scalar field at the plot points. Broken virtual. Needs to be implemented for...
Definition elements.h:3005
virtual unsigned nplot_points_paraview(const unsigned &nplot) const
Return the number of actual plot points for paraview plot with parameter nplot. Broken virtual; can b...
Definition elements.h:2866
virtual double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s.
Definition elements.cc:4133
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
Definition elements.h:1967
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction")
Definition elements.h:3165
virtual std::string scalar_name_paraview(const unsigned &i) const
Name of the i-th scalar field. Default implementation returns V1 for the first one,...
Definition elements.h:3047
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
Definition elements.cc:3992
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Return the local equation number corresponding to the i-th value at the n-th local node.
Definition elements.h:1436
unsigned nnode() const
Return the number of nodes.
Definition elements.h:2214
virtual void write_paraview_type(std::ofstream &file_out, const unsigned &nplot) const
Return the paraview element type. Broken virtual. Needs to be implemented for each new geometric elem...
Definition elements.h:2968
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as .
Definition elements.h:1763
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Get cector of local coordinates of plot point i (when plotting nplot points in each "coordinate direc...
Definition elements.h:3152
virtual unsigned nscalar_paraview() const
Number of scalars/fields output by this element. Broken virtual. Needs to be implemented for each new...
Definition elements.h:2992
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction")
Definition elements.h:3190
virtual unsigned nsub_elements_paraview(const unsigned &nplot) const
Return the number of local sub-elements for paraview plot with parameter nplot. Broken virtual; can b...
Definition elements.h:2880
double raw_nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n but do NOT take hanging nodes into account.
Definition elements.h:2580
double raw_nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. Do not use the hanging node representation....
Definition elements.cc:1714
virtual void write_tecplot_zone_footer(std::ostream &outfile, const unsigned &nplot) const
Add tecplot zone "footer" to output stream (when plotting nplot points in each "coordinate direction"...
Definition elements.h:3178
void output_paraview(std::ofstream &file_out, const unsigned &nplot) const
Paraview output – this outputs the coordinates at the plot points (for parameter nplot) to specified ...
Definition elements.h:2893
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as .
Definition elements.h:1769
virtual void write_paraview_offsets(std::ofstream &file_out, const unsigned &nplot, unsigned &offset_sum) const
Return the offsets for the paraview sub-elements. Broken virtual. Needs to be implemented for each ne...
Definition elements.h:2980
virtual unsigned self_test()
Self-test: Check inversion of element & do self-test for GeneralisedElement. Return 0 if OK.
Definition elements.cc:4470
virtual void write_paraview_output_offset_information(std::ofstream &file_out, const unsigned &nplot, unsigned &counter) const
Fill in the offset information for paraview plot. Broken virtual. Needs to be implemented for each ne...
Definition elements.h:2956
unsigned ndof() const
Return the number of equations/dofs in the element.
Definition elements.h:822
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
static const unsigned Initial_Nvalue
Static array of ints to hold number of variables at nodes: Initial_Nvalue[n].
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
Definition shape.h:76
void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact soln: x,y,u_exact or x,y,z,u_exact at nplot^SPATIAL_DIM plot points.
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Get error and norm against exact solution.
void compute_norm(double &norm)
Compute norm of FE solution.
static double Default_beta_parameter
Static default value for the Beta parameter (thermal conductivity): One for natural scaling.
void output(std::ostream &outfile)
Output with default number of plot points.
virtual void fill_in_generic_residual_contribution_ust_heat(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Compute element residual Vector only (if flag=and/or element Jacobian matrix.
void output_element_paraview(std::ofstream &outfile, const unsigned &nplot)
C-style output FE representation of soln: x,y,u or x,y,z,u at nplot^SPATIAL_DIM plot points.
static double Default_alpha_parameter
Static default value for the Alpha parameter (thermal inertia): One for natural scaling.
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
TAdvectionDiffusionReactionElement()
Constructor: Call constructors for TElement and AdvectionDiffusionReaction equations.
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).