discontinuous_galerkin_space_time_unsteady_heat_mixed_order_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-2026 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 SpaceTimeUnsteadyHeatMixedOrder 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>
40 double SpaceTimeUnsteadyHeatMixedOrderEquations<
41 SPATIAL_DIM>::Default_alpha_parameter = 1.0;
42
43 /// Default value for Beta parameter (thermal conductivity)
44 template<unsigned SPATIAL_DIM>
45 double SpaceTimeUnsteadyHeatMixedOrderEquations<
46 SPATIAL_DIM>::Default_beta_parameter = 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
53 QUnsteadyHeatMixedOrderSpaceTimeElement<SPATIAL_DIM,
54 NNODE_1D>::Initial_Nvalue = 1;
55
56 //======================================================================
57 /// Compute element residual vector and/or element Jacobian matrix
58 ///
59 /// flag=0: compute only residual vector
60 /// flag=1: compute both
61 ///
62 /// Pure version without hanging nodes
63 //======================================================================
64 template<unsigned SPATIAL_DIM>
68 DenseMatrix<double>& jacobian,
69 const unsigned& flag)
70 {
71 // Find out how many nodes there are
72 unsigned n_node = nnode();
73
74 // Find the index at which the variable is stored
75 unsigned u_nodal_index = u_index_ust_heat();
76
77 // Set up memory for the shape functions
79
80 // Set up memory for the test functions
82
83 // Allocate space for the derivatives of the shape functions
85
86 // Allocate space for the derivatives of the test functions
88
89 // Set the value of n_intpt
90 unsigned n_intpt = integral_pt()->nweight();
91
92 // Storage for the local coordinates
94
95 // Get the Alpha parameter
96 double alpha_local = alpha();
97
98 // Get the Beta parameter
99 double beta_local = beta();
100
101 // Integer to hold the local equation
102 int local_eqn = 0;
103
104 // Integer to hold the local unknowns
105 int local_unknown = 0;
106
107 // Loop over the integration points
108 for (unsigned ipt = 0; ipt < n_intpt; ipt++)
109 {
110 // Assign values of s
111 for (unsigned i = 0; i < SPATIAL_DIM + 1; i++)
112 {
113 // Calculate the i-th local coordinate
114 s[i] = integral_pt()->knot(ipt, i);
115 }
116
117 // Get the integral weight
118 double w = integral_pt()->weight(ipt);
119
120 // Call the derivatives of the shape and test functions
121 double J = dshape_and_dtest_eulerian_at_knot_ust_heat(
123
124 // Premultiply the weights and the Jacobian
125 double W = w * J;
126
127 // Storage for the interpolated time value
128 double interpolated_t = 0.0;
129
130 // Storage for the interpolated solution value
131 double interpolated_u = 0.0;
132
133 // Storage for the interpolated time-derivative of the solution
134 double interpolated_dudt = 0.0;
135
136 // Storage for the spatial coordinates
138
139 // Storage for the spatial derivatives of the solution
140 Vector<double> interpolated_dudx(SPATIAL_DIM, 0.0);
141
142 // Storage for the mesh velocity
144
145 //-------------------------------------------------
146 // Calculate derivatives and source function value:
147 //-------------------------------------------------
148 // Loop over the nodes
149 for (unsigned l = 0; l < n_node; l++)
150 {
151 // Get the nodal value at the l-th node
153
154 // Update the interpolated time value
156
157 // Loop over the coordinate directions (both spatial AND time)
158 for (unsigned j = 0; j < SPATIAL_DIM; j++)
159 {
160 // Update the interpolated x value
162
163 // Update the interpolated du/dx_j value
164 interpolated_dudx[j] += u_value * dpsidx(l, j);
165 }
166
167 // Update the interpolated u value
168 interpolated_u += u_value * psi(l);
169
170 // Update the interpolated du/dt value
172 } // for (unsigned l=0;l<n_node;l++)
173
174 // Initialise the source term value
175 double source = 0.0;
176
177 // Get the interpolated source term value
178 get_source_ust_heat(interpolated_t, ipt, interpolated_x, source);
179
180 //---------------------------------
181 // Assemble residuals and Jacobian:
182 //---------------------------------
183 // Loop over the nodes (or equivalently the test functions)
184 for (unsigned l = 0; l < n_node; l++)
185 {
186 // Get the local equation number
188
189 // If it's not a boundary condition
190 if (local_eqn >= 0)
191 {
192 // Add source term and time derivative
194 (source + alpha_local * interpolated_dudt) * test(l) * W;
195
196 // Loop over the coordinate directions
197 for (unsigned k = 0; k < SPATIAL_DIM; k++)
198 {
199 // Add in the contribution from the Laplace operator
201 beta_local * interpolated_dudx[k] * dtestdx(l, k) * W;
202 }
203
204 //------------------------
205 // Calculate the Jacobian:
206 //------------------------
207 // If we also need to construct the Jacobian
208 if (flag)
209 {
210 // Loop over the velocity shape functions again
211 for (unsigned l2 = 0; l2 < n_node; l2++)
212 {
213 // Get the local equation number
215
216 // If we're at a non-zero degree of freedom add in the entry
217 if (local_unknown >= 0)
218 {
219 // Add in the time derivative contribution
220 jacobian(local_eqn, local_unknown) +=
221 (alpha_local * test(l) * dpsidx(l2, SPATIAL_DIM) * W);
222
223 // Laplace operator
224 for (unsigned i = 0; i < SPATIAL_DIM; i++)
225 {
226 // Add the test function contribution to the Jacobian
227 jacobian(local_eqn, local_unknown) +=
228 (beta_local * dpsidx(l2, i) * dtestdx(l, i) * W);
229 }
230 } // if (local_unknown>=0)
231 } // for (unsigned l2=0;l2<n_node;l2++)
232 } // if (flag)
233 } // if (local_eqn>=0)
234 } // for (unsigned l=0;l<n_node;l++)
235 } // for (unsigned ipt=0;ipt<n_intpt;ipt++)
236 } // End of fill_in_generic_residual_contribution_ust_heat
237
238 //======================================================================
239 /// Compute norm of FE solution
240 //======================================================================
241 template<unsigned SPATIAL_DIM>
243 double& norm)
244 {
245 // Initialise
246 norm = 0.0;
247
248 // Vector of local coordinates
249 Vector<double> s(SPATIAL_DIM + 1, 0.0);
250
251 // Vector for coordinates
252 Vector<double> x(SPATIAL_DIM + 1, 0.0);
253
254 // Set the value of n_intpt
255 unsigned n_intpt = integral_pt()->nweight();
256
257 // Loop over the integration points
258 for (unsigned ipt = 0; ipt < n_intpt; ipt++)
259 {
260 // Assign values of s
261 for (unsigned i = 0; i < SPATIAL_DIM + 1; i++)
262 {
263 // Get the i-th local coordinate at the ipt-th integration point
264 s[i] = integral_pt()->knot(ipt, i);
265 }
266
267 // Get the integral weight
268 double w = integral_pt()->weight(ipt);
269
270 // Get Jacobian of mapping
271 double J = J_eulerian(s);
272
273 // Pre-multiply the weights and the Jacobian
274 double W = w * J;
275
276 // Get FE function value
277 double u = interpolated_u_ust_heat(s);
278
279 // Update the norm value
280 norm += u * u * W;
281 } // for (unsigned ipt=0;ipt<n_intpt;ipt++)
282 } // End of compute_norm
283
284 //======================================================================
285 /// Self-test: Return 0 for OK
286 //======================================================================
287 template<unsigned SPATIAL_DIM>
289 {
290 // Initialise the boolean variable
291 bool passed = true;
292
293 // Check lower-level stuff
294 if (FiniteElement::self_test() != 0)
295 {
296 // If we get here then the lower-level self-tests did not pass
297 passed = false;
298 }
299
300 // If the self-tests passed
301 if (passed)
302 {
303 // Return the value zero
304 return 0;
305 }
306 // If the self-tests didn't pass
307 else
308 {
309 // Return the value one
310 return 1;
311 }
312 } // End of self_test
313
314 //======================================================================
315 /// Output function:
316 /// x,t,u or x,y,t,u
317 /// at nplot points in each coordinate direction
318 //======================================================================
319 template<unsigned SPATIAL_DIM>
321 std::ostream& outfile, const unsigned& nplot)
322 {
323 // Vector of local coordinates
324 Vector<double> s(SPATIAL_DIM + 1, 0.0);
325
326 // Tecplot header info
328
329 // Get the number of plot points
331
332 // Loop over plot points
333 for (unsigned iplot = 0; iplot < num_plot_points; iplot++)
334 {
335 // Get local coordinates of plot point
337
338 // Loop over the coordinate directions
339 for (unsigned i = 0; i < SPATIAL_DIM + 1; i++)
340 {
341 // Output the interpolated coordinate
342 outfile << interpolated_x(s, i) << " ";
343 }
344
345 // Calculate the interpolated solution value
346 outfile << interpolated_u_ust_heat(s) << std::endl;
347 } // for (unsigned iplot=0;iplot<num_plot_points;iplot++)
348
349 // Write tecplot footer (e.g. FE connectivity lists)
351 } // End of output
352
353 //======================================================================
354 /// C-style output function:
355 /// x,t,u or x,y,t,u
356 /// at nplot points in each coordinate direction
357 //======================================================================
358 template<unsigned SPATIAL_DIM>
360 FILE* file_pt, const unsigned& nplot)
361 {
362 // Vector of local coordinates
363 Vector<double> s(SPATIAL_DIM + 1, 0.0);
364
365 // Tecplot header info
367
368 // Get the number of plot points
370
371 // Loop over plot points
372 for (unsigned iplot = 0; iplot < num_plot_points; iplot++)
373 {
374 // Get local coordinates of plot point
376
377 // Loop over the coordinate directions
378 for (unsigned i = 0; i < SPATIAL_DIM + 1; i++)
379 {
380 // Print the i-th coordinate value at local coordinate s
381 fprintf(file_pt, "%g ", interpolated_x(s, i));
382 }
383
384 // Output the interpolated solution value at local coordinate s
385 fprintf(file_pt, "%g \n", interpolated_u_ust_heat(s));
386 } // for (unsigned iplot=0;iplot<num_plot_points;iplot++)
387
388 // Write tecplot footer (e.g. FE connectivity lists)
390 } // End of output
391
392 //======================================================================
393 /// Output exact solution at a given number of plot points:
394 /// x,t,u_exact or x,y,t,u_exact
395 /// Solution is provided via function pointer.
396 //======================================================================
397 template<unsigned SPATIAL_DIM>
399 std::ostream& outfile,
400 const unsigned& nplot,
402 {
403 // Vector of local coordinates
404 Vector<double> s(SPATIAL_DIM + 1, 0.0);
405
406 // Vector for spatial coordinates
408
409 // Tecplot header info
411
412 // Exact solution vector (here it's simply a scalar)
414
415 // Get the number of plot points
417
418 // Loop over plot points
419 for (unsigned iplot = 0; iplot < num_plot_points; iplot++)
420 {
421 // Get local coordinates of plot point
423
424 // Loop over the spatial coordinates
425 for (unsigned i = 0; i < SPATIAL_DIM; i++)
426 {
427 // Assign the i-th spatial coordinate
429
430 // Output the i-th coordinate at the point
431 outfile << spatial_coordinates[i] << " ";
432 }
433
434 // Output the time value at this point
436
437 // Get the exact solution at this point
438 (*exact_soln_pt)(spatial_coordinates, exact_soln);
439
440 // Output the exact solution at this point
441 outfile << exact_soln[0] << std::endl;
442 } // for (unsigned iplot=0;iplot<num_plot_points;iplot++)
443
444 // Write tecplot footer (e.g. FE connectivity lists)
446 } // End of output_fct
447
448 //======================================================================
449 /// Output exact solution at a given number of plot points:
450 /// x,t,u_exact or x,y,t,u_exact
451 /// Solution is provided via function pointer.
452 //======================================================================
453 template<unsigned SPATIAL_DIM>
455 std::ostream& outfile,
456 const unsigned& nplot,
457 const double& time,
459 {
460 // Storage for the time value
461 double interpolated_t = 0.0;
462
463 // Vector of local coordinates
464 Vector<double> s(SPATIAL_DIM + 1, 0.0);
465
466 // Vector for spatial coordinates
468
469 // Tecplot header info
471
472 // Exact solution vector (here it's simply a scalar)
474
475 // Get the number of plot points
477
478 // Loop over plot points
479 for (unsigned iplot = 0; iplot < num_plot_points; iplot++)
480 {
481 // Get local coordinates of plot point
483
484 // Loop over the spatial coordinates
485 for (unsigned i = 0; i < SPATIAL_DIM; i++)
486 {
487 // Assign the i-th spatial coordinate
489
490 // Output the i-th coordinate at the point
491 outfile << spatial_coordinates[i] << " ";
492 }
493
494 // Get the time value
496
497 // Output the time value at this point
498 outfile << interpolated_t << " ";
499
500 // Get the exact solution at this point
502
503 // Output the exact solution at this point
504 outfile << exact_soln[0] << std::endl;
505 } // for (unsigned iplot=0;iplot<num_plot_points;iplot++)
506
507 // Write tecplot footer (e.g. FE connectivity lists)
509 } // End of output_fct
510
511 //======================================================================
512 /// Validate against exact solution
513 ///
514 /// Solution is provided via function pointer.
515 /// Plot error at a given number of plot points.
516 //======================================================================
517 template<unsigned SPATIAL_DIM>
519 std::ostream& outfile,
521 double& error,
522 double& norm)
523 {
524 // Initialise error value
525 error = 0.0;
526
527 // Initialise norm value
528 norm = 0.0;
529
530 // Vector of local coordinates
531 Vector<double> s(SPATIAL_DIM + 1, 0.0);
532
533 // Vector for spatial coordinates
535
536 // Set the value of n_intpt
537 unsigned n_intpt = integral_pt()->nweight();
538
539 // Tecplot header info
540 outfile << "ZONE" << std::endl;
541
542 // Exact solution vector (here it's simply a scalar)
544
545 // Loop over the integration points
546 for (unsigned ipt = 0; ipt < n_intpt; ipt++)
547 {
548 // Assign values of s
549 for (unsigned i = 0; i < SPATIAL_DIM + 1; i++)
550 {
551 // Get the i-th local coordinate at the ipt-th integration point
552 s[i] = integral_pt()->knot(ipt, i);
553 }
554
555 // Get the integral weight
556 double w = integral_pt()->weight(ipt);
557
558 // Get jacobian of mapping
559 double J = J_eulerian(s);
560
561 // Premultiply the weights and the Jacobian
562 double W = w * J;
563
564 // Get FE function value
565 double u_fe = interpolated_u_ust_heat(s);
566
567 // Loop over the spatial coordinates
568 for (unsigned i = 0; i < SPATIAL_DIM; i++)
569 {
570 // Assign the i-th spatial coordinate
572
573 // Output the i-th coordinate at the point
574 outfile << spatial_coordinates[i] << " ";
575 }
576
577 // Output the i-th coordinate at this point
579
580 // Get exact solution at this point
581 (*exact_soln_pt)(spatial_coordinates, exact_soln);
582
583 // Output the error
584 outfile << exact_soln[0] << " " << exact_soln[0] - u_fe << std::endl;
585
586 // Add to (exact) solution norm value
587 norm += exact_soln[0] * exact_soln[0] * W;
588
589 // Update the error norm value
590 error += (exact_soln[0] - u_fe) * (exact_soln[0] - u_fe) * W;
591 } // for (unsigned ipt=0;ipt<n_intpt;ipt++)
592 } // End of compute_error
593
594 //======================================================================
595 /// Validate against exact solution at time t.
596 ///
597 /// Solution is provided via function pointer.
598 /// Plot error at a given number of plot points.
599 //======================================================================
600 template<unsigned SPATIAL_DIM>
602 std::ostream& outfile,
604 const double& time,
605 double& error,
606 double& norm)
607 {
608 // Initialise error value
609 error = 0.0;
610
611 // Initialise norm value
612 norm = 0.0;
613
614 // Storage for the time value
615 double interpolated_t = 0.0;
616
617 // Vector of local coordinates
618 Vector<double> s(SPATIAL_DIM + 1, 0.0);
619
620 // Vector for spatial coordinates
622
623 // Set the value of n_intpt
624 unsigned n_int_pt = integral_pt()->nweight();
625
626 // Exact solution vector (here it's simply a scalar)
628
629 // Loop over the integration points
630 for (unsigned ipt = 0; ipt < n_int_pt; ipt++)
631 {
632 // Assign values of s
633 for (unsigned i = 0; i < SPATIAL_DIM + 1; i++)
634 {
635 s[i] = integral_pt()->knot(ipt, i);
636 }
637
638 // Get the integral weight
639 double w = integral_pt()->weight(ipt);
640
641 // Get jacobian of mapping
642 double J = J_eulerian(s);
643
644 // Premultiply the weights and the Jacobian
645 double W = w * J;
646
647 // Get FE function value
648 double u_fe = interpolated_u_ust_heat(s);
649
650 // Loop over the spatial coordinates
651 for (unsigned i = 0; i < SPATIAL_DIM; i++)
652 {
653 // Assign the i-th spatial coordinate
655 }
656
657 // Get the time value
659
660 // Get the exact solution at this point
662
663 // Add to (exact) solution norm value
664 norm += exact_soln[0] * exact_soln[0] * W;
665
666 // Update the error norm value
667 error += (exact_soln[0] - u_fe) * (exact_soln[0] - u_fe) * W;
668 } // for (unsigned ipt=0;ipt<n_intpt;ipt++)
669
670 // The number of plot points
671 unsigned n_plot = 3;
672
673 // Tecplot header info
675
676 // Get the number of plot points
678
679 // Loop over plot points
680 for (unsigned iplot = 0; iplot < num_plot_points; iplot++)
681 {
682 // Get local coordinates of plot point
684
685 // Loop over the spatial coordinates
686 for (unsigned i = 0; i < SPATIAL_DIM; i++)
687 {
688 // Assign the i-th spatial coordinate
690
691 // Output the i-th coordinate at the point
692 outfile << spatial_coordinates[i] << " ";
693 }
694
695 // Get the time value
697
698 // Get FE function value
699 double u_fe = interpolated_u_ust_heat(s);
700
701 // Output the time value at this point
702 outfile << interpolated_t << " ";
703
704 // Get the exact solution at this point
706
707 // Output the exact solution at this point
708 outfile << exact_soln[0] - u_fe << std::endl;
709 } // for (unsigned iplot=0;iplot<num_plot_points;iplot++)
710
711 // Write tecplot footer (e.g. FE connectivity lists)
713 } // End of compute_error
714
715 //======================================================================
716 /// Output function:
717 /// x,t,u or x,y,t,u
718 /// at nplot points in each coordinate direction
719 //======================================================================
720 template<unsigned SPATIAL_DIM>
722 SPATIAL_DIM>::output_element_paraview(std::ofstream& file_out,
723 const unsigned& nplot)
724 {
725 // Change the scientific format so that E is used rather than e
726 file_out.setf(std::ios_base::uppercase);
727
728 // Make variables to hold the number of nodes and elements
729 unsigned number_of_nodes = this->nplot_points_paraview(nplot);
730
731 // Make variables to hold the number of elements
732 unsigned total_number_of_elements = this->nsub_elements_paraview(nplot);
733
734 //------------------
735 // File Declaration:
736 //------------------
737 // Insert the necessary lines plus header of file, and
738 // number of nodes and elements
739 file_out << "<?xml version=\"1.0\"?>\n"
740 << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" "
741 << "byte_order=\"LittleEndian\">\n"
742 << "<UnstructuredGrid>\n"
743 << "<Piece NumberOfPoints=\"" << number_of_nodes
744 << "\" NumberOfCells=\"" << total_number_of_elements << "\">\n";
745
746 //------------
747 // Point Data:
748 //------------
749 // Check the number of degrees of freedom
750 unsigned ndof = this->nscalar_paraview();
751
752 // Point data is going in here
753 file_out << "<PointData ";
754
755 // Insert just the first scalar name, since paraview reads everything
756 // else after that as being of the same type. Get information from
757 // first element.
758 file_out << "Scalars=\"" << this->scalar_name_paraview(0) << "\">\n";
759
760 // Loop over i scalar fields and j number of elements
761 for (unsigned i = 0; i < ndof; i++)
762 {
763 file_out << "<DataArray type=\"Float32\" "
764 << "Name=\"" << this->scalar_name_paraview(i) << "\" "
765 << "format=\"ascii\""
766 << ">\n";
767
768 // Output the i-th scalar field with nplot plot points
769 this->scalar_value_paraview(file_out, i, nplot);
770
771 // Close of the DataArray
772 file_out << "</DataArray>\n";
773 }
774
775 // Close off the PointData set
776 file_out << "</PointData>\n";
777
778 //------------------
779 // Geometric Points:
780 //------------------
781 // Always has to be 3 components for an unstructured grid
782 file_out << "<Points>\n"
783 << "<DataArray type=\"Float32\""
784 << " NumberOfComponents=\"" << 3 << "\" "
785 << "format=\"ascii\">\n";
786
787 // Print the plot points
788 this->output_paraview(file_out, nplot);
789
790 // Close off the geometric points set
791 file_out << "</DataArray>\n"
792 << "</Points>\n";
793
794 //-------
795 // Cells:
796 //-------
797 file_out << "<Cells>\n"
798 << "<DataArray type=\"Int32\" Name=\""
799 << "connectivity\" format=\"ascii\">\n";
800
801 // Make counter for keeping track of all the local elements,
802 // because Paraview requires global coordinates
803 unsigned counter = 0;
804
805 // Write connectivity with the local elements
806 this->write_paraview_output_offset_information(file_out, nplot, counter);
807
808 // Output header stuff
809 file_out << "</DataArray>\n"
810 << "<DataArray type=\"Int32\" "
811 << "Name=\"offsets\" format=\"ascii\">\n";
812
813 // Make variable that holds the current offset number
814 unsigned offset_sum = 0;
815
816 // Write the offset for the specific elements
817 this->write_paraview_offsets(file_out, nplot, offset_sum);
818
819 // Add in header information
820 file_out << "</DataArray>\n"
821 << "<DataArray type=\"UInt8\" Name=\"types\">\n";
822
823 // Get the type the element has
824 this->write_paraview_type(file_out, nplot);
825
826 // Finish off the data set
827 file_out << "</DataArray>\n"
828 << "</Cells>\n";
829
830 //--------------
831 // File Closure:
832 //--------------
833 file_out << "</Piece>\n"
834 << "</UnstructuredGrid>\n"
835 << "</VTKFile>";
836 } // End of output_element_paraview
837
838 //====================================================================
839 // Force build of templates
840 //====================================================================
844} // 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 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 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
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 nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction")
Definition elements.h:3190
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(* 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 unsigned self_test()
Self-test: Check inversion of element & do self-test for GeneralisedElement. Return 0 if OK.
Definition elements.cc:4470
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.
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
Definition shape.h:76
A class for all isoparametric elements that solve the SpaceTimeUnsteadyHeatMixedOrder equations.
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 compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Get error and norm against exact solution.
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.
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).